Search completed in 1.07 seconds.
7659 results for "type":
Your results are loading. Please wait...
TypeError: X.prototype.y called on incompatible type - JavaScript
the javascript exception "called on incompatible target (or object)" occurs when a function (on a given object), is called with a this not corresponding to the type expected by the function.
... message typeerror: 'this' is not a set object (edge) typeerror: function.prototype.tostring called on incompatible object (firefox) typeerror: function.prototype.bind called on incompatible target (firefox) typeerror: method set.prototype.add called on incompatible receiver undefined (chrome) typeerror: bind must be called on a function (chrome) error type typeerror what went wrong?
... when this error is thrown, a function (on a given object), is called with a this not corresponding to the type expected by the function.
...And 2 more matches
MIME types (IANA media types) - HTTP
a media type (also known as a multipurpose internet mail extensions or mime type) is a standard that indicates the nature and format of a document, file, or assortment of bytes.
... the internet assigned numbers authority (iana) is responsible for all official mime types, and you can find the most up-to-date and complete list at their media types page.
... important: browsers use the mime type, not the file extension, to determine how to process a url, so it's important that web servers send the correct mime type in the response's content-type header.
...And 62 more matches
TypedArray.prototype.filter() - JavaScript
the filter() method creates a new typed array with all elements that pass the test implemented by the provided function.
... this method has the same algorithm as array.prototype.filter().
... typedarray is one of the typed array types here.
...And 13 more matches
TypedArray.prototype.map() - JavaScript
the map() method creates a new typed array with the results of calling a provided function on every element in this typed array.
... this method has the same algorithm as array.prototype.map().
... typedarray is one of the typed array types here.
...And 13 more matches
TypedArray.prototype.findIndex() - JavaScript
the findindex() method returns an index in the typed array, if an element in the typed array satisfies the provided testing function.
... see also the find() method, which returns the value of a found element in the typed array instead of its index.
... syntax typedarray.findindex(callback[, thisarg]) parameters callback function to execute on each value in the typed array, taking three arguments: element the current element being processed in the typed array.
...And 11 more matches
TypedArray.prototype.reduce() - JavaScript
the reduce() method applies a function against an accumulator and each value of the typed array (from left-to-right) has to reduce it to a single value.
... this method has the same algorithm as array.prototype.reduce().
... typedarray is one of the typed array types here.
...And 11 more matches
TypedArray.prototype.reduceRight() - JavaScript
the reduceright() method applies a function against an accumulator and each value of the typed array (from right-to-left) has to reduce it to a single value.
... this method has the same algorithm as array.prototype.reduceright().
... typedarray is one of the typed array types here.
...And 11 more matches
TypedArray.prototype.find() - JavaScript
the find() method returns a value in the typed array, if an element satisfies the provided testing function.
...typedarray is one of the typed array types here.
... see also the findindex() method, which returns the index of a found element in the typed array instead of its value.
...And 10 more matches
TypedArray.prototype.lastIndexOf() - JavaScript
the lastindexof() method returns the last index at which a given element can be found in the typed array, or -1 if it is not present.
... the typed array is searched backwards, starting at fromindex.
... this method has the same algorithm as array.prototype.lastindexof().
...And 10 more matches
TypedArray.prototype.some() - JavaScript
the some() method tests whether some element in the typed array passes the test implemented by the provided function.
... this method has the same algorithm as array.prototype.some().
... typedarray is one of the typed array types here.
...And 10 more matches
TypedArray.prototype.every() - JavaScript
the every() method tests whether all elements in the typed array pass the test implemented by the provided function.
... this method has the same algorithm as array.prototype.every().
... typedarray is one of the typed array types here.
...And 8 more matches
TypedArray.prototype.indexOf() - JavaScript
the indexof() method returns the first index at which a given element can be found in the typed array, or -1 if it is not present.
... this method has the same algorithm as array.prototype.indexof().
... typedarray is one of the typed array types here.
...And 8 more matches
TypedArray.prototype.slice() - JavaScript
the slice() method returns a shallow copy of a portion of a typed array into a new typed array object.
... this method has the same algorithm as array.prototype.slice().
... typedarray is one of the typed array types here.
...And 8 more matches
Object.prototype.isPrototypeOf() - JavaScript
the isprototypeof() method checks if an object exists in another object's prototype chain.
... isprototypeof() differs from the instanceof operator.
... in the expression "object instanceof afunction", the object prototype chain is checked against afunction.prototype, not against afunction itself.
...And 6 more matches
TypedArray.prototype.forEach() - JavaScript
this method has the same algorithm as array.prototype.foreach().
... typedarray is one of the typed array types here.
... syntax typedarray.foreach(callback[, thisarg]) parameters callback function that produces an element of the new typed array, taking three arguments: currentvalue the current element being processed in the typed array.
...And 6 more matches
TypedArray.prototype.toString() - JavaScript
this method has the same algorithm as array.prototype.tostring().
... typedarray is one of the typed array types here.
... syntax typedarray.tostring() return value a string representing the elements of the typed array.
...And 5 more matches
TypedArray.prototype.fill() - JavaScript
the fill() method fills all the elements of a typed array from a start index to an end index with a static value.
... this method has the same algorithm as array.prototype.fill().
... typedarray is one of the typed array types here.
...And 4 more matches
TypedArray.prototype.join() - JavaScript
this method has the same algorithm as array.prototype.join().
... typedarray is one of the typed array types here.
... syntax typedarray.join([separator = ',']); parameters separator optional.
...And 4 more matches
TypedArray.prototype.sort() - JavaScript
the sort() method sorts the elements of a typed array numerically in place and returns the typed array.
... this method has the same algorithm as array.prototype.sort(), except that sorts the values numerically instead of as strings.
... typedarray is one of the typed array types here.
...And 4 more matches
TypedArray.prototype.reverse() - JavaScript
the reverse() method reverses a typed array in place.
... the first typed array element becomes the last and the last becomes the first.
... this method has the same algorithm as array.prototype.reverse().
...And 3 more matches
TypedArray.prototype.toLocaleString() - JavaScript
the tolocalestring() method returns a string representing the elements of the typed array.
...this method has the same algorithm as array.prototype.tolocalestring() and, as the typed array elements are numbers, the same algorithm as number.prototype.tolocalestring() applies for each element.
... typedarray is one of the typed array types here.
...And 3 more matches
TypedArray.prototype.byteLength - JavaScript
the bytelength accessor property represents the length (in bytes) of a typed array.
...the value is established when a typedarray is constructed and cannot be changed.
... if the typedarray is not specifying an byteoffset or a length, the length of the referenced arraybuffer will be returned.
...And 2 more matches
TypedArray.prototype.copyWithin() - JavaScript
this method has the same algorithm as array.prototype.copywithin.
... typedarray is one of the typed array types here.
... syntax typedarray.copywithin(target, start[, end = this.length]) parameters target target start index position where to copy the elements to.
...And 2 more matches
TypedArray.prototype.includes() - JavaScript
the includes() method determines whether a typed array includes a certain element, returning true or false as appropriate.
... this method has the same algorithm as array.prototype.includes().
... typedarray is one of the typed array types here.
...And 2 more matches
TypedArray.prototype.length - JavaScript
the length accessor property represents the length (in elements) of a typed array.
...the value is established when a typedarray is constructed and cannot be changed.
... if the typedarray is not specifying an byteoffset or a length, the length of the referenced arraybuffer will be returned.
...And 2 more matches
TypedArray.prototype.set() - JavaScript
the set() method stores multiple values in the typed array, reading input values from a specified array.
... syntax typedarray.set(array[, offset]) typedarray.set(typedarray[, offset]) parameters array the array from which to copy values.
... typedarray if the source array is a typed array, the two arrays may share the same underlying arraybuffer; the javascript engine will intelligently copy the source range of the buffer to the destination range.
...And 2 more matches
TypedArray.prototype.subarray() - JavaScript
the subarray() method returns a new typedarray on the same arraybuffer store and with the same element types as for this typedarray object.
...typedarray is one of the typed array types.
... syntax typedarray.subarray([begin [,end]]) parameters begin optional element to begin at.
...And 2 more matches
TypeError: invalid Array.prototype.sort argument - JavaScript
the javascript exception "invalid array.prototype.sort argument" occurs when the argument of array.prototype.sort() isn't either undefined or a function which compares its operands.
... message typeerror: argument is not a function object (edge) typeerror: invalid array.prototype.sort argument (firefox) error type typeerror what went wrong?
... the argument of array.prototype.sort() is expected to be either undefined or a function which compares its operands.
... examples invalid cases [1, 3, 2].sort(5); // typeerror var cmp = { asc: (x, y) => x >= y, dsc: (x, y) => x <= y }; [1, 3, 2].sort(cmp[this.key] || 'asc'); // typeerror valid cases [1, 3, 2].sort(); // [1, 2, 3] var cmp = { asc: (x, y) => x >= y, dsc: (x, y) => x <= y }; [1, 3, 2].sort(cmp[this.key || 'asc']); // [1, 2, 3] ...
TypedArray.prototype.buffer - JavaScript
the buffer accessor property represents the arraybuffer referenced by a typedarray at construction time.
...the value is established when the typedarray is constructed and cannot be changed.
... typedarray is one of the typedarray objects.
... examples using the buffer property var buffer = new arraybuffer(8); var uint16 = new uint16array(buffer); uint16.buffer; // arraybuffer { bytelength: 8 } specifications specification ecmascript (ecma-262)the definition of 'typedarray.prototype.buffer' in that specification.
TypedArray.prototype.byteOffset - JavaScript
the byteoffset accessor property represents the offset (in bytes) of a typed array from the start of its arraybuffer.
...the value is established when a typedarray is constructed and cannot be changed.
... typedarray is one of the typedarray objects.
... examples using the byteoffset property var buffer = new arraybuffer(8); var uint8 = new uint8array(buffer); uint8.byteoffset; // 0 (no offset specified) var uint8 = new uint8array(buffer, 3); uint8.byteoffset; // 3 (as specified when constructing uint8array) specifications specification ecmascript (ecma-262)the definition of 'typedarray.prototype.byteoffset' in that specification.
TypedArray.prototype[@@iterator]() - JavaScript
.log(n); } alternative iteration var arr = new uint8array([10, 20, 30, 40, 50]); var earr = arr[symbol.iterator](); console.log(earr.next().value); // 10 console.log(earr.next().value); // 20 console.log(earr.next().value); // 30 console.log(earr.next().value); // 40 console.log(earr.next().value); // 50 specifications specification ecmascript (ecma-262)the definition of '%typedarray%.prototype[@@iterator]()' in that specification.
TypedArray.prototype.entries() - JavaScript
tive iteration var arr = new uint8array([10, 20, 30, 40, 50]); var earr = arr.entries(); console.log(earr.next().value); // [0, 10] console.log(earr.next().value); // [1, 20] console.log(earr.next().value); // [2, 30] console.log(earr.next().value); // [3, 40] console.log(earr.next().value); // [4, 50] specifications specification ecmascript (ecma-262)the definition of '%typedarray%.prototype.entries()' in that specification.
TypedArray.prototype.keys() - JavaScript
rray) { console.log(n); } alternative iteration var arr = new uint8array([10, 20, 30, 40, 50]); var earr = arr.keys(); console.log(earr.next().value); // 0 console.log(earr.next().value); // 1 console.log(earr.next().value); // 2 console.log(earr.next().value); // 3 console.log(earr.next().value); // 4 specifications specification ecmascript (ecma-262)the definition of '%typedarray%.prototype.keys()' in that specification.
TypedArray.prototype.values() - JavaScript
console.log(n); } alternative iteration var arr = new uint8array([10, 20, 30, 40, 50]); var earr = arr.values(); console.log(earr.next().value); // 10 console.log(earr.next().value); // 20 console.log(earr.next().value); // 30 console.log(earr.next().value); // 40 console.log(earr.next().value); // 50 specifications specification ecmascript (ecma-262)the definition of '%typedarray%.prototype.values()' in that specification.
TypeScript support in Svelte - Learn web development
we will now learn how to use typescript in svelte applications.
... first we'll learn what typescript is and what benefits it can bring us.
... then we'll see how to configure our project to work with typescript files.
...And 174 more matches
TypedArray - JavaScript
a typedarray object describes an array-like view of an underlying binary data buffer.
... there is no global property named typedarray, nor is there a directly visible typedarray constructor.
... instead, there are a number of different global properties, whose values are typed array constructors for specific element types, listed below.
...And 85 more matches
Inheritance and the prototype chain - JavaScript
javascript is a bit confusing for developers experienced in class-based languages (like java or c++), as it is dynamic and does not provide a class implementation per se (the class keyword is introduced in es2015, but is syntactical sugar, javascript remains prototype-based).
...each object has a private property which holds a link to another object called its prototype.
... that prototype object has a prototype of its own, and so on until an object is reached with null as its prototype.
...And 78 more matches
Object prototypes - Learn web development
previous overview: objects next prototypes are the mechanism by which javascript objects inherit features from one another.
... in this article, we explain how prototype chains work and look at how the prototype property can be used to add methods to existing constructors.
... objective: to understand javascript object prototypes, how prototype chains work, and how to add new methods onto the prototype property.
...And 50 more matches
ctypes
the ctypes object contains methods and predefined data types used to create and manage a library.
... method overview ctype arraytype(type[, length]); cdata cast(data, type); ctype functiontype(abi, returntype[, argtype1, ...]); cdata int64(n); string libraryname(name); library open(libspec); ctype pointertype(typespec); ctype structtype(name[, fields]); cdata uint64(n); properties property type description errno number the value of the latest system error.
...these functions' names are automatically mangled for you by js-ctypes.
...And 47 more matches
Recommended Drag Types - Web APIs
the html drag and drop api supports dragging various types of data, including plain text, urls, html code, files, etc.
... the document describes best practices for common draggable data types.
... dragging text for dragging text, use the text/plain type.
...And 37 more matches
The HTML5 input types - Learn web development
previous overview: forms next in the previous article we looked at the <input> element, covering the original values of the type attribute available since the early days of html.
... now we'll look at the functionality of newer form controls in detail, including some new input types, which were added in html5 to allow collection of specific types of data.
... objective: to understand the newer input type values available to create native form controls, and how to implement them using html.
...And 33 more matches
JavaScript-DOM Prototypes in Mozilla
prototype setup on an xpconnect wrapped dom node in mozilla when a dom node is accessed from javascript in mozilla, the native c++ dom node is wrapped using xpconnect and the wrapper is exposed to javascript as the javascript representation of the dom node.
...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).
... 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 33 more matches
Properly configuring server MIME types - Learn web development
background by default, many web servers are configured to report a mime type of text/plain or application/octet-stream for unknown content types.
... as new content types are invented or added to web servers, web administrators may fail to add the new mime types to their web server's configuration.
... this is a major source of problems for users of gecko-based browsers, which respect the mime types as reported by web servers and web applications.
...And 32 more matches
The "codecs" parameter in common media types - Web media technologies
at a fundamental level, you can specify the type of a media file using a simple mime type, such as video/mp4 or audio/mpeg.
... however, many media types—especially those that support video tracks—can benefit from the ability to more precisely describe the format of the data within them.
... for instance, just describing a video in an mpeg-4 file with the mime type video/mp4 doesn't say anything about what format the actual media within takes.
...And 30 more matches
How Mozilla determines MIME Types
introduction all data handling in mozilla is based on the mime type of the content.
... this means that every time an uri is loaded, mozilla must find out its mime type.
... content-type "hints" mozilla has a concept of "content-type hints".
...And 29 more matches
Using Objective-C from js-ctypes
objective-c has its own syntax, it cannot be written directly with js-ctypes.
... this guide explains how to convert objective-c code into js-ctypes code.
... converting objective-c code to c code to convert objective-c code to js-ctypes, we need to convert it to c code first.
...And 29 more matches
<input type="file"> - HTML: Hypertext Markup Language
WebHTMLElementinputfile
<input> elements with type="file" let the user choose one or more files from their device storage.
... events change and input supported common attributes required additional attributes accept, capture, files, multiple idl attributes files and value dom interface htmlinputelement properties properties that apply only to elements of type file methods select() value a file input's value attribute contains a domstring that represents the path to the selected file(s).
... additional attributes in addition to the common attributes shared by all <input> elements, inputs of type file also support the following attributes: attribute description accept one or more unique file type specifiers describing file types to allow capture what source to use for capturing image or video data files a filelist listing the chosen files multiple a boolean which, if present, indicates that the user may choose more than one ...
...And 28 more matches
JavaScript data types and data structures - JavaScript
dynamic typing javascript is a loosely typed and dynamic language.
... variables in javascript are not directly associated with any particular value type, and any variable can be assigned (and re-assigned) values of all types: let foo = 42; // foo is now a number foo = 'bar'; // foo is now a string foo = true; // foo is now a boolean data and structure types the latest ecmascript standard defines nine types: six data types that are primitives, checked by typeof operator: undefined : typeof instance === "undefined" boolean : typeof instance === "boolean" number : typeof instance === "number" string : typeof instance === "string" bigint : typeof instance === "bigint" symbol : typeof instance === "symbol" null : typeof instance === "object".
... special primitive type having additional usage for its value: if object is not inherited, then null is shown; object : typeof instance === "object".
...And 27 more matches
CType
all data types declared using the js-ctypes api are represented by ctype objects.
... these objects have assorted methods and properties that let you create objects of these types, find out information about them, and so forth.
... the specific properties and methods on each object vary depending on the data type represented.
...And 26 more matches
StructType
structtype represents c structures.
... syntax returns a ctype object describing a new structure data type.
... this data type provides the ability to define and manipulate values of the c struct type.
...And 26 more matches
<input type="tel"> - HTML: Hypertext Markup Language
WebHTMLElementinputtel
<input> elements of type tel are used to let the user enter and edit a telephone number.
... unlike <input type="email"> and <input type="url"> , the input value is not automatically validated to a particular format before the form can be submitted, because formats for telephone numbers vary so much around the world.
... despite the fact that inputs of type tel are functionally identical to standard text inputs, they do serve useful purposes; the most quickly apparent of these is that mobile browsers — especially on mobile phones — may opt to present a custom keypad optimized for entering phone numbers.
...And 26 more matches
ArrayType
arraytype represents c arrays syntax returns a new ctype representing an array data type.
... ctype arraytype() type[ length] ); parameters type: it represents the type of the elements or variable which is going to be present in an array length optional it denotes the number of entries present in an array or the number of elements that an array should contain.
... return value a ctype represents the newly declared array type.
...And 24 more matches
<input type="datetime-local"> - HTML: Hypertext Markup Language
<input> elements of type datetime-local create input controls that let the user easily enter both a date and a time, including the year, month, and day as well as the time in hours and minutes.
...in other browsers, these degrade gracefully to simple <input type="text"> controls.
...the format of the date and time value used by this input type is described in local date and time strings in date and time formats used in html.
...And 24 more matches
<input type="email"> - HTML: Hypertext Markup Language
WebHTMLElementinputemail
<input> elements of type email are used to let the user enter and edit an e-mail address, or, if the multiple attribute is specified, a list of e-mail addresses.
... on browsers that don't support inputs of type email, a email input falls back to being a standard text input.
... value a domstring representing an e-mail address, or empty events change and input supported common attributes autocomplete, list, maxlength, minlength, multiple, name,pattern, placeholder, readonly, required, size, and type idl attributes list and value methods select() value the <input> element's value attribute contains a domstring which is automatically validated as conforming to e-mail syntax.
...And 24 more matches
<input type="month"> - HTML: Hypertext Markup Language
WebHTMLElementinputmonth
<input> elements of type month create input fields that let the user enter a month and year allowing a month and year to be easily entered.
...in browsers that don't support month inputs, the control degrades gracefully to a simple <input type="text">, although there may be automatic validation of the entered text to ensure it's formatted as expected.
...the format of the month string used by this input type is described in format of a valid local month string in date and time formats used in html.
...And 23 more matches
<input type="number"> - HTML: Hypertext Markup Language
WebHTMLElementinputnumber
<input> elements of type number are used to let the user enter a number.
... on browsers that don't support inputs of type number, a number input falls back to type text.
...you can set a default value for the input by including a number inside the value attribute, like so: <input id="number" type="number" value="42"> additional attributes in addition to the attributes commonly supported by all <input> types, inputs of type number support these attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options max the maximum value to accept for this input min the minim...
...And 23 more matches
<input type="time"> - HTML: Hypertext Markup Language
WebHTMLElementinputtime
<input> elements of type time create input fields designed to let the user easily enter a time (hours and minutes, and optionally seconds).
...support is good in modern browsers, with safari being the sole major browser not yet implementing it; in safari, and any other browsers that don't support <time>, it degrades gracefully to <input type="text">.
...you can set a default value for the input by including a valid time in the value attribute when creating the <input> element, like so: <label for="appt-time">choose an appointment time: </label> <input id="appt-time" type="time" name="appt-time" value="13:30"> you can also get and set the date value in javascript using the htmlinputelement.value property, for example: var timecontrol = document.queryselector('input[type="time"]'); timecontrol.value = '15:30'; time value format the value of the time input is always in 24-hour format that includes leading zeros: hh:mm, regardless of the input format, which is...
...And 23 more matches
<input type="url"> - HTML: Hypertext Markup Language
WebHTMLElementinputurl
<input> elements of type url are used to let the user enter and edit a url.
... on browsers that don't support inputs of type url, a url input falls back to being a standard text input.
... additional attributes in addition to the attributes that operate on all <input> elements regardless of their type, url inputs support the following attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options maxlength the maximum number of characters the input should accept minlength the minimum number of characters long the input can be and still be considered valid pattern ...
...And 23 more matches
Media container formats (file types) - Web media technologies
the format of audio and video media files is defined in two parts (three if a file has both audio and video in it, of course): the audio and/or video codecs used and the media container format (or file type) used.
...the mime types and extensions for each are listed.the most commonly used containers for media on the web are probably mpeg-4 (mp4), quicktime movie (mov), and the wavefile audio file format (wav).
...not all of these are broadly supported by browsers, however; some combinations of container and codec are sometimes given their own file extensions and mime types as a matter of convenience, or because of their ubiquity.
...And 23 more matches
lang/type - Archive of obsolete content
functions for working with type detection.
... let { isundefined } = require('sdk/lang/type'); var foo; isundefined(foo); // true isundefined(0); // false parameters value : mixed the variable to check.
... let { isnull } = require('sdk/lang/type'); isnull(null); // true isnull(false); // false parameters value : mixed the variable to check.
...And 22 more matches
Declaring types
the ctypes object offers a number of constructor methods that let you declare types.
... every type is represented by a ctype object, which, in turn, provides a constructor method you can call to define values of those types.
... each type you declare using js-ctypes corresponds to a compatible c declaration.
...And 22 more matches
Using js-ctypes
before you can use js-ctypes, you need to import the ctypes.jsm code module.
... this is as simple as including the following line of code in the desired javascript scope: components.utils.import("resource://gre/modules/ctypes.jsm") loading a native library once you've imported the code module, you can call the ctypes.open() method to load each native library you wish to use.
... on windows, for example, you might load the system user32 library like this: var lib = ctypes.open("user32.dll"); on mac os x, you can load the core foundation library from the core foundation framework like this: var corefoundation = ctypes.open("/system/library/frameworks/corefoundation.framework/corefoundation"); the returned object is a library object that you use to declare functions and data types for use with the loaded library.
...And 22 more matches
FunctionType
functiontype represents c function.
... syntax returns a new ctype object describing a c function.
... ctype functiontype( abi, returntype[, argtype1, ...] ); parameters abi the abi type for the function; this is one of the abi constants.
...And 22 more matches
PointerType
pointertype represents c pointer.
... syntax returns a new ctype object describing a new pointer data type.
... ctype pointertype( type ); parameters type specifies the type to which the pointer type points.
...And 21 more matches
<input type="image"> - HTML: Hypertext Markup Language
WebHTMLElementinputimage
<input> elements of type image are used to create graphical submit buttons, i.e.
... supported common attributes alt, src, width, height, formaction, formenctype, formmethod, formnovalidate, formtarget idl attributes none.
... value <input type="image"> elements do not accept value attributes.
...And 21 more matches
Object.prototype.__proto__ - JavaScript
warning: changing the [[prototype]] of an object is, by the nature of how modern javascript engines optimize property accesses, a very slow operation, in every browser and javascript engine.
...statements, but may extend to any code that has access to any object whose [[prototype]] has been altered.
... if you care about performance you should avoid setting the [[prototype]] of an object.
...And 21 more matches
<input type="date"> - HTML: Hypertext Markup Language
WebHTMLElementinputdate
<input> elements of type="date" create input fields that let the user enter a date, either with a textbox that validates the input or a special date picker interface.
...the time and datetime-local input types support time and date+time input.
...in unsupported browsers, the control degrades gracefully to <input type="text">.
...And 20 more matches
Grammar and types - JavaScript
« previousnext » this chapter discusses javascript's basic grammar, variable declarations, data types and literals.
... note: you might also see a third type of comment syntax at the start of some javascript files, which looks something like this: #!/usr/bin/env node.
... /* 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.
...And 20 more matches
Image file type and format guide - Web media technologies
in this guide, we'll cover the image file types generally supported by web browsers, and provide insights that will help you select the most appropriate formats to use for your site's imagery.
... common image file types there are many image file formats in the world.
... abbreviation file format mime type file extension(s) browser compatibility apng animated portable network graphics image/apng .apng chrome, edge, firefox, opera, safari bmp bitmap file image/bmp .bmp chrome, edge, firefox, internet explorer, opera, safari gif graphics interchange format image/gif .gif chrome, edge, firefox, internet explorer, opera, safari ico microsoft icon image/x-icon .ico, .cur chrome, edge, firefox, internet explorer, opera, safari jpeg joint ...
...And 20 more matches
js-ctypes reference
ctypes reference the ctypes object is the base of the ctypes api.
... it is obtained by by loading the ctypes module: components.utils.import("resource://gre/modules/ctypes.jsm"); you can use the ctypes object to load libraries, construct types, and perform miscellaneous tasks such as type casting.
... the ctypes object also provides numerous predefined types that correspond to primitives and common typedefs in c.
...And 19 more matches
<input type="week"> - HTML: Hypertext Markup Language
WebHTMLElementinputweek
<input> elements of type week create input fields allowing easy entry of a year plus the iso 8601 week number during that year (i.e., week 1 to 52 or 53).
...in non-supporting browsers, the control degrades gracefully to function identically to <input type="text">.
...the format of the date and time value used by this input type is described in format of a valid week string in date and time formats used in html.
...And 19 more matches
typeof - JavaScript
the typeof operator returns a string indicating the type of the unevaluated operand.
... syntax the typeof operator is followed by its operand: typeof operand typeof(operand) parameters operand an expression representing the object or primitive whose type is to be returned.
... description the following table summarizes the possible return values of typeof.
...And 19 more matches
JavaScript typed arrays - JavaScript
javascript typed arrays are array-like objects that provide a mechanism for reading and writing raw binary data in memory buffers.
...this is where typed arrays come in.
... each entry in a javascript typed array is a raw binary value in one of a number of supported formats, from 8-bit integers to 64-bit floating-point numbers.
...And 19 more matches
<input type="submit"> - HTML: Hypertext Markup Language
WebHTMLElementinputsubmit
<input> elements of type submit are rendered as buttons.
... <input type="submit" value="send request"> value a domstring used as the button's label events click supported common attributes type and value idl attributes value methods none value an <input type="submit"> element's value attribute contains a domstring which is displayed as the button's label.
... <input type="submit" value="send request"> if you don't specify a value, the button will have a default label, chosen by the user agent.
...And 18 more matches
Link types - HTML: Hypertext Markup Language
in html, link types indicate the relationship between two documents, in which one links to the other using an <a>, <area>, <form>, or <link> element.
... list of the defined link types and their significance in html link type description allowed in these elements not allowed in these elements alternate if the element is <link> and the rel attribute also contains the stylesheet type, the link defines an alternative style sheet; in that case the title attribute must be present and not be the empty string.
... if the type is set to application/rss+xml or application/atom+xml, the link defines a syndication feed.
...And 18 more matches
<input type="range"> - HTML: Hypertext Markup Language
WebHTMLElementinputrange
<input> elements of type range let the user specify a numeric value which must be no less than a given value, and no more than another given value.
...this is typically represented using a slider or dial control rather than a text entry box like the number input type.
... if the user's browser doesn't support type range, it will fall back and treat it as a text input.
...And 17 more matches
<input type="search"> - HTML: Hypertext Markup Language
WebHTMLElementinputsearch
<input> elements of type search are text fields designed for the user to enter search queries into.
... additional attributes in addition to the attributes that operate on all <input> elements regardless of their type, search field inputs support the following attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options maxlength the maximum number of characters the input should accept minlength the minimum number of characters long the input can be and still be considered valid ...
...any values in the list that are not compatible with the type are not included in the suggested options.
...And 17 more matches
Object.setPrototypeOf() - JavaScript
the object.setprototypeof() method sets the prototype (i.e., the internal [[prototype]] property) of a specified object to another object or null.
... warning: changing the [[prototype]] of an object is, by the nature of how modern javascript engines optimize property accesses, currently a very slow operation in every browser and javascript engine.
... in addition, the effects of altering inheritance are subtle and far-flung, and are not limited to simply the time spent in the object.setprototypeof(...) statement, but may extend to any code that has access to any object whose [[prototype]] has been altered.
...And 17 more matches
mimeTypes.rdf corruption - SVG: Scalable Vector Graphics
this page explains a problem that can cause svg to stop working in mozilla due to the way mozilla maps filename extensions to media types.
... background mozilla decides if and how it can open files by using their media (mime) type.
... it obtains the media type for files in various ways.
...And 16 more matches
NSPR Types
this chapter describes the most common nspr types.
... other chapters describe more specialized types when describing the functions that use them.
... calling convention types are used for externally visible functions and globals.
...And 15 more matches
Type conversion
implicit convert in js-ctypes, data could be converted implicitly when passing to or returning from a functiontype call, or setting pointer content, an array element or a struct field.
... var buffer = ctypes.char.array(10)(); var somecfunction = library.declare("somecfunction", ctypes.default_abi, ctypes.void_t, ctypes.char.ptr); somecfunction(buffer); // here ctypes.char.array(10)() is converted to ctypes.char.ptr type implicit conversion can be tested in the following way: var mystruct = ctypes.structtype("mystructtype", [ { "v": ctypes.bool } ])(); mystruct.v = 1; console.log(mystruct.v.tostring()); // 'true' boolean type target type source converted value ctypes.bool js boolean src js number (0 or 1) if src == 0: false if src == 1: true var mystruct = ctypes.structtype("mystructtype", [ { "v": ctypes.bool } ])(); mystruct.v = true; console.log(mystruct.v.tostring()); // 'true' mystruct.v = false; consol...
...e.log(mystruct.v.tostring()); // 'false' mystruct.v = 1; console.log(mystruct.v.tostring()); // 'true' mystruct.v = 0; console.log(mystruct.v.tostring()); // 'false' mystruct.v = 10; // throws error mystruct.v = "a"; // throws error integer types target type source converted value ctypes.char16_t js string (only if its length == 1) src.charcodeat(0) any integer types js number (only if fits to the size) src js boolean if src == true: 1 if src == false: 0 var mystruct = ctypes.structtype("mystructtype", [ { "v": ctypes.char16_t } ])(); mystruct.v = 0x41; console.log(mystruct.v.tostring()); // "a" mystruct.v = true; console.log(mystruct.v.tostring()); // "\x01" mystruct.v = "x"; console.log(mystruct...
...And 15 more matches
OpenType font features guide - CSS: Cascading Style Sheets
font features or variants refer to different glyphs or character styles contained within an opentype font.
...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.
...And 15 more matches
<input type="text"> - HTML: Hypertext Markup Language
WebHTMLElementinputtext
<input> elements of type text create basic single-line text fields.
... additional attributes in addition to the attributes that operate on all <input> elements regardless of their type, text inputs support the following attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options maxlength the maximum number of characters the input should accept minlength the minimum number of characters long the input can be and still be considered valid pattern ...
...any values in the list that are not compatible with the type are not included in the suggested options.
...And 15 more matches
nsMsgFolderFlagType
defined in comm-central/ mailnews/ base/ public/ nsmsgfolderflags.idl typedef unsigned long nsmsgfolderflagtype; /// flags about a folder or a newsgroup.
... [scriptable,uuid(fbe7cba8-3141-4c44-9660-99af6b53f27e)] interface nsmsgfolderflags { /** * @name folder type flags * these flags define the type of folder.
... const nsmsgfolderflagtype newsgroup = 0x00000001; /// this folder is a news server.
...And 14 more matches
Using the CSS Typed Object Model - Web APIs
the css typed object model api exposes css values as typed javascript objects to allow their performant manipulation.
... converting css object model value strings into meaningfully-typed javascript representations and back (via htmlelement.style) 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.
...And 13 more matches
Using COM from js-ctypes
com is c++ and it cannot be written directly with js-ctypes.
... this documentaion explains how to convert the com c++ code into js-ctypes code.
... basis and reference for this article bugzilla :: bug 738501 - implement ability to create windows shortcuts from javascript - comment 4 relavent topic bugzilla :: bug 505907 - support c++ calling from jsctypes converting com code to c code to convert com code to js-ctypes, we need to write c++ vtable pointers in c.
...And 12 more matches
XPathResult.resultType - Web APIs
the read-only resulttype property of the xpathresult interface represents the type of the result, as defined by the type constants.
... syntax var resulttype = result.resulttype; return value an integer value representing the type of the result, as defined by the type constants.
... constants result type defined constant value description any_type 0 a result set containing whatever type naturally results from evaluation of the expression.
...And 12 more matches
<input type="password"> - HTML: Hypertext Markup Language
WebHTMLElementinputpassword
<input> elements of type password provide a way for the user to securely enter a password.
... specifics of how the entry process works may vary from browser to browser; mobile devices, for example, often display the typed character for a moment before obscuring it, to allow the user to be sure they pressed the key they meant to press; this is helpful given the small size of keys and the ease with which the wrong one can be pressed, especially on virtual keyboards.
... additional attributes in addition to the attributes that operate on all <input> elements regardless of their type, password field inputs support the following attributes: attribute description maxlength the maximum length the value may be, in utf-16 characters minlength the minimum length in characters that will be considered valid pattern a regular expression the value must match in order to be valid placeholder an example value to display in ...
...And 12 more matches
itemtype - HTML: Hypertext Markup Language
the global attribute itemtype specifies the url of the vocabulary that will be used to define itemprop's (item properties) in the data structure.
... itemscope is used to set the scope of where in the data structure the vocabulary set by itemtype will be active.
...this vocabulary defines a standard set of type names and property names.
...And 12 more matches
Function.prototype.bind() - JavaScript
thus, presented below are two options for function.prototype.bind() polyfills: the first one is much smaller and more performant, but does not work when using the new operator.
... // does not work with `new (funca.bind(thisarg, args))` if (!function.prototype.bind) (function(){ var slice = array.prototype.slice; function.prototype.bind = function() { var thatfunc = this, thatarg = arguments[0]; var args = slice.call(arguments, 1); if (typeof thatfunc !== 'function') { // closest thing possible to the ecmascript 5 // internal iscallable function throw new typeerror('function.prototype.bind - ' + 'what is trying to be bound is not callable'); } return function(){ var fu...
... // yes, it does work with `new (funca.bind(thisarg, args))` if (!function.prototype.bind) (function(){ var arrayprototypeslice = array.prototype.slice; function.prototype.bind = function(otherthis) { if (typeof this !== 'function') { // closest thing possible to the ecmascript 5 // internal iscallable function throw new typeerror('function.prototype.bind - what is trying to be bound is not callable'); } var baseargs= arrayprototypeslice.call(argum...
...And 12 more matches
TypedArray.from() - JavaScript
the typedarray.from() method creates a new typed array from an array-like or iterable object.
... syntax typedarray.from(source[, mapfn[, thisarg]]) where typedarray is one of: int8array uint8array uint8clampedarray int16array uint16array int32array uint32array float32array float64array bigint64array biguint64array parameters source an array-like or iterable object to convert to a typed array.
... mapfn optional map function to call on every element of the typed array.
...And 11 more matches
WebGL types - Web APIs
WebAPIWebGL APITypes
the following types are used in webgl interfaces.
... webgl 1 these types are used within a webglrenderingcontext.
... type web idl type description glenum unsigned long used for enums.
...And 10 more matches
<input type="button"> - HTML: Hypertext Markup Language
WebHTMLElementinputbutton
<input> elements of type button are rendered as simple push buttons, which can be programmed to control custom functionality anywhere on a webpage as required when assigned an event handler function (typically for the click event).
... note: while <input> elements of type button are still perfectly valid html, the newer <button> element is now the favored way to create buttons.
... value a domstring used as the button's label events click supported common attributes type, and value idl attributes value methods none value an <input type="button"> elements' value attribute contains a domstring that is used as the button's label.
...And 10 more matches
Object.prototype.constructor - JavaScript
objects created without the explicit use of a constructor function (such as object- and array-literals) will have a constructor property that points to the fundamental object constructor type for that object.
... let o = {} o.constructor === object // true let o = new object o.constructor === object // true let a = [] a.constructor === array // true let a = new array a.constructor === array // true let n = new number(3) n.constructor === number // true examples displaying the constructor of an object the following example creates a constructor (tree) and an object of that type (thetree).
... function type () {} let types = [ new array(), [], new boolean(), true, // remains unchanged new date(), new error(), new function(), function () {}, math, new number(), 1, // remains unchanged new object(), {}, new regexp(), /(?:)/, new string(), 'test' // remains unchanged ] for (let i = 0; i < types.length; i++) { types[i].construct...
...And 10 more matches
DataTransfer.types - Web APIs
the datatransfer.types read-only property returns an array of the drag data formats (as strings) that were set in the dragstart event.
... the formats are unicode strings giving the type or format of the data, generally given by a mime type.
... some values that are not mime types are special-cased for legacy reasons (for example "text").
...And 9 more matches
DocumentType - Web APIs
the documenttype interface represents a node containing a doctype.
...0" fill="#fff" 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><polyline points="226,25 236,20 236,30 226,25" stroke="#d4dde4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/documenttype" target="_top"><rect x="266" y="1" width="120" 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">documenttype</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties fr...
... documenttype.entities read only a namednodemap of entities declared in the dtd.
...And 9 more matches
Node.nodeType - Web APIs
WebAPINodenodeType
the read-only node.nodetype property is an integer that identifies what the node is.
... syntax var type = node.nodetype; returns an integer which specifies the type of the node.
... possible values are listed in node type constants.
...And 9 more matches
ValidityState.typeMismatch - Web APIs
the read-only typemismatch property of a validitystate object indicates if the value of an <input>, after having been edited by the user, does not conform to the constraints set by the element's type attribute.
... if the type attribute expects specific strings, such as the email and url types and the value don't doesn't conform to the constraints set by the type, the typemismatch property will be true.
... the email input type expects one or more valid email addresses, depending on whether the multiple attribute is present.
...And 9 more matches
XMLHttpRequest.responseType - Web APIs
the xmlhttprequest property responsetype is an enumerated string value specifying the type of data contained in the response.
... it also lets the author change the response type.
... if an empty string is set as the value of responsetype, the default value of text is used.
...And 9 more matches
Intl.Locale.prototype.collation - JavaScript
the intl.locale.prototype.collation property is an accessor property that returns the collation type for the locale, which is used to order strings according to the locale's rules.
...the collation property helps to make it easier for javascript programmers to access the collation type used by a particular locale.
... below is a table with the available collation types, taken from the unicode collation specification.
...And 9 more matches
Reflect.setPrototypeOf() - JavaScript
the static reflect.setprototypeof() method is the same method as object.setprototypeof(), except for its return type.
... it sets the prototype (i.e., the internal [[prototype]] property) of a specified object to another object or to null, and returns true if the operation was successful, or false otherwise.
... syntax reflect.setprototypeof(target, prototype) parameters target the target object of which to set the prototype.
...And 9 more matches
TypeError - JavaScript
the typeerror object represents an error when an operation could not be performed, typically (but not 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.
...And 9 more matches
JS_GetPrototype
retrieves an object's prototype.
... syntax bool js_getprototype(jscontext *cx, js::handleobject obj, js::mutablehandleobject protop); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... obj js::handleobject object for which to retrieve the prototype.
...And 8 more matches
libmime content type handlers
pizzarro <rhp@netscape.com> contents overview api's plugin location/installation sample content type handler plugin overview the libmime module implements a general-purpose mime parser and one of the primary methods provided by the parser is the ability to emit an html representation of an input stream.
... a necessary capability of this module is to dynamically add the ability to decode and render various content types.
... this functionality will be accomplished via content type handler plugins for libmime.
...And 8 more matches
CSS Typed Object Model API - Web APIs
the css typed object model api simplifies css property manipulation by exposing css values as typed javascript objects rather than strings.
...css typed object model api provides interfaces to interact with underlying values, by representing them with specialized js objects that can be manipulated and understood more easily and more reliably than string parsing and concatenation.
... 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.
...And 8 more matches
list-style-type - CSS: Cascading Style Sheets
the list-style-type css property sets the marker (such as a disc, character, or custom counter style) of a list item element.
...however, the list-style-type property may be applied to any element whose display value is set to list-item.
... syntax /* partial list of types */ list-style-type: disc; list-style-type: circle; list-style-type: square; list-style-type: decimal; list-style-type: georgian; list-style-type: trad-chinese-informal; list-style-type: kannada; /* <string> value */ list-style-type: '-'; /* identifier matching an @counter-style rule */ list-style-type: custom-counter-style; /* keyword value */ list-style-type: none; /* global values */ list-style-type: inherit; list-style-type: initial; list-style-type: unset; the list-style-type property may be defined as any one of: a <custom-ident> value a symbols() value a <string> value the keyword none.
...And 8 more matches
<input type="radio"> - HTML: Hypertext Markup Language
WebHTMLElementinputradio
<input> elements of type radio are generally used in radio groups—collections of radio buttons describing a set of related options.
... the resulting html looks like this: <form> <p>please select your preferred contact method:</p> <div> <input type="radio" id="contactchoice1" name="contact" value="email"> <label for="contactchoice1">email</label> <input type="radio" id="contactchoice2" name="contact" value="phone"> <label for="contactchoice2">phone</label> <input type="radio" id="contactchoice3" name="contact" value="mail"> <label for="contactchoice3">mail</label> </div> <div> <button type="submi...
...the html is revised to add a <pre> block to output the form data into: <form> <p>please select your preferred contact method:</p> <div> <input type="radio" id="contactchoice1" name="contact" value="email"> <label for="contactchoice1">email</label> <input type="radio" id="contactchoice2" name="contact" value="phone"> <label for="contactchoice2">phone</label> <input type="radio" id="contactchoice3" name="contact" value="mail"> <label for="contactchoice3">mail</label> </div> <div> <bu...
...And 8 more matches
Intl.Locale.prototype.hourCycle - JavaScript
the intl.locale.prototype.hourcycle property is an accessor property that returns the time keeping format convention used by the locale.
... description there are 2 main types of time keeping conventions (clocks) used around the world: the 12 hour clock and the 24 hour clock.
... the hourcycle property makes it easier for javascript programmers to access the clock type used by a particular locale.
...And 8 more matches
handler.setPrototypeOf() - JavaScript
the handler.setprototypeof() method is a trap for object.setprototypeof().
... syntax const p = new proxy(target, { setprototypeof: function(target, prototype) { } }); parameters the following parameters are passed to the setprototypeof() method.
... prototype the object's new prototype or null.
...And 8 more matches
Mozilla's DOCTYPE sniffing - Archive of obsolete content
this document describes how mozilla uses the doctype declaration to determine strict mode vs.
... pages written using any public identifiers in doctype declarations that appear in the future should be displayed using strict mode.
... full standards mode the following trigger full standards mode: any document sent with an xml mime type such as text/xml, application/xml, or application/xhtml+xml (since sniffing only occurs for documents sent as text/html).
...And 7 more matches
JSType
the values of the jstype enumeration represent the types of javascript values.
... value description jstype_void the undefined value.
... jstype_object javascript objects.
...And 7 more matches
JS_SetPrototype
set a javascript object's prototype.
... syntax bool js_setprototype(jscontext *cx, js::handleobject obj, js::handleobject proto); name type description cx jscontext * the context in which to set the object's prototype.
... proto js::handleobject the object to set as the new prototype of obj.
...And 7 more matches
js-ctypes
js-ctypes allows application and extension code to call back and forth to native code written in c.
... c++ support is possible through vtable pointers see using com from js-ctypes.
...other work made possible by js-ctypes is jni, this is elaborated on in the jni.jsm section and not the js-ctypes section due to the jsm abstracting away all of the js-ctypes.
...And 7 more matches
DataTransferItem.type - Web APIs
the read-only datatransferitem.type property returns the type (format) of the datatransferitem object representing the drag data item.
... the type is a unicode string generally given by a mime type, although a mime type is not required.
... some example types are: text/plain and text/html.
...And 7 more matches
MediaRecorder.mimeType - Web APIs
the mimetype read-only property returns the mime media type that was specified when creating the mediarecorder object, or, if none was specified, which was chosen by the browser.
...see our media type and format guide for information about container and codec support across browsers.
... note: the term "mime type" is officially considered to be historical; these strings are now officially known as media types.
...And 7 more matches
<input type="checkbox"> - HTML: Hypertext Markup Language
WebHTMLElementinputcheckbox
<input> elements of type checkbox are rendered by default as boxes that are checked (ticked) when activated, like you might see in an official government paper form.
...take the following example: <form> <div> <input type="checkbox" id="subscribenews" name="subscribe" value="newsletter"> <label for="subscribenews">subscribe to newsletter?</label> </div> <div> <button type="submit">subscribe</button> </div> </form> in this example, we've got a name of subscribe, and a value of newsletter.
...if you wanted to submit a default value for the checkbox when it is unchecked, you could include an <input type="hidden"> inside the form with the same name and value, generated by javascript perhaps.
...And 7 more matches
<input type="reset"> - HTML: Hypertext Markup Language
WebHTMLElementinputreset
<input> elements of type "reset" are rendered as buttons, with a default click event handler that resets all of the inputs in the form to their initial values.
... value a domstring used as the button's label events click supported common attributes type and value idl attributes value methods none value an <input type="reset"> element's value attribute contains a domstring that is used as the button's label.
... <input type="reset" value="reset the form"> if you don't specify a value, you get an button with the default label (typically "reset," but this will vary depending on the user agent): <input type="reset"> using reset buttons <input type="reset"> buttons are used to reset forms.
...And 7 more matches
Content-Type - HTTP
the content-type entity header is used to indicate the media type of the resource.
... in responses, a content-type header tells the client what the content type of the returned content actually is.
... browsers will do mime sniffing in some cases and will not necessarily follow the value of this header; to prevent this behavior, the header x-content-type-options can be set to nosniff.
...And 7 more matches
Object.prototype.toSource() - JavaScript
for example: function person(name) { this.name = name; } person.prototype.tosource = function person_tosource() { return 'new person(' + uneval(this.name) + ')'; }; console.log(new person('joe').tosource()); // ---> new person("joe") built-in tosource() methods each core javascript type has its own tosource() method.
... these objects are: array.prototype.tosource() — array object.
... boolean.prototype.tosource() — boolean object.
...And 7 more matches
Reflect.getPrototypeOf() - JavaScript
the static reflect.getprototypeof() method is almost the same method as object.getprototypeof().
... it returns the prototype (i.e.
... the value of the internal [[prototype]] property) of the specified object.
...And 7 more matches
Content type - SVG: Scalable Vector Graphics
svg makes use of a number of data types.
... this article lists these types along with their syntax and descriptions of what they're used for.
... anything <anything> the basic type <anything> is a sequence of zero or more characters.
...And 7 more matches
Visual typescript game engine - Game development
project : visual typescript game engine version: sunshine - 2019 2d canvas game engine based on matter.js 2d physics engine for the web.
... written in typescript current version 3.1.3.
...*/ private addson: addson = [ { name: "cache", enabled: true, scriptpath: "externals/cacheinit.ts", }, { name: "hackertimer", enabled: true, scriptpath: "externals/hack-timer.js", }, { name: "dragging", enabled: true, scriptpath: "externals/drag.ts", }, ]; /** * @description this is main coordinary types of positions * can be "diametric-fullscreen" or "frame".
...And 6 more matches
AddonType
add-on types hold useful information about each type of add-on that may be installed.
... they are mostly used to help the ui know how to display the different types of add-on.
... properties attribute type description id string the unique id for the type.
...And 6 more matches
PerformanceObserverEntryList.getEntriesByType() - Web APIs
the getentriesbytype() method of the performanceobserverentrylist returns a list of explicitly observed performance entry objects for a given performance entry type.
... the list's members are determined by the set of entry types specified in the call to the observe() method.
... syntax entries = list.getentriesbytype(type); parameters type the type of entry to retrieve such as "frame".
...And 6 more matches
RTCIceCandidateStats.networkType - Web APIs
the rtcicecandidatestats dictionary's networktype property specifies the type of network used by a local candidate to communicate with a remote peer.
... note: the networktype property is only included in rtcicecandidatestats objects for local candidates (that is, candidates generated locally and included in an sdp offer or answer that has been sent to the remote peer).
... syntax networktype = rtcicecandidatestats.networktype; value a domstring whose value is taken from the rtcnetworktype enumerated type.
...And 6 more matches
<input type="color"> - HTML: Hypertext Markup Language
WebHTMLElementinputcolor
<input> elements of type color provide a user interface element that lets a user specify a color, either by using a visual color picker interface or by entering the color into a text field in #rrggbb hexadecimal format.
... value a 7-character domstring specifying a <color> in lower-case hexadecimal notation events change and input supported common attributes autocomplete and list idl attributes list and value methods select() value the value of an <input> element of type color is always a domstring which contains a 7-character string specifying an rgb color in hexadecimal format.
... note: any web browser that doesn't support an input of type color will naturally fall back to the type text.
...And 6 more matches
Array.prototype.reduce() - JavaScript
calling reduce() on an empty array without an initialvalue will throw a typeerror.
... if the array is empty and no initialvalue is provided, typeerror will be thrown.
... it is almost always safer to provide an initialvalue, because there can be up to four possible output types without initialvalue, as shown in the following example: let maxcallback = ( acc, cur ) => math.max( acc.x, cur.x ); let maxcallback2 = ( max, cur ) => math.max( max, cur ); // reduce without initialvalue [ { x: 2 }, { x: 22 }, { x: 42 } ].reduce( maxcallback ); // nan [ { x: 2 }, { x: 22 } ].reduce( maxcallback ); // 22 [ { x: 2 } ].reduce( maxcallback ); // { x: 2 } [ ].reduce( maxcallback ); // typeerror // map & r...
...And 6 more matches
Array.prototype.find() - JavaScript
if you need to find the index of a value, use array.prototype.indexof().
... (it’s similar to findindex(), but checks each element for equality with the value instead of using a testing function.) if you need to find if a value exists in an array, use array.prototype.includes().
... if you need to find if any element satisfies the provided testing function, use array.prototype.some().
...And 6 more matches
Intl.DateTimeFormat.prototype.formatToParts() - JavaScript
the intl.datetimeformat.prototype.formattoparts() method allows locale-aware formatting of strings produced by datetimeformat formatters.
...the structure the formattoparts() method returns, looks like this: [ { type: 'day', value: '17' }, { type: 'weekday', value: 'monday' } ] possible types are the following: day the string used for the day, for example "17".
...the formattoparts method enables locale-aware formatting of strings produced by datetimeformat formatters by providing you the string in parts: formatter.formattoparts(date); // return value: [ { type: 'weekday', value: 'monday' }, { type: 'literal', value: ', ' }, { type: 'month', value: '12' }, { type: 'literal', value: '/' }, { type: 'day', value: '17' }, { type: 'literal', value: '/' }, { type: 'year', value: '2012' }, { type: 'literal', value: ', ' }, { type: 'hour', value: '3' }, { type: 'literal', value: ...
...And 6 more matches
Media type and format guide: image, audio, and video content - Web media technologies
WebMediaFormats
the modern web has powerful features to support the presentation and manipulation of media, with several media-related apis supporting various types of content.
... this guide provides an overview of the media file types, codecs, and algorithms that may comprise media used on the web.
... it also provides browser support information for various combinations of these, and suggestions for prioritization of formats, as well as which formats excel at specific types of content.
...And 6 more matches
textbox.type - Archive of obsolete content
« xul reference home type type: one of the values below you can set the type attribute to one of the values below for a more specialized type of textbox.
... don't set the type if you wish to use a regular textbox.
... password a textbox that hides what is typed, used for entering passwords.
...And 5 more matches
IPDL Type Serialization
all types used in ipdl must be serializable.
... this is accomplished through type specialization of a c++ traits class.
... types are serialized and deserialized from an ipc::message type declared in ipc_message.h.
...And 5 more matches
I/O Types
this chapter describes the most common nspr types, enumerations, and structures used with the functions described in i/o functions and network addresses.
... these include the types used for system access, normal file i/o, and socket (network) i/o.
... types unique to a particular function are described with the function itself.
...And 5 more matches
nsIAccessibleScrollType
accessible/public/nsiaccessibletypes.idlscriptable these constants control the scrolling of an object or substring into a window.
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) constants constant value description scroll_type_top_left 0x00 scroll the top left of the object or substring to the top left of the window (or as close as possible).
... scroll_type_bottom_right 0x01 scroll the bottom right of the object or substring to the bottom right of the window (or as close as possible).
...And 5 more matches
MediaSource.isTypeSupported() - Web APIs
the mediasource.istypesupported() static method returns a boolean value which is true if the given mime type is likely to be supported by the current user agent.
... that is, if it can successfully create sourcebuffer objects for that mime type.
... syntax var isitsupported = mediasource.istypesupported(mimetype); parameters mimetype the mime media type that you want to test support for in the current browser.
...And 5 more matches
MimeTypeArray - Web APIs
the mimetypearray interface returns an array of mimetype instances, each of which contains information about a supported browser plugins.
... this object is returned by navigatorplugins.mimetypes.
... properties mimetypearray.length the number of items in the array.
...And 5 more matches
performance.getEntriesByType() - Web APIs
the getentriesbytype() method returns a list of performanceentry objects for a given type.
... syntax entries = window.performance.getentriesbytype(type); arguments type the type of entry to retrieve such as "mark".
... the valid entry types are listed in performanceentry.entrytype.
...And 5 more matches
PointerEvent.pointerType - Web APIs
the pointertype read-only property of the pointerevent interface indicates the device type (mouse, pen, or touch) that caused a given pointer event.
... syntax var ptype = pointerevent.pointertype; return value ptype the event's pointer type.
... if the device type cannot be detected by the browser, the value can be an empty string ("").
...And 5 more matches
RTCIceCandidate.type - Web APIs
the rtcicecandidate interface's read-only type specifies the type of candidate the object represents.
... the type field's value is set when the rtcicecandidate() constructor is used.
... you can't specify the value of type in the options object, but the address is automatically extracted from the candidate a-line, if it's formatted properly, being taken from its cand-type field.
...And 5 more matches
RTCStatsType - Web APIs
the rtcstatstype enumerated type (enum) is a set of strings which define the type of statistics reported in a record found in the rtcstatsreport object.
... this type determines which of the rtcstats-based dictionaries the record is based upon.
...this may include information such as the type of network, the protocol, the url, the type of relay being used, and so forth.
...And 5 more matches
SVGUnitTypes - Web APIs
the svgunittypes interface defines a commonly used set of constants used for reflecting gradientunits, patterncontentunits and other similar 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/svgunittypes" target="_top"><rect x="1" y="1" width="120" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="61" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgunittypes</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_unit_type_unknown 0 the ...
...type is not one of predefined types.
...And 5 more matches
TextEncoder.prototype.encodeInto() - Web APIs
the textencoder.prototype.encodeinto() method takes a usvstring to encode and a destination uint8array to put resulting utf-8 encoded text into, and returns a dictionary object indicating the progress of the encoding.
...the solution is typedarray.prototype.subarray().
...t8array(string.length); let encodedresults = textencoder.encodeinto(string, utf8); resultpara.textcontent += 'bytes read: ' + encodedresults.read + ' | bytes written: ' + encodedresults.written + ' | encoded result: ' + utf8; polyfill the polyfill below may be a bit long because of the switch cases and utilization of native textencoder.prototype.encode in safari when available, but it is well worth the length because of the gains in performance.
...And 5 more matches
XRReferenceSpaceType - Web APIs
the xrreferencespacetype enumerated type defines the strings which identify the types of reference spaces supported by webxr.
... this type is used when calling the requestreferencespace() method to obtain a reference space for an xrsession.
...the "interface" column in the table below indicates which of the two types is returned for each reference space type constant..
...And 5 more matches
<input type="hidden"> - HTML: Hypertext Markup Language
WebHTMLElementinputhidden
<input> elements of type hidden let web developers include data that cannot be seen or modified by users when a form is submitted.
... <input id="prodid" name="prodid" type="hidden" value="xm234jq"> value a domstring representing the value of the hidden data you want to pass back to the server.
... note: the input and change events do not apply to this input type.
...And 5 more matches
Common MIME types - HTTP
here is a list of mime types, associated by type of documents, ordered by their common extensions.
... two primary mime types are important for the role of default types: text/plain is the default value for textual files.
...an unknown file type should use this type.
...And 5 more matches
X-Content-Type-Options - HTTP
the x-content-type-options response http header is a marker used by the server to indicate that the mime types advertised in the content-type headers should not be changed and be followed.
... this is a way to opt out of mime type sniffing, or, in other words, to say that the mime types are deliberately configured.
... this header was introduced by microsoft in ie 8 as a way for webmasters to block content sniffing that was happening and could transform non-executable mime types into executable mime types.
...And 5 more matches
Array.prototype.map() - JavaScript
this algorithm is exactly the one specified in ecma-262, 5th edition, assuming object, typeerror, and array have their original values and that callback.call evaluates to the original value of function.prototype.call.
... // production steps of ecma-262, edition 5, 15.4.4.19 // reference: http://es5.github.io/#x15.4.4.19 if (!array.prototype.map) { array.prototype.map = function(callback/*, thisarg*/) { var t, a, k; if (this == null) { throw new typeerror('this is null or not defined'); } // 1.
...if iscallable(callback) is false, throw a typeerror exception.
...And 5 more matches
handler.getPrototypeOf() - JavaScript
the handler.getprototypeof() method is a trap for the [[getprototypeof]] internal method.
... syntax const p = new proxy(obj, { getprototypeof(target) { ...
... } }); parameters the following parameter is passed to the getprototypeof() method.
...And 5 more matches
toolbarbutton.type - Archive of obsolete content
« xul reference home type type: string the type of button.
... menu: set the type attribute to the value menu to create a button with a menu popup.
...unlike the menu type, this type requires the user to press the arrow to open the menu, but a different command may be invoked when the main part of the button is pressed.
...And 4 more matches
Type - MDN Web Docs Glossary: Definitions of Web-related terms
type is a characteristic of a value affecting what kind of data it can store, and the structure that the data will adhere to.
... for example, a boolean data type can hold only a true or false value at any given time, whereas a string has the ability to hold a string or a sequence of characters, a number can hold numerical values of any kind, and so on.
... a value's data type also affects the operations that are valid on that value.
...And 4 more matches
JS::GetFirstArgumentAsTypeHint
convert first argument of @@toprimitive method to jstype.
... syntax bool js::getfirstargumentastypehint(jscontext* cx, callargs args, jstype *result); name type description cx jscontext * the context in which to define functions.
... behavior jstype * receives the result of conversion.
...And 4 more matches
JS_GetClassPrototype
get the builtin class prototype object.
... syntax bool js_getclassprototype(jscontext *cx, jsprotokey key, js::mutablehandle<jsobject*> objp); name type description cx jscontext * a context.
... key jsprotokey the key of the prototype.
...And 4 more matches
Document.doctype - Web APIs
WebAPIDocumentdoctype
returns the document type declaration (dtd) associated with current document.
... the returned object implements the documenttype interface.
... use domimplementation.createdocumenttype() to create a documenttype.
...And 4 more matches
InputEvent.inputType - Web APIs
the inputtype read-only property of the inputevent interface returns the type of change made to editible content.
... syntax var astring = inputevent.inputtype; value a domstring containing the type of input that was made.
...for a complete list of the available input types, see the attributes section of the input events level 1 spec.
...And 4 more matches
MimeType - Web APIs
WebAPIMimeType
the mimetype interface provides contains information about a mime type associated with a particular plugin.
... navigatorplugins.mimetypes returns an array of this object.
... properties mimetype.type returns the mime type of the associated plugin.
...And 4 more matches
XMLHttpRequest.overrideMimeType() - Web APIs
the xmlhttprequest method overridemimetype() specifies a mime type other than the one provided by the server to be used instead when interpreting the data being transferred in a request.
... syntax xmlhttprequest.overridemimetype(mimetype) parameters mimetype a domstring specifying the mime type to use instead of the one specified by the server.
... if the server doesn't specify a type, xmlhttprequest assumes "text/xml".
...And 4 more matches
CSP: plugin-types - HTTP
the http content-security-policy (csp) plugin-types directive restricts the set of plugins that can be embedded into a document by limiting the types of resources which can be loaded.
... instantiation of an <embed>, <object> or <applet> element will fail if: the element to load does not declare a valid mime type, the declared type does not match one of specified types in the plugin-types directive, the fetched resource does not match the declared type.
... csp version 2 directive type document directive default-src fallback no.
...And 4 more matches
TypeError: "x" is not a function - JavaScript
message typeerror: object doesn't support property or method {x} (edge) typeerror: "x" is not a function error type typeerror what went wrong?
...you will have to provide a function in order to have these methods working properly: when working with array or typedarray objects: array.prototype.every(), array.prototype.some(), array.prototype.foreach(), array.prototype.map(), array.prototype.filter(), array.prototype.reduce(), array.prototype.reduceright(), array.prototype.find() when working with map and set objects: map.prototype.foreach() and set.prototype.foreach() examples a typo in the function name in this case, which hap...
...pens way too often, there is a typo in the method name: let x = document.getelementbyid('foo'); // typeerror: document.getelementbyid is not a function the correct function name is getelementbyid: let x = document.getelementbyid('foo'); function called on the wrong object for certain methods, you have to provide a (callback) function and it will work on specific objects only.
...And 4 more matches
TypeError: Reduce of empty array with no initial value - JavaScript
message typeerror: reduce of empty array with no initial value error type typeerror what went wrong?
... in javascript, there are several reduce functions: array.prototype.reduce(), array.prototype.reduceright() and typedarray.prototype.reduce(), typedarray.prototype.reduceright()).
...however, if no initial value is provided, it will use the first element of the array or typedarray as the initial value.
...And 4 more matches
TypeError: invalid arguments - JavaScript
the javascript exception "invalid arguments" occurs when typed array constructors are provided with a wrong argument.
... message typeerror: invalid arguments (firefox) error type typeerror what went wrong?
... typed array constructors require either a length, another typed array, array-like objects, iterable objects or an arraybuffer object to create a new typed array.
...And 4 more matches
TypeError: 'x' is not iterable - JavaScript
the javascript exception "is not iterable" occurs when 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.
... message typeerror: 'x' is not iterable (firefox, chrome) typeerror: 'x' is not a function or its return value is 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.
...And 4 more matches
Array.prototype.toLocaleString() - JavaScript
options optional an object with configuration properties, for numbers see number.prototype.tolocalestring(), and for dates see date.prototype.tolocalestring().
... polyfill // https://tc39.github.io/ecma402/#sup-array.prototype.tolocalestring if (!array.prototype.tolocalestring) { object.defineproperty(array.prototype, 'tolocalestring', { value: function(locales, options) { // 1.
... if (this == null) { throw new typeerror('"this" is null or not defined'); } var a = object(this); // 2.
...And 4 more matches
Intl.NumberFormat.prototype.formatToParts() - JavaScript
the intl.numberformat.prototype.formattoparts() method allows locale-aware formatting of strings produced by numberformat formatters.
... syntax intl.numberformat.prototype.formattoparts(number) parameters number optional a number or bigint to format.
...the structure the formattoparts() method returns, looks like this: [ { type: "integer", value: "3" }, { type: "group", value: "." }, { type: "integer", value: "500" } ] possible types are the following: currency the currency string, such as the symbols "$" and "€" or the name "dollar", "euro" depending on how currencydisplay is specified.
...And 4 more matches
Object.prototype.valueOf() - JavaScript
when you create a custom object, you can override object.prototype.valueof() to call a custom method instead of the default object method.
... suppose you have an object type mynumbertype and you want to create a valueof method for it.
... the following code assigns a user-defined function to the object's valueof method: mynumbertype.prototype.valueof = function() { return customprimitivevalue; }; with the preceding code in place, any time an object of type mynumbertype is used in a context where it is to be represented as a primitive value, javascript automatically calls the function defined in the preceding code.
...And 4 more matches
RegExp.prototype[@@replace]() - JavaScript
a number of special replacement patterns are supported; see the specifying a string as a parameter section in string.prototype.replace() page.
...the arguments supplied to this function are described in the specifying a function as a parameter section in string.prototype.replace() page.
... description this method is called internally in string.prototype.replace() if the pattern argument is a regexp object.
...And 4 more matches
browser.type - Archive of obsolete content
« xul reference home type type: one of the values below.
... the type of browser, which can be used to set access of the document loaded inside the browser.
...more precisely: the document loaded into a chrome window is always of chrome type.
...And 3 more matches
button.type - Archive of obsolete content
« xul reference home type type: one of the values below the type of button.
... checkbox this type of button can be in two states.
... menu set the type attribute to the value menu to create a button with a menu popup.
...And 3 more matches
Object.prototype.__noSuchMethod__ - Archive of obsolete content
} id the name of the non-existent method that was called args an array of the arguments passed to the method description by default, an attempt to call a method that doesn't exist on an object results in a typeerror being thrown.
...the second argument is an actual array (that is, it inherits through the array.prototype chain) and not the array-like arguments object.
... if this method cannot be called, either as if undefined by default, if deleted, or if manually set to a non-function, the javascript engine will revert to throwing typeerrors.
...And 3 more matches
JS_LinkConstructorAndPrototype
this article covers features introduced in spidermonkey 17 set up ctor.prototype = proto and proto.constructor = ctor with the right property flags.
... syntax bool js_linkconstructorandprototype(jscontext *cx, js::handle<jsobject*> ctor, js::handle<jsobject*> proto); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... proto js::handle&lt;jsobject*&gt; pointer to the prototype object.
...And 3 more matches
ctypes.open
at the heart of js-ctypes is the ctypes.open() function.
... int add(int a, int b) { return a + b; } to make this a shared library, a native file which can be loaded and used from js-ctypes, compile it with these commands: gcc -fpic -c mycfuntionsforunix.c gcc -shared -o mycfuntionsforunix.so mycfuntionsforunix.o a file named mycfuntionsforunix.so is successfully created.
... this native file can be placed in any folder of an addon and then loaded from js-ctypes.
...And 3 more matches
Blob.type - Web APIs
WebAPIBlobtype
the type property of a blob object returns the mime type of the file.
... syntax var mimetype = blob.type value a domstring containing the file's mime type, or an empty string if the type could not be determined.
... example this example asks the user to select a number of files, then checks each file to make sure it's one of a given set of image file types.
...And 3 more matches
ClipboardItem.getType() - Web APIs
the gettype() method of the clipboarditem interface returns a promise that resolves with a blob of the requested mime type or an error if the mime type is not found.
... syntax var blob = clipboarditem.gettype(type); parameters type a valid mime type.
... exceptions domexception the type does not match a known mime type.
...And 3 more matches
Event.type - Web APIs
WebAPIEventtype
the type read-only property of the event interface returns a string containing the event's type.
... for a list of available event types, see the event reference.
... syntax let eventtype = event.type; value a domstring containing the type of event.
...And 3 more matches
HTMLFormElement.enctype - Web APIs
the htmlformelement.enctype property is the mime type of content that is used to submit the form to the server.
... possible values are: application/x-www-form-urlencoded: the initial default type.
... multipart/form-data: the type that allows file <input> element(s) to upload file data.
...And 3 more matches
HTMLMediaElement.canPlayType() - Web APIs
the htmlmediaelement method canplaytype() reports how likely it is that the current browser will be able to play media of a given mime type.
... syntax canplayresponse = audioorvideo.canplaytype(mediatype); parameters mediatype a domstring containing the mime type of the media.
...the string will be one of the following values: probably media of the type indicated by the mediatype parameter is probably playable on this device.
...And 3 more matches
MediaRecorder.isTypeSupported - Web APIs
the mediarecorder.istypesupported() static method returns a boolean which is true if the mime type specified is one the user agent should be able to successfully record.
... syntax var canrecord = mediarecorder.istypesupported(mimetype) parameters mimetype the mime media type to check.
... return value true if the mediarecorder implementation is capable of recording blob objects for the specified mime type.
...And 3 more matches
Media Session action types - Web APIs
the specific type of media session action to be handled on a mediasession is identified using a string from the mediasessionaction enumerated type.
... syntax a media session action's type is specified using a string from the mediasessionaction enumerated type.
...implement support for each of these in order to allow that type of action to be performed.
...And 3 more matches
NDEFRecord.recordType - Web APIs
the recordtype property ofthe ndefrecord interface is usvstring containing the ndef record type.
... syntax ndefrecord.recordtype value a usvstring which can be one of the following: "empty" represents a empty ndef record.
... "mime" represents a mime type ndef record.
...And 3 more matches
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.
... 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.
...And 3 more matches
OscillatorNode.type - Web APIs
the type property of the oscillatornode interface specifies what shape of waveform the oscillator will output.
... syntax oscillatornode.type = type; value a domstring specifying the shape of oscillator wave.
...you never set type to custom manually; instead, use the setperiodicwave() method to provide the data representing the waveform.
...And 3 more matches
PerformanceEntry.entryType - Web APIs
the entrytype property returns a domstring representing the type of performance metric such as, for example, "mark".
... syntax var type = entry.entrytype; return value the return value depends on the subtype of the performanceentry object and affects the value of the performanceentry.name property as shown by the table below.
... performance entry type names value subtype type of name property description of name property frame, navigation performanceframetiming, performancenavigationtiming url the document's address.
...And 3 more matches
PerformanceNavigation.type - Web APIs
the legacy performancenavigation.type read-only property returns an unsigned short containing a constant describing how the navigation to this page was done.
... possible values are: value constant name meaning 0 type_navigate the page was accessed by following a link, a bookmark, a form submission, a script, or typing the url in the address bar.
... 1 type_reload the page was accessed by clicking the reload button or via the location.reload() method.
...And 3 more matches
RTCIceCandidate.tcpType - Web APIs
the rtcicecandidate interface's read-only tcptype property is included on tcp candidates to provide additional details about the candidate type.
... the tcptype field's value is set when the rtcicecandidate() constructor is used.
... syntax var tcptype = rtcicecandidate.tcptype; value a domstring whose value is one of those defined by the rtcicetcpcandidatetype enumerated type.
...And 3 more matches
RTCNetworkType - Web APIs
the webrtc rtcnetworktype enumerated type defines a set of strings used to identify the type of network used by a connection between two peers.
... this type is used as the value or the following properties: rtcicecandidate's networktype rtcstunserverconnectionstats's networktype values bluetooth a bluetooth connection is used by the described connection.
...the vpn obscures the underlying network type, which is not discernible.
...And 3 more matches
SourceBuffer.changeType() - Web APIs
the changetype() method of the sourcebuffer interface sets the mime type that future calls to appendbuffer() should expect the new media data to conform to.
... this makes it possible to change codecs or container type mid-stream.
... syntax sourcebuffer.changetype(type); parameters type a domstring specifying the mime type that future buffers will conform to.
...And 3 more matches
Type selectors - CSS: Cascading Style Sheets
the css type selector matches elements by node name.
... in other words, it selects all elements of the given type within a document.
...*/ a { color: red; } syntax element { style properties } examples css span { background-color: skyblue; } html <span>here's a span with some text.</span> <p>here's a p with some text.</p> <span>here's a span with more text.</span> result specifications specification status comment selectors level 4the definition of 'type (tag name) selector' in that specification.
...And 3 more matches
mask-type - CSS: Cascading Style Sheets
WebCSSmask-type
the mask-type css property sets whether an svg <mask> element is used as a luminance or an alpha mask.
... /* keyword values */ mask-type: luminance; mask-type: alpha; /* global values */ mask-type: inherit; mask-type: initial; mask-type: unset; this property may be overridden by the mask-mode property, which has the same effect but applies to the element where the mask is used.
... syntax the mask-type property is specified as one of the keyword values listed below.
...And 3 more matches
Warning: String.x is deprecated; use String.prototype.x instead - JavaScript
message warning: string.charat is deprecated; use string.prototype.charat instead warning: string.charcodeat is deprecated; use string.prototype.charcodeat instead warning: string.concat is deprecated; use string.prototype.concat instead warning: string.contains is deprecated; use string.prototype.contains instead warning: string.endswith is deprecated; use string.prototype.endswith instead warning: string.includes is deprecated; use string.prototype.includes instead warning: string.indexof is deprecated; use string.prototype.in...
...dexof instead warning: string.lastindexof is deprecated; use string.prototype.lastindexof instead warning: string.localecompare is deprecated; use string.prototype.localecompare instead warning: string.match is deprecated; use string.prototype.match instead warning: string.normalize is deprecated; use string.prototype.normalize instead warning: string.replace is deprecated; use string.prototype.replace instead warning: string.search is deprecated; use string.prototype.search instead warning: string.slice is deprecated; use string.prototype.slice instead warning: string.split is deprecated; use string.prototype.split instead warning: str...
...ing.startswith is deprecated; use string.prototype.startswith instead warning: string.substr is deprecated; use string.prototype.substr instead warning: string.substring is deprecated; use string.prototype.substring instead warning: string.tolocalelowercase is deprecated; use string.prototype.tolocalelowercase instead warning: string.tolocaleuppercase is deprecated; use string.prototype.tolocaleuppercase instead warning: string.tolowercase is deprecated; use string.prototype.tolowercase instead warning: string.touppercase is deprecated; use string.prototype.touppercase instead warning: string.trim is deprecated; use string.prototype.trim instead warning: string.trimleft is deprecated;...
...And 3 more matches
TypeError: "x" is (not) "y" - JavaScript
the javascript exception "x is (not) y" occurs when there was an unexpected type.
... message typeerror: unable to get property {x} of undefined or null reference (edge) typeerror: "x" is (not) "y" (firefox) examples: typeerror: "x" is undefined typeerror: "x" is null typeerror: "undefined" is not an object typeerror: "x" is not an object or null typeerror: "x" is not a symbol error type typeerror.
... there was an unexpected type.
...And 3 more matches
Array.prototype.reduceRight() - JavaScript
see also array.prototype.reduce() for left-to-right.
...calling reduce or reduceright on an empty array without an initial value creates a typeerror.
... if the array is empty and no initialvalue was provided, typeerror would be thrown.
...And 3 more matches
Array.prototype.findIndex() - JavaScript
polyfill // https://tc39.github.io/ecma262/#sec-array.prototype.findindex if (!array.prototype.findindex) { object.defineproperty(array.prototype, 'findindex', { value: function(predicate) { // 1.
... if (this == null) { throw new typeerror('"this" is null or not defined'); } var o = object(this); // 2.
...if iscallable(predicate) is false, throw a typeerror exception.
...And 3 more matches
Array.prototype.forEach() - JavaScript
early termination may be accomplished with: a simple for loop a for...of / for...in loops array.prototype.every() array.prototype.some() array.prototype.find() array.prototype.findindex() array methods: every(), some(), find(), and findindex() test the array elements with a predicate returning a truthy value to determine if further iteration is required.
...[2, 5, , 9].foreach(logarrayelements) // logs: // a[0] = 2 // a[1] = 5 // a[3] = 9 using thisarg the following (contrived) example updates an object's properties from each entry in the array: function counter() { this.sum = 0 this.count = 0 } counter.prototype.add = function(array) { array.foreach((entry) => { this.sum += entry ++this.count }, this) // ^---- note } const obj = new counter() obj.add([2, 5, 9]) obj.count // 3 obj.sum // 16 since the thisarg parameter (this) is provided to foreach(), it is passed to callback each time it's invoked.
...the following is just one way and is presented to explain how array.prototype.foreach() works by using ecmascript 5 object.* meta property functions.
...And 3 more matches
Array.prototype.indexOf() - JavaScript
note: for the string method, see string.prototype.indexof().
...this algorithm matches the one specified in ecma-262, 5th edition, assuming typeerror and math.abs() have their original values.
...if (!array.prototype.indexof) array.prototype.indexof = (function(object, max, min) { "use strict" return function indexof(member, fromindex) { if (this === null || this === undefined) throw typeerror("array.prototype.indexof called on null or undefined") var that = object(this), len = that.length >>> 0, i = min(fromindex | 0, len) if (i < 0) i = max(0, len + i) else if (i >= len) return -1 if (member === void 0) { // undefined for (; i !== len; ++i) if (that[i] === void 0 && i in that) return ...
...And 3 more matches
Function.prototype.apply() - JavaScript
apply is very similar to call(), except for the type of arguments it supports.
... function.prototype.construct = function(aargs) { let onew = object.create(this.prototype); this.apply(onew, aargs); return onew; }; note: the object.create() method used above is relatively new.
... for alternative methods, please consider one of the following approaches: using object.__proto__: function.prototype.construct = function (aargs) { let onew = {}; onew.__proto__ = this.prototype; this.apply(onew, aargs); return onew; }; using closures: function.prototype.construct = function(aargs) { let fconstructor = this, fnewconstr = function() { fconstructor.apply(this, aargs); }; fnewconstr.prototype = fconstructor.prototype; return new fnewconstr(); }; using the function constructor: function.prototype.construct = function (aargs) { let fnewconstr = new function(""); fnewconstr.prototype = this.prototype; let onew = new fnewconstr(); this.apply(onew, aargs); return onew; }; example usage: function myconstructor() { for (let nprop = 0; nprop < ...
...And 3 more matches
Intl​.List​Format​.prototype​.formatToParts() - JavaScript
the intl.listformat.prototype.formattoparts() method returns an array of objects representing the different components that can be used to format a list of values in a locale-aware fashion.
... syntax intl.listformat.prototype.formattoparts(list) parameters list an array of values to be formatted according to a locale.
... description whereas intl.listformat.prototype.format() returns a string being the formated version of the list (according to the given locale and style options), formattoparts() returns an array of the different components of the formated string.
...And 3 more matches
Object.getPrototypeOf() - JavaScript
the object.getprototypeof() method returns the prototype (i.e.
... the value of the internal [[prototype]] property) of the specified object.
... syntax object.getprototypeof(obj) parameters obj the object whose prototype is to be returned.
...And 3 more matches
Object.prototype.toString() - JavaScript
if this method is not overridden in a custom object, tostring() returns "[object type]", where type is the object type.
... the following code defines the dog object type and creates thedog, an object of type dog: function dog(name, breed, color, sex) { this.name = name; this.breed = breed; this.color = color; this.sex = sex; } thedog = new dog('gabby', 'lab', 'chocolate', 'female'); if you call the tostring() method on this custom object, it returns the default value inherited from object: thedog.tostring(); // returns [object object] the following...
... dog.prototype.tostring = function dogtostring() { const ret = 'dog ' + this.name + ' is a ' + this.sex + ' ' + this.color + ' ' + this.breed; return ret; } or, using es6 template strings: dog.prototype.tostring = function dogtostring() { return `dog ${this.name} is a ${this.sex} ${this.color} ${this.breed}`; } with the preceding code in place, any time thedog is used in a string context, javascript automatically calls the dogtostring() function, which returns the following string: "dog gabby is a female chocolate lab" using tostring() to detect object class tostring() can be...
...And 3 more matches
TypedArray.of() - JavaScript
the typedarray.of() method creates a new typed array from a variable number of arguments.
... syntax typedarray.of(element0[, element1[, ...[, elementn]]]) where typedarray is one of: int8array uint8array uint8clampedarray int16array uint16array int32array uint32array float32array float64array bigint64array biguint64array parameters elementn elements of which to create the typed array.
... return value a new typedarray instance.
...And 3 more matches
contentStyleType - SVG: Scalable Vector Graphics
the contentstyletype attribute specifies the style sheet language for the given document fragment on the <svg> element.
...the value specifies a media type, per mime part two: media types [rfc2046].
... usage notes value one of the content types specified in the media types default value text/css animatable no since css is the only widely deployed style sheet language for online styling and it's already defined as default value if contentstyletype is ommitted, the attribute is not well supported in user agents.
...And 3 more matches
type - SVG: Scalable Vector Graphics
WebSVGAttributetype
the type attribute is a generic attribute and it has different meaning based on the context in which it's used.
... for the <animatetransform> element, it defines the type of transformation, whose values change over time.
... for the <fecolormatrix> element, it indicates the type of matrix operation.
...And 3 more matches
JS_GetArrayPrototype
this article covers features introduced in spidermonkey 24 retrieves the original, canonical array.prototype for an object's global object.
... syntax jsobject * js_getarrayprototype(jscontext *cx, js::handleobject forobj); name type description cx jscontext * pointer to a javascript context from which to derive runtime information.
... forobj js::handleobject an object from the global whose array.prototype is being retrieved.
...And 2 more matches
JS_GetFunctionPrototype
this article covers features introduced in spidermonkey 17 retrieves the original, canonical function.prototype for an object's global object.
... syntax jsobject * js_getfunctionprototype(jscontext *cx, js::handleobject forobj); name type description cx jscontext * pointer to a javascript context from which to derive runtime information.
... forobj js::handleobject an object from the global whose function.prototype is being retrieved.
...And 2 more matches
JS_GetObjectPrototype
this article covers features introduced in spidermonkey 17 retrieves the original, canonical object.prototype for an object's global object.
... syntax jsobject * js_getobjectprototype(jscontext *cx, js::handleobject forobj); name type description cx jscontext * pointer to a javascript context from which to derive runtime information.
... forobj js::handleobject an object from the global whose object.prototype is being retrieved.
...And 2 more matches
JS_GetTypeName
returns a pointer to the string literal description of a specified js data type.
... syntax const char * js_gettypename(jscontext *cx, jstype type); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... type jstype one of jstype_void, jstype_object, jstype_function, jstype_string, jstype_number, or jstype_boolean.
...And 2 more matches
JS_TypeOfValue
determines the js data type of a js value.
... syntax jstype js_typeofvalue(jscontext *cx, js::handle<js::value> v); name type description cx jscontext * the context in which to perform the type check.
... description js_typeofvalue examines a specified js value, v, and returns its js data type.
...And 2 more matches
DOMImplementation.createDocumentType() - Web APIs
the domimplementation.createdocumenttype() method returns a documenttype object which can either be used with domimplementation.createdocument upon document creation or can be put into the document via methods like node.insertbefore() or node.replacechild().
... syntax var doctype = document.implementation.createdocumenttype(qualifiednamestr, publicid, systemid); parameters qualifiednamestr is a domstring containing the qualified name, like svg:svg.
... example var dt = document.implementation.createdocumenttype('svg:svg', '-//w3c//dtd svg 1.1//en', 'http://www.w3.org/graphics/svg/1.1/dtd/svg11.dtd'); var d = document.implementation.createdocument('http://www.w3.org/2000/svg', 'svg:svg', dt); alert(d.doctype.publicid); // -//w3c//dtd svg 1.1//en specifications specification status comment domthe definition of 'domimplementation.createdocumenttype' in that specification.
...And 2 more matches
File.type - Web APIs
WebAPIFiletype
returns the media type (mime) of the file represented by a file object.
... syntax var name = file.type; value a string, containing the media type(mime) indicating the type of the file, for example "image/png" for png images example <input type="file" multiple onchange="showtype(this)"> function showtype(fileinput) { var files = fileinput.files; for (var i = 0; i < files.length; i++) { var name = files[i].name; var type = files[i].type; alert("filename: " + name + " , type: " + type); } } note: based on the current implementation, browsers won't actually read the bytestream of a file to determine its media type.
...moreover, file.type is generally reliable only for common file types like images, html documents, audio and video.
...And 2 more matches
msAudioDeviceType - Web APIs
the msaudiodevicetype property of the html <audio> element, is a read/write proprietary attribute, specific to internet explorer and microsoft edge.
... msaudiodevicetype specifies the output device id that the audio will be sent to.
... syntax <audio src="sound.mp3" msaudiodevicetype="communications" /> by default, audio on your system will output to your default speakers and be considered a foreground element, meaning that the audio will play only when the element is active in the app.
...And 2 more matches
NonDocumentTypeChildNode.nextElementSibling - Web APIs
the nondocumenttypechildnode.nextelementsibling read-only property returns the element immediately following the specified one in its parent's children list, or null if the specified element is the last one in the list.
... syntax var nextnode = elementnodereference.nextelementsibling; example <div id="div-01">here is div-01</div> <div id="div-02">here is div-02</div> <script type="text/javascript"> var el = document.getelementbyid('div-01').nextelementsibling; console.log('siblings of div-01:'); while (el) { console.log(el.nodename); el = el.nextelementsibling; } </script> this example outputs the following into the console when it loads: siblings of div-01: div script polyfill for internet explorer 8 this property is unsupported prior to ie9, so the following snippet can be used to add support to ie8: // source: https://github.com/alhadis/snippets/blob/master/js/polyfills/ie8-child-elements.js if(!("nextelementsibling" in document.documentelement)){ object.defineproperty(element...
....prototype, "nextelementsibling", { get: function(){ var e = this.nextsibling; while(e && 1 !== e.nodetype) e = e.nextsibling; return e; } }); } polyfill for internet explorer 9+ and safari // source: https://github.com/jserz/js_piece/blob/master/dom/nondocumenttypechildnode/nextelementsibling/nextelementsibling.md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('nextelementsibling')) { return; } object.defineproperty(item, 'nextelementsibling', { configurable: true, enumerable: true, get: function () { var el = this; while (el = el.nextsibling) { if (el.nodetype === 1) { return el; } } return n...
...And 2 more matches
PerformanceResourceTiming.initiatorType - Web APIs
the initiatortype read-only property is a string that represents the type of resource that initiated the performance event.
... syntax resource.initiatortype; return value a string representing the type of resource that initiated the performance event, as specified above.
... example function print_performanceentries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_initiatortype(p[i]); } } function print_initiatortype(perfentry) { // print this performance entry object's initiatortype value var value = "initiatortype" in perfentry; if (value) console.log("...
...And 2 more matches
RTCDataChannel.binaryType - Web APIs
the property binarytype on the rtcdatachannel interface is a domstring which specifies the type of javascript object which should be used to represent binary data received on the rtcdatachannel.
... values allowed by the websocket.binarytype property are also permitted here: "blob" if blob objects are being used or "arraybuffer" if arraybuffer objects are being used.
... when a binary message is received on the data channel, the resulting message event's messageevent.data property is an object of the type specified by the binarytype.
...And 2 more matches
Report.type - Web APIs
WebAPIReporttype
the type read-only property of the report interface returns the type of report generated, e.g.
... syntax let reporttype = reportinstance.type returns a string representing the type of the report.
... currently the available types are deprecation, intervention, and crash.
...And 2 more matches
Response.type - Web APIs
WebAPIResponsetype
the type read-only property of the response interface contains the type of the response.
...this is the type for a response obtained from response.error().
... syntax var mytype = response.type; value a responsetype string indicating the type of the response.
...And 2 more matches
TypeInfo - Web APIs
WebAPITypeInfo
the obsolete typeinfo interface was intended to be used to describe a dom data type by keying its name to a namespace within the document's schema.
... properties typeinfo.typename read only returns a domstring indicating the type's name.
... typeinfo.typenamespace read only returns a domstring indicating the type's namespace within the schema.
...And 2 more matches
WakeLockSentinel.type - Web APIs
the read-only type property of the wakelocksentinel interface returns a string representation of the currently acquired wakelocksentinel type.
... syntax var type = wakelocksentinel.type; value a string representation of the currently acquired wake lock type.
... type read only return values are: 'screen': a screen wake lock.
...And 2 more matches
XMLHttpRequestResponseType - Web APIs
the xmlhttprequestresponsetype type is an enumerated set of strings which are used to specify the type of data contained in the response of an xmlhttprequest.
... these values are used when getting or setting the responsetype on the request.
... values "" an empty responsetype string is treated the same as "text", the default type.
...And 2 more matches
:first-of-type - CSS: Cascading Style Sheets
the :first-of-type css pseudo-class represents the first element of its type among a group of sibling elements.
... /* selects any <p> that is the first element of its type among its siblings */ p:first-of-type { color: red; } note: as originally defined, the selected element had to have a parent.
... syntax :first-of-type examples styling the first paragraph html <h2>heading</h2> <p>paragraph 1</p> <p>paragraph 2</p> css p:first-of-type { color: red; font-style: italic; } result nested elements this example shows how nested elements can also be targeted.
...And 2 more matches
:last-of-type - CSS: Cascading Style Sheets
the :last-of-type css pseudo-class represents the last element of its type among a group of sibling elements.
... /* selects any <p> that is the last element of its type among its siblings */ p:last-of-type { color: lime; } note: as originally defined, the selected element had to have a parent.
... syntax :last-of-type examples styling the last paragraph html <h2>heading</h2> <p>paragraph 1</p> <p>paragraph 2</p> css p:last-of-type { color: red; font-style: italic; } result nested elements this example shows how nested elements can also be targeted.
...And 2 more matches
:nth-last-of-type() - CSS: Cascading Style Sheets
the :nth-last-of-type() css pseudo-class matches elements of a given type, based on their position among a group of siblings, counting from the end.
... /* selects every fourth <p> element among any group of siblings, counting backwards from the last one */ p:nth-last-of-type(4n) { color: lime; } note: this pseudo-class is essentially the same as :nth-of-type, except it counts items backwards from the end, not forwards from the beginning.
... syntax the nth-last-of-type pseudo-class is specified with a single argument, which represents the pattern for matching elements, counting from the end.
...And 2 more matches
:nth-of-type() - CSS: Cascading Style Sheets
the :nth-of-type() css pseudo-class matches elements of a given type (tag name), based on their position among a group of siblings.
... /* selects every fourth <p> element among any group of siblings */ p:nth-of-type(4n) { color: lime; } syntax the nth-of-type pseudo-class is specified with a single argument, which represents the pattern for matching elements.
... formal syntax :nth-of-type( <nth> )where <nth> = <an-plus-b> | even | odd examples basic example html <div> <div>this element isn't counted.</div> <p>1st paragraph.</p> <p>2nd paragraph.</p> <div>this element isn't counted.</div> <p>3rd paragraph.</p> <p class="fancy">4th paragraph.</p> </div> css /* odd paragraphs */ p:nth-of-type(2n+1) { color: red; } /* even paragraphs */ p:nth-of-type(2n) { color: blue; } /* first paragraph */ p:nth-of-type(1) { font-weight: bold; } /* this has no effect, as the .fancy class is only on the 4th p element, not the 1st */ p.fancy:nth-of-type(1) { text-decoration: underline; } result specifications specification status comment selec...
...And 2 more matches
:only-of-type - CSS: Cascading Style Sheets
the :only-of-type css pseudo-class represents an element that has no siblings of the same type.
... /* selects each <p>, but only if it is the */ /* only <p> element inside its parent */ p:only-of-type { background-color: lime; } note: as originally defined, the selected element had to have a parent.
... syntax :only-of-type examples styling elements with no siblings of the same type html <main> <div>i am `div` #1.</div> <p>i am the only `p` among my siblings.</p> <div>i am `div` #2.</div> <div>i am `div` #3.
...And 2 more matches
scroll-snap-type - CSS: Cascading Style Sheets
the scroll-snap-type css property sets how strictly snap points are enforced on the scroll container in case there is one.
... /* keyword values */ scroll-snap-type: none; scroll-snap-type: x; scroll-snap-type: y; scroll-snap-type: block; scroll-snap-type: inline; scroll-snap-type: both; /* optional mandatory | proximity*/ scroll-snap-type: x mandatory; scroll-snap-type: y proximity; scroll-snap-type: both mandatory; /* etc */ /* global values */ scroll-snap-type: inherit; scroll-snap-type: initial; scroll-snap-type: unset; syntax values none when ...
... formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | [ x | y | block | inline | both ] [ mandatory | proximity ]?
...And 2 more matches
CSP: trusted-types - HTTP
the http content-security-policy (csp) trusted-types directive instructs user agents to restrict usage of known dom xss sinks to a predefined set of functions that only accept non-spoofable, typed values in place of strings.
...this directive declares a white-list of trusted type policy names created with trustedtypes.createpolicy from trusted types api.
... syntax content-security-policy: trusted-types; content-security-policy: trusted-types <policyname>; content-security-policy: trusted-types <policyname> <policyname> 'allow-duplicates'; <domstring> any string can be a trusted type policy name.
...And 2 more matches
TypeError: can't define property "x": "obj" is not extensible - JavaScript
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?
... examples adding new properties to a non-extensible objects in strict mode, attempting to add new properties to a non-extensible object throws a typeerror.
...And 2 more matches
Warning: Date.prototype.toLocaleFormat is deprecated - JavaScript
the javascript warning "date.prototype.tolocaleformat is deprecated; consider using intl.datetimeformat instead" occurs when the non-standard date.prototype.tolocaleformat method is used.
... message warning: date.prototype.tolocaleformat is deprecated; consider using intl.datetimeformat instead error type warning.
... the non-standard date.prototype.tolocaleformat method is deprecated and shouldn't be used anymore.
...And 2 more matches
TypeError: cannot use 'in' operator to search for 'x' in 'y' - JavaScript
the javascript exception "right-hand side of 'in' should be an object" occurs when the in operator was used to search in strings, or in numbers, or other primitive types.
... message typeerror: invalid operand to 'in' (edge) typeerror: right-hand side of 'in' should be an object, got 'x' (firefox) typeerror: cannot use 'in' operator to search for 'x' in 'y' (firefox, chrome) error type typeerror what went wrong?
...you can't search in strings, or in numbers, or other primitive types.
...And 2 more matches
TypeError: invalid 'instanceof' operand 'x' - JavaScript
an object which has a prototype property and is callable.
... message typeerror: invalid 'instanceof' operand "x" (firefox) typeerror: "x" is not a function (firefox) typeerror: right-hand side of 'instanceof' is not an object (chrome) typeerror: right-hand side of 'instanceof' is not callable (chrome) error type typeerror what went wrong?
...an object which has a prototype property and is callable.
...And 2 more matches
Array.prototype.every() - JavaScript
this algorithm is exactly the one specified in ecma-262, 5th edition, assuming object and typeerror have their original values, and that callbackfn.call evaluates to the original value of function.prototype.call.
... if (!array.prototype.every) { array.prototype.every = function(callbackfn, thisarg) { 'use strict'; var t, k; if (this == null) { throw new typeerror('this is null or not defined'); } // 1.
...if iscallable(callbackfn) is false, throw a typeerror exception.
...And 2 more matches
Date.prototype.toString() - JavaScript
description date instances inherit their tostring() method from date.prototype, not object.prototype.
... date.prototype.tostring() returns a string representation of the date in the format specified in ecma-262 which can be summarised as: week day: 3 letter english week day name, e.g.
..."sat sep 01 2018 14:53:26 gmt+1400 (lint)" until ecmascript 2018 (edition 9), the format of the string returned by date.prototype.tostring was implementation dependent.
...And 2 more matches
Function.prototype.toString() - JavaScript
description the function object overrides the tostring method inherited from object; it does not inherit object.prototype.tostring.
... the tostring() method will throw a typeerror exception ("function.prototype.tostring called on incompatible object"), if its this value object is not a function object.
... function.prototype.tostring.call('foo'); // typeerror if the tostring() method is called on built-in function objects or a function created by function.prototype.bind, tostring() returns a native function string which looks like "function () {\n [native code]\n}" if the tostring() method is called on a function created by the function constructor, tostring() returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body.
...And 2 more matches
Intl.DisplayNames.prototype.of() - JavaScript
syntax displaynames.of(code); parameters code the code to provide depends on the type: if the type is "region", code should be either an iso-3166 two letters region code, or a three digits un m49 geographic regions.
... if the type is "script", code should be an iso-15924 four letters script code.
... if the type is "language", code should be a languagecode ["-" scriptcode] ["-" regioncode ] *("-" variant ) subsequence of the unicode_language_id grammar in uts 35's unicode language and locale identifiers grammar.
...And 2 more matches
Intl.Locale.prototype.calendar - JavaScript
the intl.locale.prototype.calendar property is an accessor property which returns the type of calendar used in the locale.
...thus, the calendar era type can be added to the inital locale identifier string that is passed into the intl.locale constructor.
... to add the calendar type, first add the -u extension to the string.
...And 2 more matches
String.prototype.match() - JavaScript
if you want to obtain capture groups and the global flag is set, you need to use regexp.exec() or string.prototype.matchall() instead.
... const str = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'; const regexp = /[a-e]/gi; const matches_array = str.match(regexp); console.log(matches_array); // ['a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e'] note: see also string.prototype.matchall() and advanced searching with flags.
...returns ["number"] str1.match(nan); // the type of nan is the number.
...And 2 more matches
get TypedArray[@@species] - JavaScript
the typedarray[@@species] accessor property returns the constructor of a typed array.
... description the species accessor property returns the default constructor for typed array objects.
... examples species in ordinary objects the species property returns the default constructor function, which is one of the typed array constructors for a given typed array object: int8array[symbol.species]; // function int8array() uint8array[symbol.species]; // function uint8array() float32array[symbol.species]; // function float32array() species in derived objects in a derived collection object (e.g.
...And 2 more matches
TypedArray.name - JavaScript
the typedarray.name property represents a string value of the typed array constructor name.
... property attributes of typedarray.name writable no enumerable no configurable no description typedarray objects differ from each other in the number of bytes per element and in the way the bytes are interpreted.
... the name property describes of what data type the array consists.
...And 2 more matches
Effective connection type - MDN Web Docs Glossary: Definitions of Web-related terms
effective connection type (ect) refers to the measured network performance, returning a cellular connection type, like 3g, even if the actual connection is tethered broadband or wifi, based on the time between the browser requesting a page and effective type of the connection.
... table of effective connection types ect minimum rtt maximum downlink explanation slow-2g 2000ms 50 kbps the network is suited for small transfers only such as text-only pages.
... effectivetype is a property of the network information api, exposed to javascript via the navigator.connection object.
... to see your effective connection type, open the console of the developer tools of a supporting browser and enter the following: navigator.connection.effectivetype; see also: network information api networkinformation networkinformation.effectivetype ...
Type, class, and ID selectors - Learn web development
type selectors a type selector is sometimes referred to as a tag name selector or element selector, because it selects an html tag/element in your document.
...we do this by using the type selector for the element i want to target, with the class appended using a dot, with no white space in between.
...it can select an element that has the id set on it, and you can precede the id with a type selector to only target the element if both the element and id match.
... previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
TypeListener
typelisteners can be registered with addtypelistener() and will then receive notification as addontype are registered and unregistered.
... method overview void ontypeadded(in addontype type) void ontyperemoved(in addontype type) methods ontypeadded() called when an add-on type has been added.
... void ontypeadded( in addontype type ) parameters type the addontype that is being added needsrestart true if an application restart is necessary for the change to take effect ontyperemoved() called when an add-on type has been removed.
... void ontyperemoved( in addontype type, ) parameters type the addontype that has been removed ...
PR_GetDescType
describes what type of file is referenced by a specified file descriptor.
... syntax #include <prio.h> prdesctype pr_getdesctype(prfiledesc *file); parameter the function has the following parameter: file a pointer to a prfiledesc object whose descriptor type is to be returned.
... returns the function returns a prdesctype enumeration constant that describes the type of file.
... description the prdesctype enumeration is defined as follows: typedef enum prdesctype { pr_desc_file = 1, pr_desc_socket_tcp = 2, pr_desc_socket_udp = 3, pr_desc_layered = 4 } prdesctype; the enumeration has the following enumerators: pr_desc_file the prfiledesc object represents a normal file.
JSExnType
this article covers features introduced in spidermonkey 17 possible exception types.
... value prototype in javascript jsexn_none an unthrowable error.
... (lower bound) jsexn_err error jsexn_internalerr internalerror jsexn_evalerr evalerror jsexn_rangeerr rangeerror jsexn_referenceerr referenceerror jsexn_syntaxerr syntaxerror jsexn_typeerr typeerror jsexn_urierr urierror jsexn_limit (upper bound) description these types are part of a jserrorformatstring structure.
... see also mxr id search for jsexntype jserrorformatstring bug 684526 ...
JS_GetErrorPrototype
this article covers features introduced in spidermonkey 38 return the original value of error.prototype.
... syntax jsobject * js_geterrorprototype(jscontext *cx); name type description cx jscontext * pointer to a js context whose errors should be reported via your function.
... description js_geterrorprototype returns the original value of error.prototype from the global object of the current compartment of cx.
... see also mxr id search for js_geterrorprototype bug 997285 ...
JS_InitCTypesClass
this article covers features introduced in spidermonkey 1.8.5 initialize the ctypes object on a global object.
... the ctypes object will be frozen.
... syntax jsbool js_initctypesclass(jscontext *cx, jsobject *global); name type description cx jscontext * the context.
... description ctypes capability is disabled in a build by default.
nsIAccessibleCoordinateType
accessible/public/nsiaccessibletypes.idlscriptable these constants define which coordinate system a point is located in.
...constants constant value description coordtype_screen_relative 0x00 the coordinates are relative to the screen.
... coordtype_window_relative 0x01 the coordinates are relative to the window.
... coordtype_parent_relative 0x02 the coordinates are relative to the upper left corner of the bounding box of the immediate parent.
BasicCardRequest.supportedTypes - Web APIs
the obsolete supportedtypes property of the basiccardrequest dictionary can optionally be provided to specify an array of domstrings representing the card types that the retailer supports (e.g.
... syntax basiccardrequest.supportedtypes = [cardtype1...cardtypen]; value an array containing one or more domstrings, which describe the card types the retailer supports.
... legal values are defined in basiccardtype enum, and are currently: credit debit prepaid example the following example shows a sample definition of the first parameter of the paymentrequest() constructor, the data property of which contains supportednetworks and supportedtypes properties.
... var supportedinstruments = [{ supportedmethods: 'basic-card', data: { supportednetworks: ['visa', 'mastercard', 'amex', 'jcb', 'diners', 'discover', 'mir', 'unionpay'], supportedtypes: ['credit', 'debit'] } }]; var details = { ...
BiquadFilterNode.type - Web APIs
the type property of the biquadfilternode interface is a string (enum) value defining the kind of filtering algorithm the node is implementing.
... syntax var audioctx = new audiocontext(); var biquadfilter = audioctx.createbiquadfilter(); biquadfilter.type = 'lowpass'; value a string (enum) representing a biquadfiltertype.
... type values and their meaning type description frequency q gain lowpass standard second-order resonant lowpass filter with 12db/octave rolloff.
... = audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(biquadfilter); biquadfilter.connect(convolver); convolver.connect(gainnode); gainnode.connect(audioctx.destination); // manipulate the biquad filter biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = 25; specifications specification status comment web audio apithe definition of 'type' in that specification.
CSSNumericValue.type - Web APIs
the type() method of the cssnumericvalue interface returns the type of cssnumericvalue, one of angle, flex, frequency, length, resolution, percent, percenthint, or time.
... syntax var cssnumerictype = cssnumericvalue.type(); parameters none.
... return value a cssnumerictype object.
... examples let mathsum = css.px("23").sub(css.percent("4")).sub(css.cm("3")).sub(css.in("9")); // returns an object with the structure: {length: 1, percenthint: "length"} let cssnumerictype = mathsum.type(); specifications specification status comment css typed om level 1the definition of 'type' in that specification.
ClipboardItem.types - Web APIs
the read-only types property of the clipboarditem interface returns an array of mime types available within the clipboarditem syntax var types = clipboarditem.types; value an array of available mime types.
...then checking the types property for available types before utilizing the clipboarditem.gettype() method to return the blob object.
... if no clipboards contents is found for the specified type, an error is returned.
... async function getclipboardcontents() { try { const clipboarditems = await navigator.clipboard.read(); for (const clipboarditem of clipboarditems) { for (const type of clipboarditem.types) { const blob = await clipboarditem.gettype(type); // we can now use blob here } } } catch (err) { console.error(err.name, err.message); } } specifications specification status comment clipboard api and eventsthe definition of 'clipboarditem' in that specification.
DataTransfer.mozTypesAt() - Web APIs
the datatransfer.moztypesat() method returns a list of the format types that are stored for an item at the specified index.
... syntax nsivariant datatransfer.moztypesat(index); arguments index a unsigned long that is the index of the data for which to retrieve the types.
... example this example shows the use of the moztypesat() method in a drop event handler.
... function drop_handler(event) { var dt = event.datatransfer; var count = dt.mozitemcount; output("items: " + count + "\n"); for (var i = 0; i < count; i++) { output(" item " + i + ":\n"); var types = dt.moztypesat(i); for (var t = 0; t < types.length; t++) { output(" " + types[t] + ": "); try { var data = dt.mozgetdataat(types[t], i); output("(" + (typeof data) + ") : <" + data + " >\n"); } catch (ex) { output("<>\n"); dump(ex); } } } } specifications this method is not defined in any web standard.
Document.contentType - Web APIs
the document.contenttype read-only property returns the mime type that the document is being rendered as.
... this may come from http headers or other sources of mime information, and might be affected by automatic type conversions performed by either the browser or extensions.
... syntax contenttype = document.contenttype; value contenttype is a read-only property.
... specifications specification status comment domthe definition of 'document.contenttype' in that specification.
NavigatorPlugins.mimeTypes - Web APIs
returns a mimetypearray object, which contains a list of mimetype objects representing the mime types recognized by the browser.
... note: named properties of mimetypearray objects are no longer enumerable in the latest browser versions.
... syntax var mimetypes[] = navigator.mimetypes; mimetypes is a mimetypearray object which has a length property as well as item(index) and nameditem(name) methods.
... example function isjavapresent() { return 'application/x-java-applet' in navigator.mimetypes; } function getjavaplugindescription() { var mimetype = navigator.mimetypes['application/x-java-applet']; if (mimetype === undefined) { // no java plugin present return undefined; } return mimetype.enabledplugin.description; } specifications specification status comment html living standardthe definition of 'navigatorplugins.mimetypes' in that specification.
NonDocumentTypeChildNode.previousElementSibling - Web APIs
the nondocumenttypechildnode.previouselementsibling read-only property returns the element immediately prior to the specified one in its parent's children list, or null if the specified element is the first one in the list.
...div polyfills polyfill for internet explorer 8 this property is unsupported prior to ie9, so the following snippet can be used to add support to ie8: // source: https://github.com/alhadis/snippets/blob/master/js/polyfills/ie8-child-elements.js if(!("previouselementsibling" in document.documentelement)){ object.defineproperty(element.prototype, "previouselementsibling", { get: function(){ var e = this.previoussibling; while(e && 1 !== e.nodetype) e = e.previoussibling; return e; } }); } polyfill for internet explorer 9+ and safari // source: https://github.com/jserz/js_piece/blob/master/dom/nondocumenttypechildnode/previouselementsibling/previouselementsibling.md (function (arr) { arr.foreach(fun...
...ction (item) { if (item.hasownproperty('previouselementsibling')) { return; } object.defineproperty(item, 'previouselementsibling', { configurable: true, enumerable: true, get: function () { let el = this; while (el = el.previoussibling) { if (el.nodetype === 1) { return el; } } return null; }, set: undefined }); }); })([element.prototype, characterdata.prototype]); specifications specification status comment domthe definition of 'nondocumenttypechildnode.previouselementsibling' in that specification.
... living standard splitted the elementtraversal interface in childnode, parentnode, and nondocumenttypechildnode.
PaymentRequest.shippingType - Web APIs
the shippingtype read-only property of the paymentrequest interface returns one of "shipping", "delivery", "pickup", or null if one was not provided by the constructor.
... syntax var shippingtype = paymentrequest.shippingtype value one of "shipping", "delivery", "pickup", or null.
... specifications specification status comment payment request apithe definition of 'shippingtype' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetshippingtypechrome full support 61edge full support 15firefox full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.requ...
PerformanceNavigationTiming.type - Web APIs
the type read-only property returns a string representing the type of navigation.
... syntax perfentry.type; return value a string which is one of the values listed above.
... function print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other prope...
...rties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'type' in that specification.
RTCIceCandidateType - Web APIs
the webrtc api's rtcicecandidatetype enumerated type provides a set of domstring values representing the types of ice candidate that can arrive.
... values these candidate types are listed in order of priority; the higher in the list they are, the more efficient they are.
... usage notes the rtcicecandidatetype enumeration is used by the type property of rtcicecandidate objects, as well as when reporting statistics on candidates using rtcicecandidatestats.candidatetype.
... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidatetype' in that specification.
RTCIceServer.credentialType - Web APIs
the rtciceserver dictionary's credentialtype property is a string value from the rtcicecredentialtype enum which indicates what type of credential the rtciceserver.credential value is.
... credentialtype = newcredentialtype, ...
... }; var credentialtype = iceserver.credentialtype; iceserver.credentialtype = newcredentialtype; value the permitted values are found in the rtcicecredentialtype enumerated string type: oauth the rtciceserver requires the use of oauth 2.0 to authenticate in order to use the ice server described.
... mypeerconnection = new rtcpeerconnection({ iceservers: [ { urls: "turn:turnserver.example.org", // a turn server username: "webrtc", credential: "turnpassword", credentialtype: "password" } ] }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtciceserver.credential' in that specification.
RTCSessionDescription.type - Web APIs
the property rtcsessiondescription.type is a read-only value of type rtcsdptype which describes the description's type.
... syntax var value = sessiondescription.type; sessiondescription.type = value; value the possible values are defined by an enum of type rtcsdptype.
... the allowed values are those of an enum of type rtcsdptype: "offer", the description is the initial proposal in an offer/answer exchange.
... example // the remote description has been set previously on pc, a rtcpeerconnection alert(pc.remotedescription.type); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcsessiondescription.type' in that specification.
RTCStats.type - Web APIs
WebAPIRTCStatstype
the rtcstats dictionary's property type is a string which specifies the type of statistic represented by the object, where the permitted values are drawn from the enum type rtcstatstype.
... syntax var type = rtcstats.type; value a domstring which specifies which type of statistic is represented by the object.
... the string comes from the rtcstatstype enum and corrsponds to one of the rtcstats-based statistic object types.
... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcstats.type' in that specification.
ScreenOrientation.type - Web APIs
the type read-only property of the screenorientation interface returns the document's current orientation type, one of "portrait-primary", "portrait-secondary", "landscape-primary", or "landscape-secondary".
... syntax type = screenorientation.type value a string.
... specifications specification status comment screen orientation apithe definition of 'type' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettypechrome full support 38edge full support 79firefox full support 43ie no support noopera full support 25safari no support nowebview ...
Selection.type - Web APIs
WebAPISelectiontype
the type read-only property of the selection interface returns a domstring describing the type of the current selection.
... syntax value = sel.type value a domstring describing the type of the current selection.
...console.log(selection.type) will return caret or range depending on whether the caret is placed at a single point in the text, or a range has been selected.
... var selection; document.onselectionchange = function() { console.log('new selection made'); selection = document.getselection(); console.log(selection.type); }; specifications specification status comment selection apithe definition of 'selection.type' in that specification.
TaskAttributionTiming.containerType - Web APIs
the containertype readonly property of the taskattributiontiming interface returns the type of frame container, one of iframe, embed, or object.
... syntax var containertype = taskattributiontiming.containertype; value a domstring containing the container's type, one of iframe, embed, or object.
... specifications specification status comment long tasks api 1the definition of 'containertype' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcontainertype experimentalchrome full support 58edge full support ≤79firefox no support noie ?
CSS data types - CSS: Cascading Style Sheets
WebCSSCSS Types
css data types define typical values (including keywords and units) accepted by css properties and functions.
... they are a special kind of component value type.
... in formal syntax, data types are denoted by a keyword placed between the inequality signs "<" and ">".
... index the data types defined by the set of css specifications include the following: <angle> <angle-percentage> <angular-color-hint> <angular-color-stop> <attr-fallback> <attr-name> <basic-shape> <blend-mode> <calc-product> <calc-sum> <calc-value> <color> <color-stop> <color-stop-angle> <counter-style> <custom-ident> <dimension> <filter-function> <flex> <frequency> <frequency-percentage> <gradient> <ident> <image> <integer> <length> <length-percentage> <number> <number-percentage> <percentage> <position> <quote> <ratio> <resolution> <shape-box> <shape-radius> <string> <time> <time-percentage> <timing-function> <toggle-value> <transform-function> <type-or-unit> <url> <url-modifier> <zero> specifications specification status ...
exsl:object-type() - EXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes exsl:object-type() returns a string that indicates the type of the specified object.
... note: most xslt object types can be coerced into each other safely; however, certain coercsions to raise error conditions.
... syntax exsl:object-type(object) parameters object the object whose type is to be returned.
... returns the object's type, which will be one of the following: string number boolean node-set rtf external specifications exslt - exsl:object-type ...
<tt>: The Teletype Text element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementtt
the obsolete html teletype text element (<tt>) creates inline text which is presented using the user agent's default monospace font face.
... this element was created for the purpose of rendering text as it would be displayed on a fixed-width display such as a teletype, text-only screen, or line printer.
... the terms non-proportional, monotype, and monospace are used interchangeably and have the same general meaning: they describe a typeface whose characters are all the same number of pixels wide.
...you should use the more semantically helpful <code>, <kbd>, <samp>, or <var> elements for inline text that needs to be presented in monospace type, or the <pre> tag for content that should be presented as a separate block.
TypeError: property "x" is non-configurable and can't be deleted - JavaScript
message typeerror: calling delete on 'x' is not allowed in strict mode (edge) typeerror: property "x" is non-configurable and can't be deleted.
... (firefox) typeerror: cannot delete property 'x' of #<object> (chrome) error type typeerror in strict mode only.
... '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.
... 'use strict'; delete math.pi; // typeerror ...
TypeError: setting getter-only property "x" - JavaScript
message typeerror: assignment to read-only properties is not allowed in strict mode (edge) typeerror: setting getter-only property "x" (firefox) typeerror: cannot set property "prop" of #<object> which has only a getter (chrome) error type typeerror in strict mode only.
...while this will be silently ignored in non-strict mode, it will throw a typeerror in strict mode.
...it doesn't specify a setter, so a typeerror will be thrown upon trying to set the temperature property to 30.
... "use strict"; function archiver() { var temperature = null; object.defineproperty(this, 'temperature', { get: function() { console.log('get!'); return temperature; } }); } var arc = new archiver(); arc.temperature; // 'get!' arc.temperature = 30; // typeerror: setting getter-only property "temperature" to fix this error, you will either need to remove line 16, where there is an attempt to set the temperature property, or you will need to implement a setter for it, for example like this: "use strict"; function archiver() { var temperature = null; var archive = []; object.defineproperty(this, 'temperature', { get: function() { console.log('get!'); return temperature; }, se...
TypeError: invalid assignment to const "x" - JavaScript
message typeerror: invalid assignment to const "x" (firefox) typeerror: assignment to constant variable.
... (chrome) typeerror: assignment to const (edge) typeerror: redeclaration of const 'x' (ie) error type typeerror what went wrong?
... columns = 120; // typeerror: invalid assignment to const `columns' fixing the error there are multiple options to fix this error.
...this means that you can't mutate the value stored in a variable: const obj = {foo: 'bar'}; obj = {foo: 'baz'}; // typeerror: invalid assignment to const `obj' but you can mutate the properties in a variable: obj.foo = 'baz'; obj; // object { foo: "baz" } ...
TypeError: "x" is not a non-null object - JavaScript
message typeerror: invalid descriptor for property {x} (edge) typeerror: "x" is not a non-null object (firefox) typeerror: property description must be an object: "x" (chrome) typeerror: invalid value used in weak set (chrome) error type typeerror what went wrong?
...providing no object (like just a number), will throw an error: object.defineproperty({}, 'key', 1); // typeerror: 1 is not a non-null object object.defineproperty({}, 'key', null); // typeerror: null is not a non-null object a valid property descriptor object might look like this: object.defineproperty({}, 'key', { value: 'foo', writable: false }); weakmap and weakset objects require object keys weakmap and weakset objects store object keys.
... you can't use other types as keys.
... var ws = new weakset(); ws.add('foo'); // typeerror: "foo" is not a non-null object use objects instead: ws.add({foo: 'bar'}); ws.add(window); ...
TypeError: "x" is not a constructor - JavaScript
message typeerror: object doesn't support this action (edge) typeerror: "x" is not a constructor typeerror: math is not a constructor typeerror: json is not a constructor typeerror: symbol is not a constructor typeerror: reflect is not a constructor typeerror: intl is not a constructor typeerror: atomics is not a constructor error type typeerror what went wrong?
... 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 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.
... this is not legal (the promise constructor is not being called correctly) and will throw a typeerror: this is not a constructor exception: return new promise.resolve(true); instead, use the promise.resolve() or promise.reject() static methods: // this is legal, but unnecessarily long: return new promise((resolve, reject) => { resolve(true); }) // instead, return the static method: return promise.resolve(true); return promise.reject(false); ...
TypeError: "x" is read-only - JavaScript
message typeerror: assignment to read-only properties is not allowed in strict mode (edge) typeerror: "x" is read-only (firefox) typeerror: 0 is read-only (firefox) typeerror: cannot assign to read only property 'x' of #<object> (chrome) typeerror: cannot assign to read only property '0' of [object array] (chrome) error type typeerror what went wrong?
... '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.
... '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 = object.freeze({name: 'score', points: 157}); obj = {name: obj.name, points: 0}; // replacing it with a new object works 'use strict'; var lung_count = 2; // a `var` works, because it's not read-only lung_count = 3; // ok (anatomically unlikely, though) ...
Array.prototype[@@unscopables] - JavaScript
property attributes of array.prototype[@@unscopables] writable no enumerable no configurable yes examples use in with environments the following code works fine in es5 and below.
... however, in ecmascript 2015 and later, the array.prototype.keys() method was introduced.
...this is where now the built-in @@unscopables array.prototype[@@unscopables] symbol property comes into play and prevents that some of the array methods are being scoped into the with statement.
... var keys = []; with (array.prototype) { keys.push('something'); } object.keys(array.prototype[symbol.unscopables]); // ["copywithin", "entries", "fill", "find", "findindex", // "includes", "keys", "values"] specifications specification ecmascript (ecma-262)the definition of 'array.prototype[@@unscopables]' in that specification.
Array.prototype.copyWithin() - JavaScript
this especially applies to the typedarray method of the same name.
... polyfill if (!array.prototype.copywithin) { object.defineproperty(array.prototype, 'copywithin', { value: function(target, start/*, end*/) { // steps 1-2.
... if (this == null) { throw new typeerror('this is null or not defined'); } var o = object(this); // steps 3-5.
... return o; }, configurable: true, writable: true }); } examples using copywithin [1, 2, 3, 4, 5].copywithin(-2) // [1, 2, 3, 1, 2] [1, 2, 3, 4, 5].copywithin(0, 3) // [4, 5, 3, 4, 5] [1, 2, 3, 4, 5].copywithin(0, 3, 4) // [4, 2, 3, 4, 5] [1, 2, 3, 4, 5].copywithin(-2, -3, -1) // [1, 2, 3, 3, 4] [].copywithin.call({length: 5, 3: 1}, 0, 3) // {0: 1, 3: 1, length: 5} // es2015 typed arrays are subclasses of array var i32a = new int32array([1, 2, 3, 4, 5]) i32a.copywithin(0, 2) // int32array [3, 4, 5, 4, 5] // on platforms that are not yet es2015 compliant: [].copywithin.call(new int32array([1, 2, 3, 4, 5]), 0, 3, 4); // int32array [4, 2, 3, 4, 5] specifications specification ecmascript (ecma-262)the definition of 'array.prototype.copywithin' in that s...
Array.prototype.fill() - JavaScript
polyfill if (!array.prototype.fill) { object.defineproperty(array.prototype, 'fill', { value: function(value) { // steps 1-2.
... if (this == null) { throw new typeerror('this is null or not defined'); } var o = object(this); // steps 3-5.
... return o; } }); } if you need to support truly obsolete javascript engines that don't support object.defineproperty, it's best not to polyfill array.prototype methods at all, as you can't make them non-enumerable.
...[1, 2, 3] array(3).fill(4) // [4, 4, 4] [].fill.call({ length: 3 }, 4) // {0: 4, 1: 4, 2: 4, length: 3} // a single object, referenced by each slot of the array: let arr = array(3).fill({}) // [{}, {}, {}] arr[0].hi = "hi" // [{ hi: "hi" }, { hi: "hi" }, { hi: "hi" }] specifications specification ecmascript (ecma-262)the definition of 'array.prototype.fill' in that specification.
Array.prototype.filter() - JavaScript
this algorithm is exactly equivalent to the one specified in ecma-262, 5th edition, assuming that fn.call evaluates to the original value of function.prototype.bind(), and that array.prototype.push() has its original value.
... if (!array.prototype.filter){ array.prototype.filter = function(func, thisarg) { 'use strict'; if ( !
... ((typeof func === 'function' || typeof func === 'function') && this) ) throw new typeerror(); var len = this.length >>> 0, res = new array(len), // preallocate array t = this, c = 0, i = -1; var kvalue; if (thisarg === undefined){ while (++i !== len){ // checks to see if the key was set if (i in this){ kvalue = t[i]; // in case t is changed in callback if (func(t[i], i, t)){ res[c++] = kvalue; } } } } else{ while (++i !== len){ // checks to see if the key was set if (i in this){ kvalue = t[i]; if (func.call(thisarg, t[i], i, t)){ res[c++] = kvalue; } } } } res.length = c; // shrink dow...
...exuberant', 'destruction', 'elite', 'present'] const deletewords = words.filter( (word, index, arr) => { arr.pop() return word.length < 6 }) console.log(deletewords) // notice 'elite' is not even obtained as its been popped off `words` before filter can even get there // ["spray" ,"limit"] specifications specification ecmascript (ecma-262)the definition of 'array.prototype.filter' in that specification.
Array.prototype.push() - JavaScript
let vegetables = ['parsnip', 'potato'] let morevegs = ['celery', 'beetroot'] // merge the second array into the first one // equivalent to vegetables.push('celery', 'beetroot') array.prototype.push.apply(vegetables, morevegs) console.log(vegetables) // ['parsnip', 'potato', 'celery', 'beetroot'] using an object in an array-like fashion as mentioned above, push is intentionally generic, and we can use that to our advantage.
... array.prototype.push can work on an object just fine, as this example shows.
...instead, we store the collection on the object itself and use call on array.prototype.push to trick the method into thinking we are dealing with an array—and it just works, thanks to the way javascript allows us to establish the execution context in any way we want.
... specifications specification ecmascript (ecma-262)the definition of 'array.prototype.push' in that specification.
Intl.DateTimeFormat.prototype.formatRangeToParts() - JavaScript
the intl.datetimeformat.prototype.formatrangetoparts() method allows locale-specific tokens representing each part of the formatted date range produced by datetimeformat formatters.
... syntax intl.datetimeformat.prototype.formatrangetoparts(startdate, enddate) examples basic formatrangetoparts usage this method receives two dates and returns an array of objects containing the locale-specific tokens representing each part of the formatted date range.
...ew date(date.utc(2007, 0, 10, 10, 0, 0)); let date2 = new date(date.utc(2007, 0, 10, 11, 0, 0)); // > 'wed, 10 jan 2007 10:00:00 gmt' // > 'wed, 10 jan 2007 11:00:00 gmt' let fmt = new intl.datetimeformat("en", { hour: 'numeric', minute: 'numeric' }); console.log(fmt.formatrange(date1, date2)); // > '10:00 – 11:00 am' fmt.formatrangetoparts(date1, date2); // return value: // [ // { type: 'hour', value: '10', source: "startrange" }, // { type: 'literal', value: ':', source: "startrange" }, // { type: 'minute', value: '00', source: "startrange" }, // { type: 'literal', value: ' – ', source: "shared" }, // { type: 'hour', value: '11', source: "endrange" }, // { type: 'literal', value: ':', source: "endrange" }, // { type: 'minute', ...
... value: '00', source: "endrange" }, // { type: 'literal', value: ' ', source: "shared" }, // { type: 'dayperiod', value: 'am', source: "shared" } // ] specifications specification intl.datetimeformat.formatrangethe definition of 'formatrangetoparts()' in that specification.
Intl.RelativeTimeFormat.prototype.formatToParts() - JavaScript
the intl.relativetimeformat.prototype.formattoparts() method returns an array of objects representing the relative time format in parts that can be used for custom locale-aware formatting.
... description the intl.relativetimeformat.prototype.formattoparts method is a version of the format method which it returns an array of objects which represent "parts" of the object, separating the formatted number into its consituent parts and separating it from other surrounding text.
... these objects have two properties: type a numberformat formattoparts type, and value, which is the string which is the component of the output.
... examples using formattoparts const rtf = new intl.relativetimeformat("en", { numeric: "auto" }); // format relative time using the day unit rtf.formattoparts(-1, "day"); // > [{ type: "literal", value: "yesterday"}] rtf.formattoparts(100, "day"); // > [{ type: "literal", value: "in " }, // > { type: "integer", value: "100", unit: "day" }, // > { type: "literal", value: " days" }] specifications specification status comment ecmascript internationalization api (ecma-402)the definition of 'relativetimeformat.formattoparts()' in that specification.
Object.prototype.hasOwnProperty() - JavaScript
this method can be used to determine whether an object has the specified property as a direct property of that object; unlike the in operator, this method does not check for a property in the object's prototype chain.
...inherited properties the following example differentiates between direct properties and properties inherited through the prototype chain: o = new object(); o.prop = 'exists'; o.hasownproperty('prop'); // returns true o.hasownproperty('tostring'); // returns false o.hasownproperty('hasownproperty'); // returns false iterating over the properties of an object the following example shows how to iterate over the properties of an object without executing on inherited properties.
...xternal hasownproperty to get correct results: var foo = { hasownproperty: function() { return false; }, bar: 'here be dragons' }; foo.hasownproperty('bar'); // always returns false // use another object's hasownproperty // and call it with 'this' set to foo ({}).hasownproperty.call(foo, 'bar'); // true // it's also possible to use the hasownproperty property // from the object prototype for this purpose object.prototype.hasownproperty.call(foo, 'bar'); // true note that in the last case there are no newly created objects.
... specifications specification ecmascript (ecma-262)the definition of 'object.prototype.hasownproperty' in that specification.
Promise.prototype.catch() - JavaScript
it behaves the same as calling promise.prototype.then(undefined, onrejected) (in fact, calling obj.catch(onrejected) internally calls obj.then(undefined, onrejected)).
... return value internally calls promise.prototype.then on the object upon which it was called, passing the parameters undefined and the received onrejected handler.
... demonstration of the internal call: // overriding original promise.prototype.then/catch just to add some logs (function(promise){ var originalthen = promise.prototype.then; var originalcatch = promise.prototype.catch; promise.prototype.then = function(){ console.log('> > > > > > called .then on %o with arguments: %o', this, arguments); return originalthen.apply(this, arguments); }; promise.prototype.catch = function(){ console.
..."catch p1!"); console.error(reason); }); p2.then(function (value) { console.log("next promise's onfulfilled"); /* next promise's onfulfilled */ console.log(value); /* calling next */ }, function (reason) { console.log("next promise's onrejected"); console.log(reason); }); specifications specification ecmascript (ecma-262)the definition of 'promise.prototype.catch' in that specification.
Promise.prototype.then() - JavaScript
the value received and returned is: 33" // promise {[[promisestatus]]: "resolved", [[promisevalue]]: 33} description as the then and promise.prototype.catch() methods return promises, they can be chained — an operation called composition.
... return fetch('current-data.json').then(response => { if (response.headers.get('content-type') != 'application/json') { throw new typeerror(); } var j = response.json(); // maybe do something with j return j; // fulfillment value given to user of // fetch_current_data().then() }); } if onfulfilled returns a promise, the return value of then will be resolved/rejected by the promise.
... console.error('rejected', e); }); var p3 = p1.then(function() { // return promise here, that will be rejected with 'error' after 1 second return new promise(rejectlater); }); p3.then(function(v) { // not called console.log('resolved', v); }, function(e) { console.error('rejected', e); // "rejected", 'error' }); window.setimmediate style promise-based polyfill using a function.prototype.bind() reflect.apply (reflect.apply()) method to create a (non-cancellable) window.setimmediate-style function.
...promise.resolve(args).then(rfab(null, fn, null)) : nexttickpromise(), undefined ); nexttick.ntp = nexttickpromise; return nexttick; })(); specifications specification ecmascript (ecma-262)the definition of 'promise.prototype.then' in that specification.
RegExp.prototype[@@match]() - JavaScript
description this method is called internally in string.prototype.match().
... examples direct call this method can be used in almost the same way as string.prototype.match(), except the different this and the different arguments order.
... class myregexp extends regexp { [symbol.match](str) { let result = regexp.prototype[symbol.match].call(this, str); if (!result) return null; return { group(n) { return result[n]; } }; } } let re = new myregexp('([0-9]+)-([0-9]+)-([0-9]+)'); let str = '2016-01-02'; let result = str.match(re); // string.prototype.match calls re[@@match].
... console.log(result.group(1)); // 2016 console.log(result.group(2)); // 01 console.log(result.group(3)); // 02 specifications specification ecmascript (ecma-262)the definition of 'regexp.prototype[@@match]' in that specification.
RegExp.prototype[@@matchAll]() - JavaScript
description this method is called internally in string.prototype.matchall().
... examples direct call this method can be used in almost the same way as string.prototype.matchall(), except for the different value of this and the different order of arguments.
... for example, to return an array instead of an iterator: class myregexp extends regexp { [symbol.matchall](str) { const result = regexp.prototype[symbol.matchall].call(this, str); if (!result) { return null; } else { return array.from(result); } } } const re = new myregexp('([0-9]+)-([0-9]+)-([0-9]+)', 'g'); const str = '2016-01-02|2019-03-07'; const result = str.matchall(re); console.log(result[0]); // [ "2016-01-02", "2016", "01", "02" ] console.log(result[1]); // [ "2019-03-07", "2019", "03", "07" ] specific...
...ations specification ecmascript (ecma-262)the definition of 'regexp.prototype[@@matchall]' in that specification.
RegExp.prototype[@@search]() - JavaScript
description this method is called internally in string.prototype.search().
... examples direct call this method can be used in almost the same way as string.prototype.search(), except the different this and the different arguments order.
... class myregexp extends regexp { constructor(str) { super(str) this.pattern = str; } [symbol.search](str) { return str.indexof(this.pattern); } } var re = new myregexp('a+b'); var str = 'ab a+b'; var result = str.search(re); // string.prototype.search calls re[@@search].
... console.log(result); // 3 specifications specification ecmascript (ecma-262)the definition of 'regexp.prototype[@@search]' in that specification.
RegExp.prototype[@@split]() - JavaScript
description this method is called internally in string.prototype.split() if its separator argument is an object that has a @@split method, such as a regexp.
... examples direct call this method can be used in almost the same way as string.prototype.split(), except the different this and the different order of arguments.
... class myregexp extends regexp { [symbol.split](str, limit) { let result = regexp.prototype[symbol.split].call(this, str, limit); return result.map(x => "(" + x + ")"); } } let re = new myregexp('-'); let str = '2016-01-02'; let result = str.split(re); // string.prototype.split calls re[@@split].
... console.log(result); // ["(2016)", "(01)", "(02)"] specifications specification ecmascript (ecma-262)the definition of 'regexp.prototype[@@split]' in that specification.
String.prototype.codePointAt() - JavaScript
https://mths.be/codepointat v0.2.0 by @mathias */ if (!string.prototype.codepointat) { (function() { 'use strict'; // needed to support `apply`/`call` with `undefined`/`null` var defineproperty = (function() { // ie 8 only supports `object.defineproperty` on dom elements try { var object = {}; var $defineproperty = object.defineproperty; var result = $defineproperty(object, object, object) && $defineproperty; } catc...
...h(error) {} return result; }()); var codepointat = function(position) { if (this == null) { throw typeerror(); } var string = string(this); var size = string.length; // `tointeger` var index = position ?
... next code unit ) { second = string.charcodeat(index + 1); if (second >= 0xdc00 && second <= 0xdfff) { // low surrogate // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae return (first - 0xd800) * 0x400 + second - 0xdc00 + 0x10000; } } return first; }; if (defineproperty) { defineproperty(string.prototype, 'codepointat', { 'value': codepointat, 'configurable': true, 'writable': true }); } else { string.prototype.codepointat = codepointat; } }()); } examples using codepointat() 'abc'.codepointat(1) // 66 '\ud800\udc00'.codepointat(0) // 65536 'xyz'.codepointat(42) // undefined looping with codepointat() for (let codepoint of ...
...'\ud83d\udc0e\ud83d\udc71\u2764') { console.log(codepoint.codepointat(0).tostring(16)) } // '1f40e', '1f471', '2764' specifications specification ecmascript (ecma-262)the definition of 'string.prototype.codepointat' in that specification.
String.prototype.matchAll() - JavaScript
the regexp object must have the /g flag, otherwise a typeerror will be thrown.
... const regexp = regexp('[a-c]',''); const str = 'abc'; str.matchall(regexp); // typeerror matchall internally makes a clone of the regexp—so, unlike regexp.exec(), lastindex does not change as the string is scanned.
... const regexp = regexp('[a-c]','g'); regexp.lastindex = 1; const str = 'abc'; array.from(str.matchall(regexp), m => `${regexp.lastindex} ${m[0]}`); // array [ "1 b", "1 c" ] better access to capturing groups (than string.prototype.match()) another compelling reason for matchall is the improved access to capture groups.
...exp); // array ['test1', 'test2'] using matchall, you can access capture groups easily: let array = [...str.matchall(regexp)]; array[0]; // ['test1', 'e', 'st1', '1', index: 0, input: 'test1test2', length: 4] array[1]; // ['test2', 'e', 'st2', '2', index: 5, input: 'test1test2', length: 4] specifications specification ecmascript (ecma-262)the definition of 'string.prototype.matchall' in that specification.
TypeError() constructor - JavaScript
the typeerror() constructor creates a new error when an operation could not be performed, typically (but not exclusively) when a value is not of the expected type.
... syntax new typeerror([message[, filename[, linenumber]]]) parameters message optional optional.
...the line number of the code that caused the exception examples catching a typeerror try { null.f() } catch (e) { console.log(e instanceof typeerror) // true console.log(e.message) // "null has no properties" console.log(e.name) // "typeerror" console.log(e.filename) // "scratchpad/1" console.log(e.linenumber) // 2 console.log(e.columnnumber) // 2 console.log(e.stack) // "@scratchpad/2:2:3\n" } creating a typeerror try { throw new typeerror('hello', "somefile.js", 10) } catch (e) { console.log(e instanceof typeerror) // ...
...true console.log(e.message) // "hello" console.log(e.name) // "typeerror" console.log(e.filename) // "somefile.js" console.log(e.linenumber) // 10 console.log(e.columnnumber) // 0 console.log(e.stack) // "@scratchpad/2:2:9\n" } specifications specification ecmascript (ecma-262)the definition of 'nativeerror constructor' in that specification.
TypedArray.BYTES_PER_ELEMENT - JavaScript
the typedarray.bytes_per_element property represents the size in bytes of each element in an typed array.
... property attributes of typedarray.bytes_per_element writable no enumerable no configurable no description typedarray objects differ from each other in the number of bytes per element and in the way the bytes are interpreted.
... the bytes_per_element constant contains the number of bytes each element in the given typedarray has.
... // 1 uint8clampedarray.bytes_per_element; // 1 int16array.bytes_per_element; // 2 uint16array.bytes_per_element; // 2 int32array.bytes_per_element; // 4 uint32array.bytes_per_element; // 4 float32array.bytes_per_element; // 4 float64array.bytes_per_element; // 8 specifications specification ecmascript (ecma-262)the definition of 'typedarray.bytes_per_element' in that specification.
WebAssembly.Table.prototype.set() - JavaScript
the set() prototype method of the webassembly.table object mutates a reference stored at a given index to a different value.
... exceptions if index is greater than or equal to table.prototype.length, a rangeerror is thrown.
... if value is not an exported webassembly function or null, a typeerror is thrown.
...we then print out the table length and contents of the two indexes (retrieved via table.prototype.get()) to show that the length is two, and the indexes currently contain no function references (they currently return null).
datepicker.type - Archive of obsolete content
« xul reference home type type: one of the values below you can set the type attribute to one of the values below to specify the type of datepicker to use normal a datepicker with three fields for entering the year, month and date.
... this is the default value so do not specify the type attribute if this kind is desired.
... normal type grid type popup type ...
dlgtype - Archive of obsolete content
« xul reference home dlgtype type: one of the values below the dialog type of the button, used only when the button is in a dialog box.
...for example, if the dlgtype is set to accept, the button will replace the dialog box's accept button, which is usually labeled ok.
...the following values can be used as the dialog type: accept the ok button, which will accept the changes when pressed.
treecol.type - Archive of obsolete content
« xul reference home type type: one of the values below the type of tree column.
... if you are using type="checkbox", then the tree and each treecol must be editable.
...*/ list-style-image: url("chrome://global/skin/checkbox/cbox-check-dis.gif"); } see also type ...
windowtype - Archive of obsolete content
« xul reference home windowtype type: string set to a string which can be used to identify the type of 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 ...
toolkit.singletonWindowType - Archive of obsolete content
preference type: string specified by: default prefs of xulrunner applications default: none example: pref("toolkit.singletonwindowtype", "xulmine"); by default, the toolkit.defaultchromeuri preference will cause xulrunner to open a new main application window each time an application is invoked.
... the toolkit.singletonwindowtype preference causes xulrunner to search for a window with the attribute windowtype as specified in this preference (e.g.
... <window windowtype="xulmine"> in our example).
calIFileType - Archive of obsolete content
summary the califiletype interface provides information about a specific file type.
... califiletype is used in caliimporter and caliexporter to determine which file types are supported for import/export.
...defined in calendar/base/public/caliimportexport.idl interface code [scriptable, uuid(efef8333-e995-4f45-bdf7-bfcabbd9793e)] interface califiletype : nsisupports { readonly attribute astring defaultextension; readonly attribute astring extensionfilter; readonly attribute astring description; }; attributes defaultextension the default extension that should be associated with files of this type.
Date.prototype.toLocaleFormat() - Archive of obsolete content
see also the newer version of date.prototype.tolocaledatestring().
...see warning: date.prototype.tolocaleformat is deprecated for more information and migration help.
... polyfill when using the datejs library you can polyfill date.prototype.tolocaledatestring() like this: if (!date.prototype.tolocaleformat) { (function() { date.prototype.tolocaleformat = function(formatstring) { return this.format(formatstring); }; }()); } specifications not part of any standard.
Doctype - MDN Web Docs Glossary: Definitions of Web-related terms
in html, the doctype is the required "<!doctype html>" preamble found at the top of all documents.
... its sole purpose is to prevent a browser from switching into so-called “quirks mode” when rendering a document; that 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.
... learn more general knowledge definition of the doctype in the html specification quirks mode and standards mode technical reference document.doctype, a javascript method that returns the doctype ...
MIME type - MDN Web Docs Glossary: Definitions of Web-related terms
a mime type (now properly called "media type", but also sometimes "content type") is a string sent along with a file indicating the type of the file (describing the content format, for example, a sound file might be labeled audio/ogg, or an image file image/png).
... learn more general knowledge internet media type on wikipedia technical reference list of mime types properly configuring server mime types details information about the usage of mime types in a web context.
... incomplete list of mime types how mozilla determines mime types mediarecorder.mimetype ...
Prototype-based programming - MDN Web Docs Glossary: Definitions of Web-related terms
prototype-based programming is a style of object-oriented programming in which classes are not explicitly defined, but rather derived by adding properties and methods to an instance of another class or, less frequently, adding them to an empty object.
... in simple words: this type of style allows the creation of an object without first defining its class.
... learn more general knowledge prototype-based programming on wikipedia ...
Type conversion - MDN Web Docs Glossary: Definitions of Web-related terms
type conversion (or typecasting) means transfer of data from one data type to another.
... implicit conversion happens when the compiler automatically assigns data types, but the source code can also explicitly require a conversion to take place.
... for example, given the instruction 5+2.0, the floating point 2.0 is implicitly typecasted into an integer, but given the instruction number("0x11"), the string "0x11" is explicitly typecasted as the number 17.
Typesetting a community school homepage - Learn web development
give your headings and other element types appropriate font-sizes defined using a suitable relative unit.
...your post should include: a descriptive title such as "assessment wanted for typesetting a community school homepage".
... previous overview: styling text in this module fundamental text and font styling styling lists styling links web fonts typesetting a community school homepage ...
PRThreadType
the type of an nspr thread, specified as a parameter to pr_createthread.
... syntax #include <prthread.h> typedef enum prthreadtype { pr_user_thread, pr_system_thread } prthreadtype; enumerators pr_user_thread pr_cleanup blocks until the last thread of type pr_user_thread terminates.
... pr_system_thread nspr ignores threads of type pr_system_thread when determining when a call to pr_cleanup should return.
nsMsgNavigationType
the nsmsgnavigationtype interface contains constants used for message navigation in thunderbird.
... for example to move forward a message, you would call: // assuming gdbview is a global nsimsgdbview var resultid = new object(); var resultindex = new object(); var threadindex = new object(); gdbview.viewnavigate(components.interfaces.nsmsgnavigationtype.nextmessage, resultid, resultindex, threadindex, true); the nsmsgnavigationtype interface is defined as a global variable in thunderbird: var nsmsgviewcommandtype = components.interfaces.nsmsgviewcommandtype; mailnews/base/public/nsimsgdbview.idlscriptable please add a summary to this article.
... togglethreadkilled 5 must match nsmsgviewcommandtype togglethreadkilled.
CSSPrimitiveValue.primitiveType - Web APIs
the primitivetype read-only property of the cssprimitivevalue interface represents the type of a css value.
... syntax type = cssprimitivevalue.primitivetype; value an unsigned short representing the type of the value.
... example var cs = window.getcomputedstyle(document.body); var cssvalue = cs.getpropertycssvalue("color"); console.log(cssvalue.primitivetype); specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssprimitivevalue.primitivetype' in that specification.
CSSValue.cssValueType - Web APIs
the cssvaluetype read-only property of the cssvalue interface represents the type of the current computed css property value.
... syntax cssvaluetype = cssvalue.cssvaluetype; value an unsigned short representing a code defining the type of the value.
... example var styledeclaration = document.stylesheets[0].cssrules[0].style; var cssvalue = styledeclaration.getpropertycssvalue("color"); console.log(cssvalue.cssvaluetype); specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssvalue.cssvaluetype' in that specification.
Client.type - Web APIs
WebAPIClienttype
the type read-only property of the client interface indicates the type of client the service worker is controlling.
... syntax var myclienttype = client.type; value a string, representing the client type.
...your message was: " + e.data); // let's also post the type value back to the client e.source.postmessage(e.source.type); }); specifications specification status comment service workersthe definition of 'type' in that specification.
GamepadHapticActuator.type - Web APIs
the type read-only property of the gamepadhapticactuator interface returns an enum representing the type of the haptic hardware.
... syntax var myactuatortype = gamepadhapticactuatorinstance.type; value an enum of type gamepadhapticactuatortype; currently available types are: vibration — vibration hardware, which creates a rumbling effect.
... examples tbc specifications specification status comment gamepad extensionsthe definition of 'gamepadhapticactuatortype' in that specification.
HTMLObjectElement.type - Web APIs
the type property of the htmlobjectelement interface returns a domstring that reflects the type html attribute, specifying the mime type of the resource.
... syntax var string = htmlobjectelement.type htmlobjectelement.type = string; value a domstring.
... specifications specification status comment html living standardthe definition of 'type' in that specification.
HTMLObjectElement.typeMustMatch - Web APIs
the htmlobjectelement.typemustmatch property is a boolean that reflects the typemustmatch attribute of the <object> element.
... it indicates if the resource linked by it must match the mime type given by htmlobjectelement.type in order for this resource to be used.
... syntax var mustmatch = obj.typemustmatch; obj.typemustmatch = mustmatch; example html <object id="obj" data="move.swf" type="application/x-shockwave-flash" typemustmatch></object> javascript let obj = document.getelementbyid('obj'); console.log(obj.typemustmatch); specifications specification status comment html5the definition of 'htmlobjectelement' in that specification.
HTMLSelectElement.type - Web APIs
the htmlselectelement.type read-only property returns the form control's type.
... syntax var str = selectelt.type; the possible values are: "select-multiple" if multiple values can be selected.
... example switch (select.type) { case 'select-multiple': // multiple values may be selected break; case 'select-one': // only one value may be selected break; default: // non-standard value (or this isn't a select element) } specifications specification status comment html living standardthe definition of 'htmlselectelement' in that specification.
initDataTypes - Web APIs
the mediakeysystemconfiguration.initdatatypes read-only property returns a list of supported initialization data type names.
... an initialization data type is a string indicating the format of the initialization data.
... syntax var datatypes[] = mediasystemconfiguration.initdatatypes; specifications specification status comment encrypted media extensionsthe definition of 'initdatatypes' in that specification.
NDEFRecord.mediaType - Web APIs
the mediatype property ofthe ndefrecord interface is usvstring containing the mime type of the record payload.
... syntax ndefrecord.mediatype value a usvstring, corresponding to a mime type of the record payload.
... specifications specification status comment web nfc, ndefrecord.mediatype draft initial definition.
NetworkInformation.effectiveType - Web APIs
the effectivetype read-only property of the networkinformation interface returns the effective type of the connection meaning one of 'slow-2g', '2g', '3g', or '4g'.
... syntax var effectivetype = networkinformation.effectivetype value a string containing one of 'slow-2g', '2g', '3g', or '4g'.
... specifications specification status comment network information apithe definition of 'effectivetype' in that specification.
RTCIceCandidateStats.candidateType - Web APIs
the rtcicecandidatestats interface's candidatetype property is a string which indicates the type of ice candidate the object represents.
... syntax candidatetype = rtcicecandidatestats.candidatetype; value a domstring whose value is one of the strings found in the rtcicecandidatetype enumerated type:host the candidate is a host candidate, whose ip address as specified in the rtcicecandidate.ip property is in fact the true address of the remote peer.
... specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatestats.candidatetype' in that specification.
RTCIceTcpCandidateType - Web APIs
the webrtc api's rtcicetcpcandidatetype enumerated type provides a set of domstring values representing the types of tcp candidates.
... usage notes the rtcicetcpcandidatetype type is used by the tcptype property of rtcicecandidate objects.
... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicetcpcandidatetype' in that specification.
StorageQuota.supportedTypes - Web APIs
the supportedtypes read-only property of the storagequota interface returns a list of the available storage types.
... syntax var storagetypes = storagequota.supportedtypes value a frozen array of available storage types.
... specifications specification status comment quota management apithe definition of 'supportedtypes' in that specification.
WebSocket.binaryType - Web APIs
the websocket.binarytype property returns the type of binary data being transmitted by the connection.
... syntax var binarytype = awebsocket.binarytype; value a domstring: "blob" if blob objects are used.
... specifications specification status comment html living standardthe definition of 'websocket: binarytype' in that specification.
scroll-snap-type-x - CSS: Cascading Style Sheets
the scroll-snap-type-x css property defines how strictly snap points are enforced on the horizontal axis of the scroll container in case there is one.
... /* keyword values */ scroll-snap-type-x: none; scroll-snap-type-x: mandatory; scroll-snap-type-x: proximity; /* global values */ scroll-snap-type-x: inherit; scroll-snap-type-x: initial; scroll-snap-type-x: unset; syntax values none when the visual viewport of this scroll container is scrolled horizontally, it must ignore snap points.
... formal definition initial valuenoneapplies toscroll containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | mandatory | proximity specifications not part of any standard.
scroll-snap-type-y - CSS: Cascading Style Sheets
the scroll-snap-type-y css property defines how strictly snap points are enforced on the vertical axis of the scroll container in case there is one.
... /* keyword values */ scroll-snap-type-y: none; scroll-snap-type-y: mandatory; scroll-snap-type-y: proximity; /* global values */ scroll-snap-type-y: inherit; scroll-snap-type-y: initial; scroll-snap-type-y: unset; syntax values none when the visual viewport of this scroll container is scrolled vertically, it must ignore snap points.
... formal definition initial valuenoneapplies toscroll containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | mandatory | proximity specifications not part of any standard.
<input type="datetime"> - HTML: Hypertext Markup Language
WebHTMLElementinputdatetime
the html <input type="datetime"> was a control for entering a date and time (hour, minute, second, and fraction of a second) as well as a timezone.
... instead, browsers are implementing (and developers are encouraged to use) <input type="datetime-local">.
... the format of the date and time value used by this input type is described in format of a valid global date and time string in date and time formats used in html.
415 Unsupported Media Type - HTTP
WebHTTPStatus415
the http 415 unsupported media type client error response code indicates that the server refuses to accept the request because the payload format is in an unsupported format.
... the format problem might be due to the request's indicated content-type or content-encoding, or as a result of inspecting the data directly.
... status 415 unsupported media type specifications specification title rfc 7231, section 6.5.13: 415 unsupported media type hypertext transfer protocol (http/1.1): semantics and content ...
TypeError: can't access property "x" of "y" - JavaScript
message typeerror: unable to get property {x} of undefined or null reference (edge) typeerror: can't access property {x} of {y} (firefox) typeerror: {y} is undefined, can't access property {x} of it (firefox) typeerror: {y} is null, can't access property {x} of it (firefox) examples: typeerror: x is undefined, can't access property "prop" of it typeerror: x is null, can't access property "prop" of it typeerror: can't access property "prop" of undefined typeerror: can't access property "prop" of null error type typeerror.
... examples invalid cases // undefined and null cases on which the substring method won't work var foo = undefined; foo.substring(1); // typeerror: x is undefined, can't access property "substring" of it var foo = null; foo.substring(1); // typeerror: x is null, can't access property "substring" of it fixing the issue to fix null pointer to undefined or null values, you can use the typeof operator, for example.
... if (typeof foo !== 'undefined') { // now we know that foo is defined, we are good to go.
TypeError: can't assign to property "x" on "y": not an object - JavaScript
message typeerror: can't assign to property "x" on {y}: not an object (firefox) typeerror: cannot create property 'x' on {y} (chrome) error type typeerror.
... in strict_mode, a typeerror is raised when attempting to create a property on primitive value such as a symbol, a string, a number or a boolean.
...foo.bar = {}; // typeerror: can't assign to property "bar" on "my string": not an object fixing the issue either fix the code to prevent the primitive from being used in such places, or fix the issue is to create the object equivalent object.
TypeError: cyclic object value - JavaScript
message typeerror: cyclic object value (firefox) typeerror: converting circular structure to json (chrome and opera) typeerror: circular reference in value argument not supported (edge) error type typeerror what went wrong?
... examples circular references in a circular structure like the following var circularreference = {otherdata: 123}; circularreference.myself = circularreference; json.stringify() will fail json.stringify(circularreference); // typeerror: cyclic object value to serialize circular references you can use a library that supports them (e.g.
... the snippet below illustrates how to find and filter (thus causing data loss) a cyclic reference by using the replacer parameter of json.stringify(): const getcircularreplacer = () => { const seen = new weakset(); return (key, value) => { if (typeof value === "object" && value !== null) { if (seen.has(value)) { return; } seen.add(value); } return value; }; }; json.stringify(circularreference, getcircularreplacer()); // {"otherdata":123} ...
SyntaxError: test for equality (==) mistyped as assignment (=)? - JavaScript
the javascript warning "test for equality (==) mistyped as assignment (=)?" occurs when there was an assignment (=) when you would normally expect a test for equality (==).
... message warning: syntaxerror: test for equality (==) mistyped as assignment (=)?
... error type (firefox only) syntaxerror warning which is reported only if javascript.options.strict preference is set to true.
TypeError: can't delete non-configurable array element - JavaScript
message typeerror: can't delete non-configurable array element (firefox) typeerror: cannot delete property '2' of [object array] (chrome) error type typeerror what went wrong?
... var arr = []; object.defineproperty(arr, 0, {value: 0}); object.defineproperty(arr, 1, {value: "1"}); arr.length = 1; // typeerror: can't delete non-configurable array element you will need to set the elements as configurable, if you intend to shorten the array.
... var arr = [1,2,3]; object.seal(arr); arr.length = 1; // typeerror: can't delete non-configurable array element you either need to remove the object.seal() call, or make a copy of it.
Array.prototype[@@iterator]() - JavaScript
li>"; } result alternative iteration var arr = ['a', 'b', 'c', 'd', 'e']; var earr = arr[symbol.iterator](); console.log(earr.next().value); // a console.log(earr.next().value); // b console.log(earr.next().value); // c console.log(earr.next().value); // d console.log(earr.next().value); // e use case for brace notation the use case for this syntax over using the dot notation (array.prototype.values()) is in a case where you don't know what object is going to be ahead of time.
... if you have a function that takes an iterator and then iterate over the value, but don't know if that object is going to have a [iterable].prototype.values method.
... function logiterable(it) { if (!(symbol.iterator in object.getprototypeof(it) /* or "symbol.iterator in object.__proto__" or "it[symbol.iterator]" */)) { console.log(it, ' is not an iterable object...'); return; } var iterator = it[symbol.iterator](); // your browser must support for..of loop // and let-scoped variables in for loops // const and var could also be used for (let letter of iterator) { console.log(letter); } } // array logiterable(['a', 'b', 'c']); // a // b // c // string logiterable('abc'); // a // b // c logiterable(123); // 123 " is not an iterable object..." specifications specification ecmascript (ecma-262)the definition of 'array.prototype[@@ite...
Array.prototype.lastIndexOf() - JavaScript
this algorithm is exactly the one specified in ecma-262, 5th edition, assuming object, typeerror, number, math.floor, math.abs, and math.min have their original values.
... // production steps of ecma-262, edition 5, 15.4.4.15 // reference: http://es5.github.io/#x15.4.4.15 if (!array.prototype.lastindexof) { array.prototype.lastindexof = function(searchelement /*, fromindex*/) { 'use strict'; if (this === void 0 || this === null) { throw new typeerror(); } var n, k, t = object(this), len = t.length >>> 0; if (len === 0) { return -1; } n = len - 1; if (arguments.length > 1) { n = number(arguments[1]); if (n != n) { n = 0; } else if (n != 0 && n != (1 / 0) && n != -(1 / 0)) { n = (n > 0 || -1) * math.floor(math.abs(n)); } } for (k = n >= 0 ?
... specifications specification ecmascript (ecma-262)the definition of 'array.prototype.lastindexof' in that specification.
Array.prototype.some() - JavaScript
this algorithm is exactly the one specified in ecma-262, 5th edition, assuming object and typeerror have their original values and that fun.call evaluates to the original value of function.prototype.call().
... // production steps of ecma-262, edition 5, 15.4.4.17 // reference: http://es5.github.io/#x15.4.4.17 if (!array.prototype.some) { array.prototype.some = function(fun, thisarg) { 'use strict'; if (this == null) { throw new typeerror('array.prototype.some called on null or undefined'); } if (typeof fun !== 'function') { throw new typeerror(); } var t = object(this); var len = t.length >>> 0; for (var i = 0; i < len; i++) { if (i in t && fun.call(thisarg, t[i], i, t)) { return true; } } return false; }; } examples testing value of array elements the following example tests whether any element in the array is bigger than 10.
... value exists using an arrow function const fruits = ['apple', 'banana', 'mango', 'guava']; function checkavailability(arr, val) { return arr.some(arrval => val === arrval); } checkavailability(fruits, 'kela'); // false checkavailability(fruits, 'banana'); // true converting any value to boolean const truthy_values = [true, 'true', 1]; function getboolean(value) { 'use strict'; if (typeof value === 'string') { value = value.tolowercase().trim(); } return truthy_values.some(function(t) { return t === value; }); } getboolean(false); // false getboolean('false'); // false getboolean(1); // true getboolean('true'); // true specifications specification ecmascript (ecma-262)the definition of 'array.prototype.some' in that specification.
Array.prototype.values() - JavaScript
examples iteration using for...of loop var arr = ['a', 'b', 'c', 'd', 'e']; var iterator = arr.values(); for (let letter of iterator) { console.log(letter); } //"a" "b" "c" "d" "e" array.prototype.values is default implementation of array.prototype[symbol.iterator].
... array.prototype.values === array.prototype[symbol.iterator] //true iteration using .next() var arr = ['a', 'b', 'c', 'd', 'e']; var iterator = arr.values(); iterator.next(); // object { value: "a", done: false } iterator.next().value; // "b" iterator.next()["value"]; // "c" iterator.next(); // object { value: "d", done: false } iterator.next(); // object { value: "e", done: false } iterator.next(); // object { value: undefined, done: true } iteraror.next().value; // undefined one-use: the array iterator object is one use or temporary object example: var arr = ['a', 'b', 'c', 'd', 'e']; var iterator = arr.values(); for (let letter of iterator) { console.log(letter); } //"a" "b" "c" "d" "e" for (let le...
... specifications specification ecmascript (ecma-262)the definition of 'array.prototype.values' in that specification.
BigInt.prototype.toString() - JavaScript
description the bigint object overrides the tostring() method of the object object; it does not inherit object.prototype.tostring().
...-0.0 is an ieee floating-point concept that only appears in the javascript number type.
... (-0n).tostring(); // '0' bigint(-0).tostring(); // '0' specifications specification ecmascript (ecma-262)the definition of 'bigint.prototype.tostring()' in that specification.
Date.prototype[@@toPrimitive] - JavaScript
description the [@@toprimitive]() method of the date object returns a primitive value, that is either of type number or of type string.
...if the tostring property does not exist, it tries to call the valueof method and if the valueof does not exist either, [@@toprimitive]() throws a typeerror.
..." testdate[symbol.toprimitive]('string'); // returns "date fri may 29 2020 14:05:17 gmt+0100 (british summer time)" testdate[symbol.toprimitive]('number'); // returns "1590757517834" testdate[symbol.toprimitive]('default'); // returns "date fri may 29 2020 14:05:17 gmt+0100 (british summer time)" specifications specification ecmascript (ecma-262)the definition of 'date.prototype.@@toprimitive' in that specification.
Date.prototype.valueOf() - JavaScript
description the valueof() method returns the primitive value of a date object as a number data type, the number of milliseconds since midnight 01 january, 1970 utc.
... this method is functionally equivalent to the date.prototype.gettime() method.
... examples using valueof() var x = new date(56, 6, 17); var myvar = x.valueof(); // assigns -424713600000 to myvar specifications specification ecmascript (ecma-262)the definition of 'date.prototype.valueof' in that specification.
Error.prototype.name - JavaScript
the name property represents a name for the type of error.
...the name property, in addition to the message property, is used by the error.prototype.tostring() method to create a string representation of the error.
... examples throwing a custom error var e = new error('malformed input'); // e.name is 'error' e.name = 'parseerror'; throw e; // e.tostring() would return 'parseerror: malformed input' specifications specification ecmascript (ecma-262)the definition of 'error.prototype.name' in that specification.
Error.prototype.toString() - JavaScript
description the error object overrides the object.prototype.tostring() method inherited by all objects.
... its semantics are as follows (assuming object and string have their original values): error.prototype.tostring = function() { 'use strict'; var obj = object(this); if (obj !== this) { throw new typeerror(); } var name = this.name; name = (name === undefined) ?
...console.log(e.tostring()); // 'error: fatal error' e.name = undefined; console.log(e.tostring()); // 'error: fatal error' e.name = ''; console.log(e.tostring()); // 'fatal error' e.message = undefined; console.log(e.tostring()); // '' e.name = 'hello'; console.log(e.tostring()); // 'hello' specifications specification ecmascript (ecma-262)the definition of 'error.prototype.tostring' in that specification.
Intl.Collator.prototype.compare() - JavaScript
the intl.collator.prototype.compare() method compares two strings according to the sort order of this collator object.
...note that the function is bound to the collator from which it was obtained, so it can be passed directly to array.prototype.sort().
...ngrès', 'congres', 'assemblée', 'poisson']; var collator = new intl.collator('fr', { usage: 'search', sensitivity: 'base' }); var s = 'congres'; var matches = a.filter(v => collator.compare(v, s) === 0); console.log(matches.join(', ')); // → "congrès, congres" specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.collator.prototype.compare' in that specification.
Intl.DisplayNames.prototype.resolvedOptions() - JavaScript
the intl.displaynames.prototype.resolvedoptions() method returns a new object with properties reflecting the locale and style formatting options computed during the construction of the current displaynames object.
... type the value provided for this property in the options argument of the constructor or the default value ("language").
... examples using resolvedoptions const displaynames = new intl.displaynames(['de-de'], {type: 'region'}); const usedoptions = displaynames.resolvedoptions(); console.log(usedoptions.locale); // "de-de" console.log(usedoptions.style); // "long" console.log(usedoptions.type); // "region" console.log(usedoptions.fallback); // "code" specifications specification intl.displaynamesthe definition of 'resolvedoptions()' in that specification.
Intl​.List​Format​.prototype​.resolvedOptions() - JavaScript
the intl.listformat.prototype.resolvedoptions() method returns a new object with properties reflecting the locale and style formatting options computed during the construction of the current listformat object.
... type the value provided for this property in the options argument of the constructor or the default value ("conjunction").
... examples using resolvedoptions const delistformatter = new intl.listformat("de-de", { style: "short" }); const usedoptions = de.resolvedoptions(); console.log(usedoptions.locale); // "de-de" console.log(usedoptions.style); // "short" console.log(usedoptions.type); // "conjunction" (the default value) specifications specification intl.listformatthe definition of 'resolvedoptions()' in that specification.
Intl.NumberFormat.prototype.format() - JavaScript
the intl.numberformat.prototype.format() method formats a number according to the locale and formatting options of this numberformat object.
...note that the function is bound to the numberformat from which it was obtained, so it can be passed directly to array.prototype.map.
... var a = [123456.789, 987654.321, 456789.123]; var numberformat = new intl.numberformat('es-es'); var formatted = a.map(n => numberformat.format(n)); console.log(formatted.join('; ')); // → "123.456,789; 987.654,321; 456.789,123" specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.numberformat.prototype.format' in that specification.
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.
... type the type used (cardinal or ordinal).
... 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.pluralcategories; // array [ "one", "other" ] usedoptions.type; // "cardinal" specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.pluralrules.prototype.resolvedoptions' in that specification.
Number.prototype.toFixed() - JavaScript
typeerror if this method is invoked on an object that is not a number.
...if the absolute value of numobj is greater or equal to 1e+21, this method simply calls number.prototype.tostring() and returns a string in exponential notation.
...note it rounds down - see warning above -2.34.tofixed(1) // returns -2.3 (due to operator precedence, negative number literals don't return a string...) (-2.34).tofixed(1) // returns '-2.3' specifications specification ecmascript (ecma-262)the definition of 'number.prototype.tofixed' in that specification.
Number.prototype.toLocaleString() - JavaScript
a check that works in all hosts, including those supporting ecma-262 prior to ed 5.1, is to test for the features specified in ecma-402 that are required to support regional options for number.prototype.tolocalestring directly: function tolocalestringsupportsoptions() { return !!(typeof intl == 'object' && intl && typeof intl.numberformat == 'function'); } this tests for a global intl object, checks that it's not null and that it has a numberformat property that is a function.
...ng var num = 30000.65; console.log(num.tolocalestring(undefined, {minimumfractiondigits: 2, maximumfractiondigits: 2})); // → "30,000.65" where english is the default language, or // → "30.000,65" where german is the default language, or // → "30 000,65" where french is the default language specifications specification ecmascript (ecma-262)the definition of 'number.prototype.tolocalestring' in that specification.
... ecmascript internationalization api (ecma-402)the definition of 'number.prototype.tolocalestring' in that specification.
Number.prototype.toPrecision() - JavaScript
see the discussion of rounding in the description of the number.prototype.tofixed() method, which also applies to toprecision().
... if the precision argument is omitted, behaves as number.prototype.tostring().
...' console.log(numobj.toprecision(5)) // logs '0.00012300' console.log(numobj.toprecision(2)) // logs '0.00012' console.log(numobj.toprecision(1)) // logs '0.0001' // note that exponential notation might be returned in some circumstances console.log((1234.5).toprecision(2)) // logs '1.2e+3' specifications specification ecmascript (ecma-262)the definition of 'number.prototype.toprecision' in that specification.
Object.prototype.propertyIsEnumerable() - JavaScript
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.
...inherited properties var a = []; a.propertyisenumerable('constructor'); // returns false function firstconstructor() { this.property = 'is not enumerable'; } firstconstructor.prototype.firstmethod = function() {}; function secondconstructor() { this.method = function() { return 'is enumerable'; }; } secondconstructor.prototype = new firstconstructor; secondconstructor.prototype.constructor = secondconstructor; var o = new secondconstructor(); o.arbitraryproperty = 'is enumerable'; o.propertyisenumerable('arbitraryproperty'); // returns true o.propertyisenumerable('metho...
...d'); // returns true o.propertyisenumerable('property'); // returns false o.property = 'is enumerable'; o.propertyisenumerable('property'); // returns true // these return false as they are on the prototype which // propertyisenumerable does not consider (even though the last two // are iteratable with for-in) o.propertyisenumerable('prototype'); // returns false (as of js 1.8.1/ff3.6) o.propertyisenumerable('constructor'); // returns false o.propertyisenumerable('firstmethod'); // returns false specifications specification ecmascript (ecma-262)the definition of 'object.prototype.propertyisenumerable' in that specification.
RegExp.prototype.exec() - JavaScript
using this internally, exec() can be used to iterate over multiple matches in a string of text (with capture groups), as opposed to getting just the matching strings with string.prototype.match().
... a newer function has been proposed to simplify matching multiple parts of a string (with capture groups): string.prototype.matchall().
... if you are executing a match simply to find true or false, use regexp.prototype.test() method or string.prototype.search() instead.
RegExp.prototype.test() - JavaScript
test() returns a boolean, unlike the string.prototype.search() method (which returns the index of a match, or -1 if not found).
...(this is similar to the string.prototype.match() method.) as with exec() (or in combination with it), test() called multiple times on the same global regular expression instance will advance past the previous match.
...(regexp.prototype.exec() also advances the lastindex property.) further calls to test(str) will resume searching str starting from lastindex.
SharedArrayBuffer.prototype.slice() - JavaScript
the sharedarraybuffer.prototype.slice() method returns a new sharedarraybuffer whose contents are a copy of this sharedarraybuffer's bytes from begin, inclusive, up to end, exclusive.
...this method has the same algorithm as array.prototype.slice().
...amples using slice var sab = new sharedarraybuffer(1024); sab.slice(); // sharedarraybuffer { bytelength: 1024 } sab.slice(2); // sharedarraybuffer { bytelength: 1022 } sab.slice(-2); // sharedarraybuffer { bytelength: 2 } sab.slice(0, 1); // sharedarraybuffer { bytelength: 1 } specifications specification ecmascript (ecma-262)the definition of 'sharedarraybuffer.prototype.slice' in that specification.
String.prototype.replaceAll() - JavaScript
syntax const newstr = str.replaceall(regexp|substr, newsubstr|function) when using a `regexp` you must have to set the global ("g") flag; otherwise, it will throw a typeerror: "replaceall must be called with a global regexp".
...a regexp without the global ("g") flag will throw a typeerror: "replaceall must be called with a global regexp".
...this won't work: 'aabbcc'.replaceall(/b/, '.'); typeerror: replaceall must be called with a global regexp this will work: 'aabbcc'.replaceall(/b/g, '.'); "aa..cc" specifications specification ecmascript (ecma-262)the definition of 'string.prototype.replaceall' in that specification.
String.prototype.toLocaleLowerCase() - JavaScript
a typeerror ("invalid element in locales argument") is thrown if an array element isn't of type string.
...localelowercase() 'alphabet'.tolocalelowercase(); // 'alphabet' '\u0130'.tolocalelowercase('tr') === 'i'; // true '\u0130'.tolocalelowercase('en-us') === 'i'; // false let locales = ['tr', 'tr', 'tr-tr', 'tr-u-co-search', 'tr-x-turkish']; '\u0130'.tolocalelowercase(locales) === 'i'; // true specifications specification ecmascript (ecma-262)the definition of 'string.prototype.tolocalelowercase' in that specification.
... ecmascript internationalization api (ecma-402)the definition of 'string.prototype.tolocalelowercase' in that specification.
String.prototype.toLocaleUpperCase() - JavaScript
a typeerror ("invalid element in locales argument") is thrown if an array element isn't of type string.
...ase() examples using tolocaleuppercase() 'alphabet'.tolocaleuppercase(); // 'alphabet' 'gesäß'.tolocaleuppercase(); // 'gesÄss' 'i\u0307'.tolocaleuppercase('lt-lt'); // 'i' let locales = ['lt', 'lt', 'lt-lt', 'lt-u-co-phonebk', 'lt-x-lietuva']; 'i\u0307'.tolocaleuppercase(locales); // 'i' specifications specification ecmascript (ecma-262)the definition of 'string.prototype.tolocaleuppercase' in that specification.
... ecmascript internationalization api (ecma-402)the definition of 'string.prototype.tolocaleuppercase' in that specification.
String.prototype.toString() - JavaScript
description the string object overrides the tostring() method of the object object; it does not inherit object.prototype.tostring().
... for string objects, the tostring() method returns a string representation of the object and is the same as the string.prototype.valueof() method.
... examples using tostring() the following example displays the string value of a string object: var x = new string('hello world'); console.log(x.tostring()); // logs 'hello world' specifications specification ecmascript (ecma-262)the definition of 'string.prototype.tostring' in that specification.
String.prototype.toUpperCase() - JavaScript
exceptions typeerror when called on null or undefined, for example, string.prototype.touppercase.call(undefined).
... examples basic usage console.log('alphabet'.touppercase()); // 'alphabet' conversion of non-string this values to strings this method will convert any non-string value to a string, when you set its this to a value that is not a string: const a = string.prototype.touppercase.call({ tostring: function tostring() { return 'abcdef'; } }); const b = string.prototype.touppercase.call(true); // prints out 'abcdef true'.
... console.log(a, b); specifications specification ecmascript (ecma-262)the definition of 'string.prototype.touppercase' in that specification.
String.prototype.trimStart() - JavaScript
aliasing for consistency with functions like string.prototype.padstart the standard method name is trimstart.
...in some engines this means: string.prototype.trimleft.name === "trimstart"; polyfill //https://github.com/fabiovergani/js-polyfill_string-trimstart (function(w){ var string=w.string, proto=string.prototype; (function(o,p){ if(p in o?o[p]?false:true:true){ var r=/^\s+/; o[p]=o.trimleft||function(){ return this.replace(r,'') } } })(proto,'trimstart'); })(window); /* es6: (w=>{ const string=w.string, proto=string.prototype; ((o,p)=>{ if(p in o?o[p]?false:true:true){ const r=/^\s+/; o[p]=o.trimleft||function(){ return this.replace(r,'') } } })(prot...
...o,'trimstart'); })(window); */ examples using trimstart() the following example displays the lowercase string 'foo ': var str = ' foo '; console.log(str.length); // 8 str = str.trimstart(); console.log(str.length); // 5 console.log(str); // 'foo ' specifications specification ecmascript (ecma-262)the definition of ' string.prototype.trimstart' in that specification.
String.prototype.valueOf() - JavaScript
description the valueof() method of string returns the primitive value of a string object as a string data type.
... this value is equivalent to string.prototype.tostring().
... examples using valueof() var x = new string('hello world'); console.log(x.valueof()); // displays 'hello world' specifications specification ecmascript (ecma-262)the definition of 'string.prototype.valueof' in that specification.
Symbol.prototype.description - JavaScript
the symbol.prototype.description property can be used to read that description.
... it is different to symbol.prototype.tostring() as it does not contain the enclosing "symbol()" string.
...; // "" symbol().description; // undefined // well-known symbols symbol.iterator.tostring(); // "symbol(symbol.iterator)" symbol.iterator.description; // "symbol.iterator" // global symbols symbol.for('foo').tostring(); // "symbol(foo)" symbol.for('foo').description; // "foo" specifications specification ecmascript (ecma-262)the definition of 'get symbol.prototype.description' in that specification.
attributeType - SVG: Scalable Vector Graphics
the attributetype attribute specifies the namespace in which the target attribute and its associated values are defined.
... four elements are using this attribute: <animate>, <animatecolor>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 250 250" xmlns="http://www.w3.org/2000/svg"> <rect x="50" y="50" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="5s" repeatcount="indefinite"/> </rect> </svg> usage notes value css | xml | auto default value auto animatable no css this value specifies that the value of attributename is the name of a css property defined as animatable.
... specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'attributetype' in that specification.
contentScriptType - SVG: Scalable Vector Graphics
the contentscripttype attribute specifies the default scripting language for the given document fragment on the <svg> element.
...the value specifies a media type, per mime part two: media types [rfc2046].
... usage notes value one of the content types specified in the media types default value application/ecmascript animatable no specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'contentscripttype' in that specification.
editortype - Archive of obsolete content
« xul reference home editortype type: one of the values below the type of editor to use.
... this value will be overridden depending on the content type of the document in the editor.
resizer.type - Archive of obsolete content
« xul reference hometypetype: stringset this to the value "window" for a resizing grip that appears in the bottom corner of the window, used for resizing the window.
... as some platforms provide this resizing grip automatically, this type of resizer element will be hidden and ensure that the window does not get an extra resizer.
editortype - Archive of obsolete content
« xul reference editortype type: one of the values below the type of editor to use.
... this value will be overridden depending on the content type of the document in the editor.
textbox.type - Archive of obsolete content
« xul reference type type: string set to the value autocomplete to have an autocomplete textbox.
... see also type ...
type - Archive of obsolete content
ArchiveMozillaXULPropertytype
« xul reference type type: string gets and sets the value of the type attribute.
... see also textbox.type ...
NPVariantType - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary npvarianttype is an enumeration that is used to identify the data type of an npvariant structure.
... syntax typedef enum { npvarianttype_void, npvarianttype_null, npvarianttype_bool, npvarianttype_int32, npvarianttype_double, npvarianttype_string, npvarianttype_object } npvarianttype; description each type is self-explanatory.
-ms-content-zoom-snap-type - Archive of obsolete content
the -ms-content-zoom-snap-type css property is a microsoft extension that specifies how zooming is affected by defined snap-points.
... initial valuenoneapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none initial value.
Prototype - MDN Web Docs Glossary: Definitions of Web-related terms
a prototype is a model that displays the appearance and behavior of an application or product early in the development lifecycle.
... see inheritance and the prototype chain learn more general knowledge software prototyping on wikipedia ...
Type coercion - MDN Web Docs Glossary: Definitions of Web-related terms
type coercion is the automatic or implicit conversion of values from one data type to another (such as strings to numbers).
... type conversion is similar to type coercion because they both convert values from one data type to another with one key difference — type coercion is implicit whereas type conversion can be either implicit or explicit.
How can we design for all types of users? - Learn web development
here is the html we're using: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>font size experiment</title> </head> <body> <h1>this is our main heading <span class="subheading">this is our subheading</span> </h1> </body> </html> a percent-based css will look like this: body { font-size:100%; } /* 100% of the browser's base font size, so in most cases this will render as 16 pixels */ h1 {...
...let's consider this html: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>font size experiment</title> </head> <body> <div class="container"> <h1>this is our main heading <span class="subheading">this is our subheading</span> </h1> <p>[lengthly text that spans many lines]</p> </div> </body> </html> we have a div with class container.
PRCallOnceType
syntax #include <prinit.h> typedef struct prcalloncetype { printn initialized; print32 inprogress; prstatus status; } prcalloncetype; fields the structure has these fields: initialized if not zero, the initialization process has been completed.
... description the client is responsible for initializing the prcalloncetype structure to all zeros.
PRFileType
type for enumerators used in the type field of the prfileinfo and prfileinfo64 structures.
... syntax #include <prio.h> typedef enum prfiletype{ pr_file_file = 1, pr_file_directory = 2, pr_file_other = 3 } prfiletype; enumerators the enumeration has the following enumerators: pr_file_file the information in the structure describes a file.
nsMsgViewCommandType
the nsmsgviewcommandtype interface contains constants used for commands in thunderbird.
... for example to mark a message read, you would call: // assuming gdbview is a global nsimsgdbview gdbview.docommand(components.interfaces.nsmsgviewcommandtype.markmessagesread); mailnews/base/public/nsimsgdbview.idlscriptable please add a summary to this article.
nsMsgViewFlagsType
the nsmsgviewflagstype interface contains constants used for view flags in thunderbird.
...for example, the 'unread only' view would use the flag: components.interfaces.nsmsgviewflagstype.kunreadonly constants name value description knone 0x0 kthreadeddisplay 0x1 kshowignored 0x8 kunreadonly 0x10 kexpandall 0x20 kgroupbysort 0x40 ...
nsMsgViewSortType
the nsmsgviewsorttype interface contains constants used for sorting the thunderbird threadpane.
...for example to sort by date you would pass a function the value: components.interfaces.nsmsgviewsorttype.bydate mailnews/base/public/nsimsgdbview.idlscriptable please add a summary to this article.
nsMsgViewType
the nsmsgviewtype interface contains constants used for views in thunderbird.
...for example, to request the 'show all threads' view use the constant: components.interfaces.nsmsgviewtype.eshowallthreads constants name value description eshowallthreads 0 eshowthreadswithunread 2 eshowwatchedthreadswithunread 3 eshowquicksearchresults 4 eshowvirtualfolderresults 5 eshowsearch 6 ...
CSSPseudoElement.type - Web APIs
the type read-only property of the csspseudoelement interface returns the type of the pseudo-element as a string, represented in the form of a css selector.
... syntax var typeofpseudoelement = csspseudoelement.type; value a cssomstring containing one of the following values: "::before" "::after" "::marker" examples the example below demonstrates the relationship between csspseudoelement.type and element.pseudo(): const myelement = document.queryselector('q'); const myselector = '::after'; const csspseudoelement = myelement.pseudo(myselector); const typeofpseudoelement = csspseudoelement.type; console.log(myselector === typeofpseudoelement); // outputs true specifications specification status comment css pseudo-elements level 4the definition of 'type' in that specification.
Client.frameType - Web APIs
WebAPIClientframeType
the frametype read-only property of the client interface indicates the type of browsing context of the current client.
... syntax var myframetype = client.frametype; example tbd specifications specification status comment service workersthe definition of 'frametype' in that specification.
Credential.type - Web APIs
WebAPICredentialtype
the type property of the credential interface returns a domstring containing the credential's type.
... syntax var credtype = credential.type; value a domstring contains a credential's given name.
HTMLStyleElement.type - Web APIs
the htmlstyleelement.type read-only property returns the type of the current style.
... for gecko, the type is most often given as "text/css." from the w3c spec on css: "the expectation is that binding-specific casting methods can be used to cast down from an instance of the cssrule interface to the specific derived interface implied by the type." syntax string = style.type; example if (newstyle.type != "text/css"){ // not supported!
FileHandle.type - Web APIs
summary provides the mime type of the file.
... syntax var type = instanceoffilehandle.type value a string.
MediaKeyMessageEvent.messageType - Web APIs
the mediakeymessageevent.messagetype read-only property indicates the type of message.
... syntax var messagetype = mediakeymessageevent.messagetype; specifications specification status comment encrypted media extensionsthe definition of 'messagetype' in that specification.
NetworkInformation.type - Web APIs
the networkinformation.type read-only property returns the type of connection a device is using to communicate with the network.
... syntax var type = netinfo.type return value an enumerated value that is one of the following values: "bluetooth" "cellular" "ethernet" "none" "wifi" "wimax" "other" "unknown" specifications specification status comment network information apithe definition of 'type' in that specification.
NodeList.prototype.forEach() - Web APIs
WebAPINodeListforEach
on(currentvalue, currentindex, listobj) { console.log(currentvalue + ', ' + currentindex + ', ' + this); }, 'mythisarg' ); the above code results in the following: [object htmlparagraphelement], 0, mythisarg [object text], 1, mythisarg [object htmlspanelement], 2, mythisarg polyfill this polyfill adds compatibility to all browsers supporting es5: if (window.nodelist && !nodelist.prototype.foreach) { nodelist.prototype.foreach = function (callback, thisarg) { thisarg = thisarg || window; for (var i = 0; i < this.length; i++) { callback.call(thisarg, this[i], i, this); } }; } or if (window.nodelist && !nodelist.prototype.foreach) { nodelist.prototype.foreach = array.prototype.foreach; } the above behavior is how many browsers actuall...
...y implement nodelist.prototype.foreach() (chrome, for example).
RTCIceCredentialType - Web APIs
the webrtc api's rtcicecredentialtype enumerated string type defines the authentication method used to gain access to an ice server identified by an rtciceserver object.
... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecredentialtype' in that specification.
StyleSheet.type - Web APIs
WebAPIStyleSheettype
the type property of the stylesheet interface specifies the style sheet language for the given style sheet.
... syntax string = stylesheet.type example mystylesheet.type = 'text/css'; specifications specification status comment css object model (cssom)the definition of 'stylesheet: type' in that specification.
TextEncoder.prototype.encode() - Web APIs
the textencoder.prototype.encode() method takes a usvstring as input, and returns a uint8array containing the text given in parameters encoded with the specific method for that textencoder object.
...oded result: </p> const sourcepara = document.queryselector('.source'); const resultpara = document.queryselector('.result'); const string = sourcepara.textcontent; const textencoder = new textencoder(); let encoded = textencoder.encode(string); resultpara.textcontent += encoded; specifications specification status comment encodingthe definition of 'textencoder.prototype.encode()' in that specification.
TrackDefault.type - Web APIs
WebAPITrackDefaulttype
the type read-only property of the trackdefault interface returns the type of track that this sourcebuffer's media segment data relates to (i.e.
... audio, video, or text track.) syntax var mytype = trackdefault.type; value a domstring — one of audio, video or text.
WebGLActiveInfo.type - Web APIs
the read-only webglactiveinfo.type property represents the type of the requested data returned by calling the getactiveattrib() or getactiveuniform() methods.
... examples var activeattrib = gl.getactiveattrib(program, index); activeattrib.type; var activeuniform = gl.getactiveuniform(program, index); activeuniform.type; specifications specification status comment webgl 1.0the definition of 'webglactiveinfo.type' in that specification.
TypeError: can't redefine non-configurable property "x" - JavaScript
message typeerror: cannot modify non-writable property {x} (edge) typeerror: can't redefine non-configurable property "x" (firefox) typeerror: cannot redefine property: "x" (chrome) error type typeerror what went wrong?
... var obj = object.create({}); object.defineproperty(obj, "foo", {value: "bar"}); object.defineproperty(obj, "foo", {value: "baz"}); // typeerror: can't redefine non-configurable property "foo" you will need to set the "foo" property to configurable, if you intend to redefine it later in the code.
TypeError: More arguments needed - JavaScript
message typeerror: argument is not an object and is not null (edge) typeerror: object.create requires at least 1 argument, but only 0 were passed typeerror: object.setprototypeof requires at least 2 arguments, but only 0 were passed typeerror: object.defineproperties requires at least 1 argument, but only 0 were passed error type typeerror.
... examples required arguments not provided the object.create() method requires at least one argument and the object.setprototypeof() method requires at least two arguments: var obj = object.create(); // typeerror: object.create requires at least 1 argument, but only 0 were passed var obj = object.setprototypeof({}); // typeerror: object.setprototypeof requires at least 2 arguments, but only 1 were passed you can fix this by setting null as the prototype, for example: var obj = object.create(null); var obj = object.setprototypeof({}, null); ...
TypeError: "x" has no properties - JavaScript
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.
... examples null and undefined have no properties null.foo; // typeerror: null has no properties undefined.bar; // typeerror: undefined has no properties ...
Array.prototype.concat() - JavaScript
data types such as strings, numbers and booleans (not string, number, and boolean objects): concat copies the values of strings and numbers into the new array.
...nested arrays and demonstrates retention of references: const num1 = [[1]]; const num2 = [2, [3]]; const numbers = num1.concat(num2); console.log(numbers); // results in [[1], 2, [3]] // modify the first element of num1 num1[0].push(4); console.log(numbers); // results in [[1, 4], 2, [3]] specifications specification ecmascript (ecma-262)the definition of 'array.prototype.concat' in that specification.
Array.prototype.flatMap() - JavaScript
description see array.prototype.map() for a detailed description of the callback function.
...[n] : [n-1, 1] ) // expected output: [4, 1, 4, 20, 16, 1, 18] specifications specification ecmascript (ecma-262)the definition of 'array.prototype.flatmap' in that specification.
Array.prototype.includes() - JavaScript
(function() { console.log(array.prototype.includes.call(arguments, 'a')) // true console.log(array.prototype.includes.call(arguments, 'd')) // false })('a','b','c') please do not add polyfills on reference articles.
... for more details and discussion, see https://discourse.mozilla.org/t/mdn-rfc-001-mdn-wiki-pages-shouldnt-be-a-distributor-of-polyfills/24500 specifications specification ecmascript (ecma-262)the definition of 'array.prototype.includes' in that specification.
Array.prototype.join() - JavaScript
var a = ['wind', 'water', 'fire']; a.join(); // 'wind,water,fire' a.join(', '); // 'wind, water, fire' a.join(' + '); // 'wind + water + fire' a.join(''); // 'windwaterfire' joining an array-like object the following example joins array-like object (arguments), by calling function.prototype.call on array.prototype.join.
... function f(a, b, c) { var s = array.prototype.join.call(arguments); console.log(s); // '1,a,true' } f(1, 'a', true); //expected output: "1,a,true" specifications specification ecmascript (ecma-262)the definition of 'array.prototype.join' in that specification.
Array.prototype.length - JavaScript
the length property of an object which is an instance of type array sets or returns the number of elements in that array.
... property attributes of array.prototype.length writable yes enumerable no configurable no writable: if this attribute set to false, the value of the property cannot be changed.
Array.prototype.pop() - JavaScript
array.prototype.shift() has similar behavior to pop, but applied to the first element in an array.
... var myfish = {0:'angel', 1:'clown', 2:'mandarin', 3:'sturgeon', length: 4}; var popped = array.prototype.pop.call(myfish); //same syntax for using apply( ) console.log(myfish); // {0:'angel', 1:'clown', 2:'mandarin', length: 3} console.log(popped); // 'sturgeon' specifications specification ecmascript (ecma-262)the definition of 'array.prototype.pop' in that specification.
Array.prototype.shift() - JavaScript
array.prototype.pop() has similar behavior to shift, but applied to the last element in an array.
...in the following example every iteration will remove the next element from an array, until it is empty: var names = ["andrew", "edward", "paul", "chris" ,"john"]; while( (i = names.shift()) !== undefined ) { console.log(i); } // andrew, edward, paul, chris, john specifications specification ecmascript (ecma-262)the definition of 'array.prototype.shift' in that specification.
Array.prototype.slice() - JavaScript
function list() { return array.prototype.slice.call(arguments) } let list1 = list(1, 2, 3) // [1, 2, 3] binding can be done with the call() method of function.prototype and it can also be reduced using [].slice.call(arguments) instead of array.prototype.slice.call.
... let unboundslice = array.prototype.slice let slice = function.prototype.call.bind(unboundslice) function list() { return slice(arguments) } let list1 = list(1, 2, 3) // [1, 2, 3] specifications specification ecmascript (ecma-262)the definition of 'array.prototype.slice' in that specification.
Array.prototype.toString() - JavaScript
object.prototype.tostring() will be called, and the resulting value will be returned.
... examples using tostring const array1 = [1, 2, 'a', '1a']; console.log(array1.tostring()); // expected output: "1,2,a,1a" specifications specification ecmascript (ecma-262)the definition of 'array.prototype.tostring' in that specification.
BigInt.prototype.toLocaleString() - JavaScript
yen doesn't use a minor unit console.log(bigint.tolocalestring('ja-jp', { style: 'currency', currency: 'jpy' })) // → ¥123,456,789,123,456,789 // limit to three significant digits console.log(bigint.tolocalestring('en-in', { maximumsignificantdigits: 3 })); // → 1,23,00,00,00,00,00,00,000 specifications specification ecmascript (ecma-262)the definition of 'bigint.prototype.tolocalestring()' in that specification.
... ecmascript internationalization api (ecma-402)the definition of 'bigint.prototype.tolocalestring()' in that specification.
Boolean.prototype.toString() - JavaScript
description the boolean object overrides the tostring method of the object object; it does not inherit object.prototype.tostring().
... examples using tostring() in the following code, flag.tostring() returns "true": var flag = new boolean(true); var myvar = flag.tostring(); specifications specification ecmascript (ecma-262)the definition of 'boolean.prototype.tostring' in that specification.
Boolean.prototype.valueOf() - JavaScript
syntax bool.valueof() return value the primitive value of the given boolean object description the valueof() method of boolean returns the primitive value of a boolean object or literal boolean as a boolean data type.
... examples using valueof() x = new boolean(); myvar = x.valueof(); // assigns false to myvar specifications specification ecmascript (ecma-262)the definition of 'boolean.prototype.valueof' in that specification.
Date.prototype.getDay() - JavaScript
for the day of the month, see date.prototype.getdate().
...using this method, the internationalization is made easier: var options = { weekday: 'long'}; console.log(new intl.datetimeformat('en-us', options).format(xmas95)); // monday console.log(new intl.datetimeformat('de-de', options).format(xmas95)); // montag specifications specification ecmascript (ecma-262)the definition of 'date.prototype.getday' in that specification.
Date.prototype.toISOString() - JavaScript
engines which have not been updated to support this method can work around the absence of this method using the following shim: if (!date.prototype.toisostring) { (function() { function pad(number) { if (number < 10) { return '0' + number; } return number; } date.prototype.toisostring = function() { return this.getutcfullyear() + '-' + pad(this.getutcmonth() + 1) + '-' + pad(this.getutcdate()) + 't' + pad(this.getutchours()) + ':' + pad(this.getutcminutes()) + ...
... specifications specification ecmascript (ecma-262)the definition of 'date.prototype.toisostring' in that specification.
Date.prototype.toLocaleDateString() - JavaScript
dezember 2012" // an application may want to use utc and make that visible options.timezone = 'utc'; options.timezonename = 'short'; console.log(date.tolocaledatestring('en-us', options)); // → "thursday, december 20, 2012, gmt" specifications specification ecmascript (ecma-262)the definition of 'date.prototype.tolocaledatestring' in that specification.
... ecmascript internationalization api (ecma-402)the definition of 'date.prototype.tolocaledatestring' in that specification.
Date.prototype.toLocaleString() - JavaScript
specifications specification ecmascript (ecma-262)the definition of 'date.prototype.tolocalestring' in that specification.
... ecmascript internationalization api (ecma-402)the definition of 'date.prototype.tolocalestring' in that specification.
Date.prototype.toLocaleTimeString() - JavaScript
e us needs 24-hour time console.log(date.tolocaletimestring('en-us', { hour12: false })); // → "19:00:00" // show only hours and minutes, use options with the default locale - use an empty array console.log(date.tolocaletimestring([], { hour: '2-digit', minute: '2-digit' })); // → "20:01" specifications specification ecmascript (ecma-262)the definition of 'date.prototype.tolocaletimestring' in that specification.
... ecmascript internationalization api (ecma-402)the definition of 'date.prototype.tolocaletimestring' in that specification.
Error.prototype.message - JavaScript
the message property combined with the name property is used by the error.prototype.tostring() method to create a string representation of the error.
... examples throwing a custom error var e = new error('could not parse input'); // e.message is 'could not parse input' throw e; specifications specification ecmascript (ecma-262)the definition of 'error.prototype.message' in that specification.
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.
....resolvedoptions(); usedoptions.locale; // "de" usedoptions.usage; // "sort" usedoptions.sensitivity; // "base" usedoptions.ignorepunctuation; // false usedoptions.collation; // "default" usedoptions.numeric; // false specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.collator.prototype.resolvedoptions' in that specification.
Intl.DateTimeFormat.prototype.format() - JavaScript
the intl.datetimeformat.prototype.format() method formats a date according to the locale and formatting options of this intl.datetimeformat object.
...note that the function is bound to the intl.datetimeformat from which it was obtained, so it can be passed directly to array.prototype.map().
Intl.DateTimeFormat.prototype.formatRange() - JavaScript
the intl.datetimeformat.prototype.formatrange() formats a date range in the most concise way based on the locale and options provided when instantiating intl.datetimeformat object.
... syntax intl.datetimeformat.prototype.formatrange(startdate, enddate) examples basic formatrange usage this method receives two dates and formats the date range in the most concise way based on the locale and options provided when instantiating intl.datetimeformat.
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.
...c' }); var usedoptions = germanfakeregion.resolvedoptions(); usedoptions.locale; // "de" usedoptions.calendar; // "gregory" usedoptions.numberingsystem; // "latn" usedoptions.timezone; // "utc" usedoptions.month; // "numeric" specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.datetimeformat.prototype.resolvedoptions' in that specification.
Intl.Locale.prototype.caseFirst - JavaScript
the intl.locale.prototype.casefirst property is an accessor property that returns whether case is taken into account for the locale's collation rules.
... let casefirststr = new intl.locale("fr-latn-fr-u-kf-upper"); console.log(casefirststr.casefirst); // prints "upper" setting the casefirst value via the configuration object argument the intl.locale constructor has an optional configuration object argument, which can be used to pass extension types.
Intl.Locale.prototype.numberingSystem - JavaScript
the intl.locale.prototype.numberingsystem property is an accessor property that returns the numeral system used by the locale.
... let numberingsystemviastr = new intl.locale("fr-latn-fr-u-nu-mong"); console.log(numberingsystemstr.numberingsystem); // prints "mong" setting the numberingsystem value via the configuration object argument the intl.locale constructor has an optional configuration object argument, which can be used to pass extension types.
Intl.Locale.prototype.numeric - JavaScript
the intl.locale.prototype.numeric property is an accessor property that returns whether the locale has special collation handling for numeric characters.
... let numericviastr = new intl.locale("fr-latn-fr-u-kn-false"); console.log(numericstr.numeric); // prints "false" setting the numeric value via the configuration object argument the intl.locale constructor has an optional configuration object argument, which can be used to pass extension types.
Intl.Locale.prototype.toString() - JavaScript
the intl.locale.prototype.tostring() returns the locale's full locale identifier string.
...information about a particular locale (language, script, calendar type, etc.) can be encoded in a locale identifier string.
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.
...dard" usedoptions.signdisplay; // "auto" usedoption.style; // "decimal" usedoptions.minimumintegerdigits; // 1 usedoptions.minimumfractiondigits; // 0 usedoptions.maximumfractiondigits; // 3 usedoptions.usegrouping; // true specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.numberformat.prototype.resolvedoptions' in that specification.
Map.prototype.delete() - JavaScript
specifications specification ecmascript (ecma-262)the definition of 'map.prototype.delete' in that specification.
... ecmascript 2015 (6th edition, ecma-262)the definition of 'map.prototype.delete' in that specification.
Number.prototype.toExponential() - JavaScript
typeerror if this method is invoked on an object that is not a number.
...r numobj = 77.1234; console.log(numobj.toexponential()); // logs 7.71234e+1 console.log(numobj.toexponential(4)); // logs 7.7123e+1 console.log(numobj.toexponential(2)); // logs 7.71e+1 console.log(77.1234.toexponential()); // logs 7.71234e+1 console.log(77 .toexponential()); // logs 7.7e+1 specifications specification ecmascript (ecma-262)the definition of 'number.prototype.toexponential' in that specification.
Number.prototype.toString() - JavaScript
(it does not inherit object.prototype.tostring()).
... // displays '17' console.log((17.2).tostring()) // displays '17.2' let x = 6 console.log(x.tostring(2)) // displays '110' console.log((254).tostring(16)) // displays 'fe' console.log((-10).tostring(2)) // displays '-1010' console.log((-0xff).tostring(2)) // displays '-11111111' specifications specification ecmascript (ecma-262)the definition of 'number.prototype.tostring' in that specification.
Object.prototype.__lookupGetter__() - JavaScript
it is now possible to do this in a standardized way using object.getownpropertydescriptor() and object.getprototypeof().
...'foo' : 'bar'; }) specifications specification ecmascript (ecma-262)the definition of 'object.prototype.__lookupgetter__()' in that specification.
Object.prototype.toLocaleString() - JavaScript
objects overriding tolocalestring array: array.prototype.tolocalestring() number: number.prototype.tolocalestring() date: date.prototype.tolocalestring() typedarray: typedarray.prototype.tolocalestring() bigint: bigint.prototype.tolocalestring() examples array tolocalestring() override on array objects, tolocalestring() can be used to print array values as a string, optionally with locale-specific identifiers (such as currency symbols) appended...
...with the correct separators: for example: const testnumber = 2901234564; // "2901234564" let denumber = testnumber.tolocalestring('de'); // "2.901.234.564" let frnumber = testnumber.tolocalestring('fr'); // "2 901 234 564" specifications specification ecmascript (ecma-262)the definition of 'object.prototype.tolocalestring' in that specification.
Promise.prototype.finally() - JavaScript
examples using finally let isloading = true; fetch(myrequest).then(function(response) { var contenttype = response.headers.get("content-type"); if(contenttype && contenttype.includes("application/json")) { return response.json(); } throw new typeerror("oops, we haven't got json!"); }) .then(function(json) { /* process your json further */ }) .catch(function(error) { console.error(error); /* this line can also throw, e.g.
...for more details, refer to: https://discourse.mozilla.org/t/mdn-rfc-001-mdn-wiki-pages-shouldnt-be-a-distributor-of-polyfills/24500 specifications specification ecmascript (ecma-262)the definition of 'promise.prototype.finally' in that specification.
RegExp.prototype.dotAll - JavaScript
property attributes of regexp.prototype.dotall writable no enumerable no configurable yes description the value of dotall is a boolean and true if the "s" flag was used; otherwise, false.
...str1.replace(regex1,'')); // output: foo example var str2 = 'bar\nexample foo example'; var regex2 = new regexp('bar.example'); console.log(regex2.dotall); // output: false console.log(str2.replace(regex2,'')); // output: bar // example foo example specifications specification ecmascript (ecma-262)the definition of 'regexp.prototype.dotall' in that specification.
RegExp.prototype.flags - JavaScript
property attributes of regexp.prototype.flags writable no enumerable no configurable yes description flags in the flags property are sorted alphabetically (from left to right, e.g.
... polyfill if (regexp.prototype.flags === undefined) { object.defineproperty(regexp.prototype, 'flags', { configurable: true, get: function() { return this.tostring().match(/[gimsuy]*$/)[0]; } }); } examples using flags /foo/ig.flags; // "gi" /bar/myu.flags; // "muy" specifications specification ecmascript (ecma-262)the definition of 'regexp.prototype.flags' in that specification.
RegExp.prototype.global - JavaScript
property attributes of regexp.prototype.global writable no enumerable no configurable yes description the value of global is a boolean and true if the "g" flag was used; otherwise, false.
... global var regex = new regexp('foo', 'g'); console.log(regex.global); // true var str = 'fooexamplefoo'; var str1 = str.replace(regex, ''); console.log(str1); // output: example var regex1 = new regexp('foo'); var str2 = str.replace(regex1, ''); console.log(str2); // output: examplefoo specifications specification ecmascript (ecma-262)the definition of 'regexp.prototype.global' in that specification.
RegExp.prototype.ignoreCase - JavaScript
property attributes of regexp.prototype.ignorecase writable no enumerable no configurable yes description the value of ignorecase is a boolean and true if the "i" flag was used; otherwise, false.
... examples using ignorecase var regex = new regexp('foo', 'i'); console.log(regex.ignorecase); // true specifications specification ecmascript (ecma-262)the definition of 'regexp.prototype.ignorecase' in that specification.
RegExp.prototype.multiline - JavaScript
property attributes of regexp.prototype.multiline writable no enumerable no configurable yes description the value of multiline is a boolean and is true if the "m" flag was used; otherwise, false.
... examples using multiline var regex = new regexp('foo', 'm'); console.log(regex.multiline); // true specifications specification ecmascript (ecma-262)the definition of 'regexp.prototype.multiline' in that specification.
RegExp.prototype.source - JavaScript
property attributes of regexp.prototype.source writable no enumerable no configurable yes examples using source var regex = /foobar/ig; console.log(regex.source); // "foobar", doesn't contain /.../ and "ig".
... new regexp().source; // "(?:)" new regexp('\n').source === '\n'; // true, prior to es5 new regexp('\n').source === '\\n'; // true, starting with es5 specifications specification ecmascript (ecma-262)the definition of 'regexp.prototype.source' in that specification.
RegExp.prototype.sticky - JavaScript
property attributes of regexp.prototype.sticky writable no enumerable no configurable yes description the value of sticky is a boolean and true if the "y" flag was used; otherwise, false.
...regex.test('..foo'); // false - index 2 is not the beginning of the string var regex2 = /^foo/my; regex2.lastindex = 2; regex2.test('..foo'); // false - index 2 is not the beginning of the string or line regex2.lastindex = 2; regex2.test('.\nfoo'); // true - index 2 is the beginning of a line specifications specification ecmascript (ecma-262)the definition of 'regexp.prototype.sticky' in that specification.
RegExp.prototype.toString() - JavaScript
description the regexp object overrides the tostring() method of the object object; it does not inherit object.prototype.tostring().
...rting with ecmascript 5, an empty regular expression returns the string "/(?:)/" and line terminators such as "\n" are escaped: new regexp().tostring(); // "/(?:)/" new regexp('\n').tostring() === '/\n/'; // true, prior to es5 new regexp('\n').tostring() === '/\\n/'; // true, starting with es5 specifications specification ecmascript (ecma-262)the definition of 'regexp.prototype.tostring' in that specification.
RegExp.prototype.unicode - JavaScript
property attributes of regexp.prototype.unicode writable no enumerable no configurable yes description the value of unicode is a boolean and true if the "u" flag was used; otherwise false.
... examples using the unicode property var regex = new regexp('\u{61}', 'u'); console.log(regex.unicode); // true specifications specification ecmascript (ecma-262)the definition of 'regexp.prototype.unicode' in that specification.
String.prototype.concat() - JavaScript
if the arguments are not of the type string, they are converted to string values before concatenating.
... let greetlist = ['hello', ' ', 'venkat', '!'] "".concat(...greetlist) // "hello venkat!" "".concat({}) // [object object] "".concat([]) // "" "".concat(null) // "null" "".concat(true) // "true" "".concat(4, 5) // "45" specifications specification ecmascript (ecma-262)the definition of 'string.prototype.concat' in that specification.
String.prototype.endsWith() - JavaScript
however, you can polyfill string.prototype.endswith() with the following snippet: if (!string.prototype.endswith) { string.prototype.endswith = function(search, this_len) { if (this_len === undefined || this_len > this.length) { this_len = this.length; } return this.substring(this_len - search.length, this_len) === search; }; } examples using endswith() let str = 'to be, or not to be, that is the question.' console.log(s...
...tr.endswith('question.')) // true console.log(str.endswith('to be')) // false console.log(str.endswith('to be', 19)) // true specifications specification ecmascript (ecma-262)the definition of 'string.prototype.endswith' in that specification.
String.prototype.includes() - JavaScript
however, you can easily polyfill this method: if (!string.prototype.includes) { string.prototype.includes = function(search, start) { 'use strict'; if (search instanceof regexp) { throw typeerror('first argument must not be a regexp'); } if (start === undefined) { start = 0; } return this.indexof(search, start) !== -1; }; } examples using includes() const str = 'to be, or not to be, that is the question.' console.log(str.includ...
...es('to be')) // true console.log(str.includes('question')) // true console.log(str.includes('nonexistent')) // false console.log(str.includes('to be', 1)) // false console.log(str.includes('to be')) // false console.log(str.includes('')) // true specifications specification ecmascript (ecma-262)the definition of 'string.prototype.includes' in that specification.
String.prototype.indexOf() - JavaScript
note: for the array method, see array.prototype.indexof().
...s count to the number of occurrences of the letter e in the string str: const str = 'to be, or not to be, that is the question.' let count = 0 let position = str.indexof('e') while (position !== -1) { count++ position = str.indexof('e', position + 1) } console.log(count) // displays 4 specifications specification ecmascript (ecma-262)the definition of 'string.prototype.indexof' in that specification.
String.prototype.localeCompare() - JavaScript
positive value numeric sorting // by default, "2" > "10" console.log("2".localecompare("10")); // 1 // numeric using options: console.log("2".localecompare("10", undefined, {numeric: true})); // -1 // numeric using locales tag: console.log("2".localecompare("10", "en-u-kn-true")); // -1 specifications specification ecmascript (ecma-262)the definition of 'string.prototype.localecompare' in that specification.
... ecmascript internationalization api (ecma-402)the definition of 'string.prototype.localecompare' in that specification.
String.prototype.repeat() - JavaScript
however, you can polyfill string.prototype.repeat() with the following snippet: if (!string.prototype.repeat) { string.prototype.repeat = function(count) { 'use strict'; if (this == null) throw new typeerror('can\'t convert ' + this + ' to object'); var str = '' + this; // to convert string to integer.
...str; count--; } str += str.substring(0, maxcount - str.length); return str; } } examples using repeat 'abc'.repeat(-1) // rangeerror 'abc'.repeat(0) // '' 'abc'.repeat(1) // 'abc' 'abc'.repeat(2) // 'abcabc' 'abc'.repeat(3.5) // 'abcabcabc' (count will be converted to integer) 'abc'.repeat(1/0) // rangeerror ({ tostring: () => 'abc', repeat: string.prototype.repeat }).repeat(2) // 'abcabc' (repeat() is a generic method) specifications specification ecmascript (ecma-262)the definition of 'string.prototype.repeat' in that specification.
String.prototype.search() - JavaScript
(if you only want to know if it exists, use the similar test() method on the regexp prototype, which returns a boolean.) for more information (but slower execution) use match() (similar to the regular expression exec() method).
...an unsuccessful search (-1) let str = "hey jude" let re = /[a-z]/g let redot = /[.]/g console.log(str.search(re)) // returns 4, which is the index of the first capital letter "j" console.log(str.search(redot)) // returns -1 cannot find '.' dot punctuation specifications specification ecmascript (ecma-262)the definition of 'string.prototype.search' in that specification.
String.prototype.startsWith() - JavaScript
however, you can polyfill string.prototype.startswith() with the following snippet: if (!string.prototype.startswith) { object.defineproperty(string.prototype, 'startswith', { value: function(search, rawpos) { var pos = rawpos > 0 ?
... examples using startswith() //startswith let str = 'to be, or not to be, that is the question.' console.log(str.startswith('to be')) // true console.log(str.startswith('not to be')) // false console.log(str.startswith('not to be', 10)) // true specifications specification ecmascript (ecma-262)the definition of 'string.prototype.startswith' in that specification.
String.prototype.substr() - JavaScript
to use this feature in jscript, you can use the following code: // only run when the substr() function is broken if ('ab'.substr(-1) != 'b') { /** * get the substring of a string * @param {integer} start where to start the substring * @param {integer} length how many characters to return * @return {string} */ string.prototype.substr = function(substr) { return function(start, length) { // call the original method return substr.call(this, // did we get a negative start, calculate how much it is from the beginning of the string // adjust the start parameter for negative value start < 0 ?
... this.length + start : start, length) } }(string.prototype.substr); } examples using substr() var astring = 'mozilla'; console.log(astring.substr(0, 1)); // 'm' console.log(astring.substr(1, 0)); // '' console.log(astring.substr(-1, 1)); // 'a' console.log(astring.substr(1, -1)); // '' console.log(astring.substr(-3)); // 'lla' console.log(astring.substr(1)); // 'ozilla' console.log(astring.substr(-20, 2)); // 'mo' console.log(astring.substr(20, 2)); // '' specifications specification ecmascript (ecma-262)the definition of 'string.prototype.substr' in that specification.
String.prototype.substring() - JavaScript
if you need to replace substrings, most of the time you will want to use string.prototype.replace().
... specifications specification ecmascript (ecma-262)the definition of 'string.prototype.substring' in that specification.
String.prototype.trim() - JavaScript
if (!string.prototype.trim) { string.prototype.trim = function () { return this.replace(/^[\s\ufeff\xa0]+|[\s\ufeff\xa0]+$/g, ''); }; } examples using trim() the following example displays the lowercase string 'foo': var orig = ' foo '; console.log(orig.trim()); // 'foo' // another example of .trim() removing whitespace from just one side.
... var orig = 'foo '; console.log(orig.trim()); // 'foo' specifications specification ecmascript (ecma-262)the definition of 'string.prototype.trim' in that specification.
String.prototype.trimEnd() - JavaScript
aliasing for consistency with functions like string.prototype.padend the standard method name is trimend.
...in some engines this means: string.prototype.trimright.name === "trimend"; examples using trimend() the following example displays the lowercase string ' foo': var str = ' foo '; console.log(str.length); // 8 str = str.trimend(); console.log(str.length); // 6 console.log(str); // ' foo' specifications specification ecmascript (ecma-262)the definition of 'string.prototype.trimend' in that specification.
Symbol.prototype[@@toPrimitive] - JavaScript
description the [@@toprimitive]() method of symbol returns the primitive value of a symbol object as a symbol data type.
... examples using @@toprimitive const sym = symbol("example"); sym === sym[symbol.toprimitive](); // true specifications specification ecmascript (ecma-262)the definition of 'symbol.prototype.@@toprimitive' in that specification.
Symbol.prototype.toString() - JavaScript
description the symbol object overrides the tostring method of the object object; it does not inherit object.prototype.tostring().
... no string concatenation while you can call tostring() on symbols, you cannot use string concatenation with them: symbol('foo') + 'bar' // typeerror: can't convert symbol to string examples using tostring symbol('desc').tostring() // "symbol(desc)" // well-known symbols symbol.iterator.tostring() // "symbol(symbol.iterator) // global symbols symbol.for('foo').tostring() // "symbol(foo)" specifications specification ecmascript (ecma-262)the definition of 'symbol.prototype.tostring' in that specification.
Symbol.prototype.valueOf() - JavaScript
description the valueof method of symbol returns the primitive value of a symbol object as a symbol data type.
... examples using valueof const sym = symbol("example"); sym === sym.valueof(); // true specifications specification ecmascript (ecma-262)the definition of 'symbol.prototype.valueof' in that specification.
WebAssembly.Table.prototype.get() - JavaScript
the get() prototype method of the webassembly.table() object retrieves a function reference stored at a given index.
... exceptions if index is greater than or equal to table.prototype.length, a rangeerror is thrown.
xlink:type - SVG: Scalable Vector Graphics
the xlink:type attribute identifies the type of xlink being used.
... specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'xlink:type' in that specification.
Types of attacks - Web security
this article describes various types of security attacks and techniques to mitigate them.
...for endpoints that require a post request, it's possible to programmatically trigger a <form> submit (perhaps in an invisible <iframe>) when the page is loaded: <form action="https://bank.example.com/withdraw" method="post"> <input type="hidden" name="account" value="bob"> <input type="hidden" name="amount" value="1000000"> <input type="hidden" name="for" value="mallory"> </form> <script>window.addeventlistener('domcontentloaded', (e) => { document.queryselector('form').submit(); }</script> there are a few techniques that should be used to prevent this from happening: get endpoints should be idempotent—actions that e...
Two Types of Scripts - Archive of obsolete content
api access for add-on code and content scripts the table below summarizes the apis that are available to each type of script.
colorpicker.type - Archive of obsolete content
« xul reference home type type: string if this attribute is not present, the colorpicker is displayed inside the window.
editor.type - Archive of obsolete content
« xul reference home type type: string if set to the string content-primary, this editor becomes the primary content for the page.
listcell.type - Archive of obsolete content
« xul reference home type type: string this attribute is reserved for use by anonymous children of listitem; do not use.
listitem.type - Archive of obsolete content
« xul reference home type type: string you can make an item in a listbox a checkbox by setting this attribute to the value checkbox.
menuitem.type - Archive of obsolete content
« xul reference home type type: one of the values below can be used to create checkable menuitems or for radio button menuitems.
notification.type - Archive of obsolete content
« xul reference home type type: one of the values below indicates the type of notification, determined from the priority.
panel.type - Archive of obsolete content
« xul reference home type type: string the panel type.
parsetype - Archive of obsolete content
« xul reference home parsetype type: string if this attribute is set to integer, the rule will only match rdf nodes with a parse type of integer.
preference.type - Archive of obsolete content
« xul reference home type type: one of the values below the preference type which should be one of the following values.
prefwindow.type - Archive of obsolete content
« xul reference home type type: string set this attribute to child for preference dialogs that are child dialogs of a main preferences window.
query.type - Archive of obsolete content
« xul reference home type type: one of the values below the type of the parameter's value integer 32 bit integer int64 64 bit integer double double-precision floating-point number string string literal, the default value ...
querytype - Archive of obsolete content
« xul reference home querytype type: string indicates the type of datasource used in a template.
script.type - Archive of obsolete content
« xul reference home type type: language content type the language of the script.
seltype - Archive of obsolete content
« xul reference home seltype type: one of the values below used to indicate whether multiple selection is allowed.
type - Archive of obsolete content
ArchiveMozillaXULAttributetype
see button.type browser.type colorpicker.type datepicker.type editor.type listcell.type listitem.type menuitem.type notification.type prefwindow.type query.type script.type textbox.type toolbarbutton.type treecol.type ...
accessibleType - Archive of obsolete content
« xul reference accessibletype type: integer a value indicating the type of accessibility object for the element.
dlgType - Archive of obsolete content
« xul reference dlgtype type: string gets and sets the value of the dlgtype attribute.
selType - Archive of obsolete content
« xul reference seltype type: string gets and sets the value of the seltype attribute.
nsMsgRuleActionType
defined in comm-central/ mailnews/ base/ search/ public/ nsmsgfiltercore.idl typedef long nsmsgruleactiontype; [scriptable, uuid(59af7696-1e28-4642-a400-fa327ae0b8d8)] interface nsmsgfilteraction { /* if you change these, you need to update filter.properties, look for filteractionx */ /* these longs are all actually of type nsmsgfilteractiontype */ const long custom=-1; /* see nsmsgfilteraction */ const long none=0; /* uninitialized state */ const long movetofolder=1; const long changepriority=2; const long delete=3; const long markread=4; const long killthread=5; const long watchthread=6; const long markflagged=7; const long label=8; const long reply=9; const long forward=10; const long stopexecution=11;...
nsMsgSearchTypeValue
defined in comm-central/ mailnews/ base/ search/ public/ nsmsgsearchcore.idl used to specify type of search to be performed [scriptable,uuid(964b7f32-304e-11d3-ae13-00a0c900d445)] interface nsmsgsearchtype { const nsmsgsearchtypevalue none = 0; const nsmsgsearchtypevalue rootdse = 1; const nsmsgsearchtypevalue normal = 2; const nsmsgsearchtypevalue ldapvlv = 3; const nsmsgsearchtypevalue namecompletion = 4; }; ...
TextDecoder.prototype.decode() - Web APIs
the textdecoder.prototype.decode() method returns a domstring containing the text, given in parameters, decoded with the specific method for that textdecoder object.
TextDecoder.prototype.encoding - Web APIs
the textdecoder.prototype.encoding read-only property returns a domstring containing the name of the decoding algorithm used by the specific decoder.
Worker.prototype.postMessage() - Web APIs
if the message parameter is not provided, a typeerror will be thrown.
SVG-in-OpenType - Developer guides
the svg-in-opentype work is currently in the hands of the mpeg group.
TypeError: can't access dead object - JavaScript
message typeerror: can't access dead object error type typeerror what went wrong?
TypeError: variable "x" redeclares argument - JavaScript
message typeerror: variable "x" redeclares argument (firefox) error type typeerror warning in strict mode only.
Array.prototype.entries() - JavaScript
ement const a = ['a', 'b', 'c']; for (const [index, element] of a.entries()) console.log(index, element); // 0 'a' // 1 'b' // 2 'c' using a for…of loop var a = ['a', 'b', 'c']; var iterator = a.entries(); for (let e of iterator) { console.log(e); } // [0, 'a'] // [1, 'b'] // [2, 'c'] specifications specification ecmascript (ecma-262)the definition of 'array.prototype.entries' in that specification.
Array.prototype.flat() - JavaScript
, [5, 6]]]; arr3.flat(2); // [1, 2, 3, 4, 5, 6] const arr4 = [1, 2, [3, 4, [5, 6, [7, 8, [9, 10]]]]]; arr4.flat(infinity); // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] flattening and array holes the flat method removes empty slots in arrays: const arr5 = [1, 2, , 4, 5]; arr5.flat(); // [1, 2, 4, 5] specifications specification ecmascript (ecma-262)the definition of 'array.prototype.flat' in that specification.
Array.prototype.keys() - JavaScript
examples key iterator doesn't ignore holes var arr = ['a', , 'c']; var sparsekeys = object.keys(arr); var densekeys = [...arr.keys()]; console.log(sparsekeys); // ['0', '2'] console.log(densekeys); // [0, 1, 2] specifications specification ecmascript (ecma-262)the definition of 'array.prototype.keys' in that specification.
Array.prototype.reverse() - JavaScript
const a = {0: 1, 1: 2, 2: 3, length: 3}; console.log(a); // {0: 1, 1: 2, 2: 3, length: 3} array.prototype.reverse.call(a); //same syntax for using apply() console.log(a); // {0: 3, 1: 2, 2: 1, length: 3} specifications specification ecmascript (ecma-262)the definition of 'array.prototype.reverse' in that specification.
Array.prototype.sort() - JavaScript
specifications specification ecmascript (ecma-262)the definition of 'array.prototype.sort' in that specification.
Array.prototype.splice() - JavaScript
emoved = myfish.splice(-2, 1) // myfish is ["angel", "clown", "sturgeon"] // removed is ["mandarin"] remove all elements from index 2 let myfish = ['angel', 'clown', 'mandarin', 'sturgeon'] let removed = myfish.splice(2) // myfish is ["angel", "clown"] // removed is ["mandarin", "sturgeon"] specifications specification ecmascript (ecma-262)the definition of 'array.prototype.splice' in that specification.
Array.prototype.unshift() - JavaScript
arr.unshift(-2, -1) // the new array length is 5 // arr is [-2, -1, 0, 1, 2] arr.unshift([-4, -3]) // the new array length is 6 // arr is [[-4, -3], -2, -1, 0, 1, 2] arr.unshift([-7, -6], [-5]) // the new array length is 8 // arr is [ [-7, -6], [-5], [-4, -3], -2, -1, 0, 1, 2 ] specifications specification ecmascript (ecma-262)the definition of 'array.prototype.unshift' in that specification.
ArrayBuffer.prototype.byteLength - JavaScript
examples using bytelength var buffer = new arraybuffer(8); buffer.bytelength; // 8 specifications specification ecmascript (ecma-262)the definition of 'arraybuffer.prototype.bytelength' in that specification.
ArrayBuffer.prototype.slice() - JavaScript
examples copying an arraybuffer const buf1 = new arraybuffer(8); const buf2 = buf1.slice(0); specifications specification ecmascript (ecma-262)the definition of 'arraybuffer.prototype.slice' in that specification.
BigInt.prototype.valueOf() - JavaScript
examples using valueof typeof object(1n); // object typeof object(1n).valueof(); // bigint specifications specification ecmascript (ecma-262)the definition of 'bigint.prototype.valueof()' in that specification.
DataView.prototype.buffer - JavaScript
examples using the buffer property var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.buffer; // arraybuffer { bytelength: 8 } specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.buffer' in that specification.
DataView.prototype.byteLength - JavaScript
view.bytelength; // 8 (matches the bytelength of the buffer) var dataview2 = new dataview(buffer, 1, 5); dataview2.bytelength; // 5 (as specified when constructing the dataview) var dataview3 = new dataview(buffer, 2); dataview3.bytelength; // 6 (due to the offset of the constructed dataview) specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.bytelength' in that specification.
DataView.prototype.byteOffset - JavaScript
examples using the byteoffset property var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.byteoffset; // 0 (no offset specified) var dataview2 = new dataview(buffer, 3); dataview2.byteoffset; // 3 (as specified when constructing the dataview) specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.byteoffset' in that specification.
DataView.prototype.getBigInt64() - JavaScript
examples using the getbigint64 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getbigint64(0); // 0n specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getbigint64()' in that specification.
DataView.prototype.getBigUint64() - JavaScript
examples using the getbiguint64 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getbiguint64(0); // 0n specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getbiguint64()' in that specification.
DataView.prototype.getFloat32() - JavaScript
examples using the getfloat32 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getfloat32(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getfloat32' in that specification.
DataView.prototype.getFloat64() - JavaScript
examples using the getfloat64 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getfloat64(0); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getfloat64' in that specification.
DataView.prototype.getInt16() - JavaScript
examples using the getint16 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getint16(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getint16' in that specification.
DataView.prototype.getInt32() - JavaScript
examples using the getint32 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getint32(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getint32' in that specification.
DataView.prototype.getInt8() - JavaScript
examples using the getint8 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getint8(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getint8' in that specification.
DataView.prototype.getUint16() - JavaScript
examples using the getuint16 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getuint16(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getuint16' in that specification.
DataView.prototype.getUint32() - JavaScript
examples using the getuint32 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getuint32(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getuint32' in that specification.
DataView.prototype.getUint8() - JavaScript
examples using the getuint8 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getuint8(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getuint8' in that specification.
DataView.prototype.setBigInt64() - JavaScript
examples using the setbigint64 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setbigint64(0, 3n); dataview.getbigint64(0); // 3n specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.setbigint64()' in that specification.
DataView.prototype.setBigUint64() - JavaScript
examples using the setbiguint64 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setbiguint64(0, 3n); dataview.getbiguint64(0); // 3n specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.setbiguint64()' in that specification.
DataView.prototype.setFloat32() - JavaScript
examples using the setfloat32 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setfloat32(1, 3); dataview.getfloat32(1); // 3 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.setfloat32' in that specification.
DataView.prototype.setFloat64() - JavaScript
examples using the setfloat64 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setfloat64(0, 3); dataview.getfloat64(0); // 3 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.setfloat64' in that specification.
DataView.prototype.setInt16() - JavaScript
examples using the setint16 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setint16(1, 3); dataview.getint16(1); // 3 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.setint16' in that specification.
DataView.prototype.setInt32() - JavaScript
examples using the setint32 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setint32(1, 3); dataview.getint32(1); // 3 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.setint32' in that specification.
DataView.prototype.setInt8() - JavaScript
examples using the setint8 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setint8(1, 3); dataview.getint8(1); // 3 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.setint8' in that specification.
DataView.prototype.setUint16() - JavaScript
examples using the setuint16 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setuint16(1, 3); dataview.getuint16(1); // 3 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.setuint16' in that specification.
DataView.prototype.setUint32() - JavaScript
examples using the setuint32 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setuint32(1, 3); dataview.getuint32(1); // 3 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.setuint32' in that specification.
DataView.prototype.setUint8() - JavaScript
examples using the setuint8 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setuint8(1, 3); dataview.getuint8(1); // 3 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.setuint8' in that specification.
Date.prototype.getDate() - JavaScript
var xmas95 = new date('december 25, 1995 23:15:30'); var day = xmas95.getdate(); console.log(day); // 25 specifications specification ecmascript (ecma-262)the definition of 'date.prototype.getdate' in that specification.
Date.prototype.getFullYear() - JavaScript
var today = new date(); var year = today.getfullyear(); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.getfullyear' in that specification.
Date.prototype.getHours() - JavaScript
let xmas95 = new date('december 25, 1995 23:15:30'); let hours = xmas95.gethours(); console.log(hours); // 23 specifications specification ecmascript (ecma-262)the definition of 'date.prototype.gethours' in that specification.
Date.prototype.getMilliseconds() - JavaScript
examples using getmilliseconds() the following example assigns the milliseconds portion of the current time to the variable milliseconds: var today = new date(); var milliseconds = today.getmilliseconds(); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.getmilliseconds' in that specification.
Date.prototype.getMinutes() - JavaScript
var xmas95 = new date('december 25, 1995 23:15:30'); var minutes = xmas95.getminutes(); console.log(minutes); // 15 specifications specification ecmascript (ecma-262)the definition of 'date.prototype.getminutes' in that specification.
Date.prototype.getMonth() - JavaScript
using this method, internationalization is made easier: var options = { month: 'long'}; console.log(new intl.datetimeformat('en-us', options).format(xmas95)); // december console.log(new intl.datetimeformat('de-de', options).format(xmas95)); // dezember specifications specification ecmascript (ecma-262)the definition of 'date.prototype.getmonth' in that specification.
Date.prototype.getSeconds() - JavaScript
var xmas95 = new date('december 25, 1995 23:15:30'); var seconds = xmas95.getseconds(); console.log(seconds); // 30 specifications specification ecmascript (ecma-262)the definition of 'date.prototype.getseconds' in that specification.
Date.prototype.getTime() - JavaScript
var end, start; start = new date(); for (var i = 0; i < 1000; i++) { math.sqrt(i); } end = new date(); console.log('operation took ' + (end.gettime() - start.gettime()) + ' msec'); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.gettime' in that specification.
Date.prototype.getTimezoneOffset() - JavaScript
imezoneoffset() / 60; // 1 // get timezone offset for international labour day (may 1) in 2016 // be careful, the date() constructor uses 0-indexed months, so may is // represented with 4 (and not 5) let labourday = new date(2016, 4, 1) let labourdayoffset = labourday.gettimezoneoffset() / 60; specifications specification ecmascript (ecma-262)the definition of 'date.prototype.gettimezoneoffset' in that specification.
Date.prototype.getUTCDate() - JavaScript
var today = new date(); var day = today.getutcdate(); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.getutcdate' in that specification.
Date.prototype.getUTCDay() - JavaScript
var today = new date(); var weekday = today.getutcday(); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.getutcday' in that specification.
Date.prototype.getUTCFullYear() - JavaScript
var today = new date(); var year = today.getutcfullyear(); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.getutcfullyear' in that specification.
Date.prototype.getUTCHours() - JavaScript
var today = new date(); var hours = today.getutchours(); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.getutchours' in that specification.
Date.prototype.getUTCMilliseconds() - JavaScript
var today = new date(); var milliseconds = today.getutcmilliseconds(); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.getutcmilliseconds' in that specification.
Date.prototype.getUTCMinutes() - JavaScript
var today = new date(); var minutes = today.getutcminutes(); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.getutcminutes' in that specification.
Date.prototype.getUTCMonth() - JavaScript
var today = new date(); var month = today.getutcmonth(); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.getutcmonth' in that specification.
Date.prototype.getUTCSeconds() - JavaScript
var today = new date(); var seconds = today.getutcseconds(); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.getutcseconds' in that specification.
Date.prototype.getYear() - JavaScript
var xmas = new date('december 25, 2015 23:15:00'); xmas.setyear(95); var year = xmas.getyear(); // returns 95 specifications specification ecmascript (ecma-262)the definition of 'date.prototype.getyear' in that specification.
Date.prototype.setDate() - JavaScript
2) thebigday.setdate(32); // 1962-08-01 (1st of august 1962) thebigday.setdate(22); // 1962-08-22 (22th of august 1962) thebigday.setdate(0); // 1962-07-31 (31th of july 1962) thebigday.setdate(98); // 1962-10-06 (6th of october 1962) thebigday.setdate(-50); // 1962-08-11 (11th of august 1962) specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setdate' in that specification.
Date.prototype.setFullYear() - JavaScript
examples using setfullyear() var thebigday = new date(); thebigday.setfullyear(1997); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setfullyear' in that specification.
Date.prototype.setHours() - JavaScript
examples using sethours() var thebigday = new date(); thebigday.sethours(7); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.sethours' in that specification.
Date.prototype.setMilliseconds() - JavaScript
examples using setmilliseconds() var thebigday = new date(); thebigday.setmilliseconds(100); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setmilliseconds' in that specification.
Date.prototype.setMinutes() - JavaScript
examples using setminutes() var thebigday = new date(); thebigday.setminutes(45); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setminutes' in that specification.
Date.prototype.setMonth() - JavaScript
examples using setmonth() var thebigday = new date(); thebigday.setmonth(6); //watch out for end of month transitions var endofmonth = new date(2016, 7, 31); endofmonth.setmonth(1); console.log(endofmonth); //wed mar 02 2016 00:00:00 specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setmonth' in that specification.
Date.prototype.setSeconds() - JavaScript
examples using setseconds() var thebigday = new date(); thebigday.setseconds(30); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setseconds' in that specification.
Date.prototype.setTime() - JavaScript
examples using settime() var thebigday = new date('july 1, 1999'); var sameasbigday = new date(); sameasbigday.settime(thebigday.gettime()); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.settime' in that specification.
Date.prototype.setUTCDate() - JavaScript
examples using setutcdate() var thebigday = new date(); thebigday.setutcdate(20); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setutcdate' in that specification.
Date.prototype.setUTCFullYear() - JavaScript
examples using setutcfullyear() var thebigday = new date(); thebigday.setutcfullyear(1997); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setutcfullyear' in that specification.
Date.prototype.setUTCHours() - JavaScript
examples using setutchours() var thebigday = new date(); thebigday.setutchours(8); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setutchours' in that specification.
Date.prototype.setUTCMilliseconds() - JavaScript
examples using setutcmilliseconds() var thebigday = new date(); thebigday.setutcmilliseconds(500); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setutcmilliseconds' in that specification.
Date.prototype.setUTCMinutes() - JavaScript
examples using setutcminutes() var thebigday = new date(); thebigday.setutcminutes(43); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setutcminutes' in that specification.
Date.prototype.setUTCMonth() - JavaScript
examples using setutcmonth() var thebigday = new date(); thebigday.setutcmonth(11); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setutcmonth' in that specification.
Date.prototype.setUTCSeconds() - JavaScript
examples using setutcseconds() var thebigday = new date(); thebigday.setutcseconds(20); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setutcseconds' in that specification.
Date.prototype.setYear() - JavaScript
var thebigday = new date(); thebigday.setyear(96); thebigday.setyear(1996); thebigday.setyear(2000); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setyear' in that specification.
Date.prototype.toDateString() - JavaScript
specifications specification ecmascript (ecma-262)the definition of 'date.prototype.todatestring' in that specification.
Date.prototype.toGMTString() - JavaScript
use toutcstring() console.log(str); // mon, 18 dec 1995 17:28:35 gmt specifications specification ecmascript (ecma-262)the definition of 'date.prototype.togmtstring' in that specification.
Date.prototype.toJSON() - JavaScript
examples using tojson() var jsondate = (new date()).tojson(); var backtodate = new date(jsondate); console.log(jsondate); //2015-10-26t07:46:36.611z specifications specification ecmascript (ecma-262)the definition of 'date.prototype.tojson' in that specification.
Date.prototype.toTimeString() - JavaScript
examples a basic usage of totimestring() var d = new date(1993, 6, 28, 14, 39, 7); console.log(d.tostring()); // wed jul 28 1993 14:39:07 gmt-0600 (pdt) console.log(d.totimestring()); // 14:39:07 gmt-0600 (pdt) specifications specification ecmascript (ecma-262)the definition of 'date.prototype.totimestring' in that specification.
Date.prototype.toUTCString() - JavaScript
examples using toutcstring() let today = new date('wed, 14 jun 2017 00:00:00 pdt'); let utcstring = today.toutcstring(); // wed, 14 jun 2017 07:00:00 gmt specifications specification ecmascript (ecma-262)the definition of 'date.prototype.toutcstring' in that specification.
Error.prototype.stack - JavaScript
<!doctype html> <meta charset="utf-8"> <title>stack trace example</title> <body> <script> function trace() { try { throw new error('myerror'); } catch(e) { alert(e.stack); } } function b() { trace(); } function a() { b(3, 4, '\n\n', undefined, {}); } a('first call, firstarg'); </script> assuming the above markup is saved as c:\example.html on a windows file system it produces an alert...
FinalizationRegistry.prototype.register() - JavaScript
r(target, "some value", target); the following registers the target object referenced by target, passing in another object as the held value, and not passing in any unregistration token (which means target can't be unregistered): registry.register(target, {"useful": "info about target"}); specifications specification weakrefsthe definition of 'finalizationregistry.prototype.register' in that specification.
FinalizationRegistry.prototype.unregister() - JavaScript
*/ release() { if (this.#file) { this.#registry.unregister(this.#file); // ^^^^^^^^^^−−−−− unregister token file.close(this.#file); this.#file = null; } } } specifications specification weakrefsthe definition of 'finalizationregistry.prototype.unregister' in that specification.
Function.prototype.call() - JavaScript
'use strict'; var sdata = 'wisen'; function display() { console.log('sdata value is %s ', this.sdata); } display.call(); // cannot read the property of 'sdata' of undefined specifications specification ecmascript (ecma-262)the definition of 'function.prototype.call' in that specification.
Generator.prototype.next() - JavaScript
function* gen() { while (true) { let value = yield null; console.log(value); } } const g = gen(); g.next(1); // "{ value: null, done: false }" g.next(2); // 2 // "{ value: null, done: false }" specifications specification ecmascript (ecma-262)the definition of 'generator.prototype.next' in that specification.
Generator.prototype.return() - JavaScript
ield 2; yield 3; } const g = gen(); g.next(); // { value: 1, done: false } g.next(); // { value: 2, done: false } g.next(); // { value: 3, done: false } g.next(); // { value: undefined, done: true } g.return(); // { value: undefined, done: true } g.return(1); // { value: 1, done: true } specifications specification ecmascript (ecma-262)the definition of 'generator.prototype.return' in that specification.
Generator.prototype.throw() - JavaScript
function* gen() { while(true) { try { yield 42; } catch(e) { console.log('error caught!'); } } } const g = gen(); g.next(); // { value: 42, done: false } g.throw(new error('something went wrong')); // "error caught!" // { value: 42, done: false } specifications specification ecmascript (ecma-262)the definition of 'generator.prototype.throw' in that specification.
Intl​.ListFormat.prototype​.format() - JavaScript
const list = ['motorcycle', 'bus', 'car']; console.log(new intl.listformat('en-gb', { style: 'long', type: 'conjunction' }).format(list)); // > motorcycle, bus and car console.log(new intl.listformat('en-gb', { style: 'short', type: 'disjunction' }).format(list)); // > motorcycle, bus or car console.log(new intl.listformat('en-gb', { style: 'narrow', type: 'unit' }).format(list)); // > motorcycle bus car specifications specification intl.listformatthe definition of 'form...
Intl.Locale.prototype.baseName - JavaScript
the intl.locale.prototype.basename property returns a substring of the locale's string representation, containing core information about the locale.
Intl.Locale.prototype.language - JavaScript
the intl.locale.prototype.language property is an accessor property that returns the language associated with the locale.
Intl.Locale.prototype.maximize() - JavaScript
the intl.locale.prototype.maximize() method gets the most likely values for the language, script, and region of the locale based on existing values.
Intl.Locale.prototype.minimize() - JavaScript
the intl.locale.prototype.minimize() method attempts to remove information about the locale that would be added by calling locale.maximize().
Intl.Locale.prototype.region - JavaScript
the intl.locale.prototype.region property is an accessor property that returns the region of the world (usually a country) associated with the locale.
Intl.Locale.prototype.script - JavaScript
the intl.locale.prototype.script property is an accessor property which returns the script used for writing the particular language used in the locale.
Intl.RelativeTimeFormat.prototype.format() - JavaScript
the intl.relativetimeformat.prototype.format() method formats a value and unit according to the locale and formatting options of this relativetimeformat object.
Intl.RelativeTimeFormat.prototype.resolvedOptions() - JavaScript
the intl.relativetimeformat.prototype.resolvedoptions() method returns a new object with properties reflecting the locale and relative time formatting options computed during initialization of this relativetimeformat object.
Map.prototype[@@iterator]() - JavaScript
..of const mymap = new map() mymap.set('0', 'foo') mymap.set(1, 'bar') mymap.set({}, 'baz') for (const entry of mymap) { console.log(entry) } // ["0", "foo"] // [1, "bar"] // [{}, "baz"] for (const [key, value] of mymap) { console.log(`${key}: ${value}`) } // 0: foo // 1: bar // [object]: baz specifications specification ecmascript (ecma-262)the definition of 'map.prototype[@@iterator]()' in that specification.
Map.prototype[@@toStringTag] - JavaScript
property attributes of map.prototype[@@tostringtag] writable no enumerable no configurable yes syntax map[symbol.tostringtag] examples using tostringtag object.prototype.tostring.call(new map()) // "[object map]" specifications specification ecmascript (ecma-262)the definition of 'map.prototype[@@tostringtag]' in that specification.
Map.prototype.clear() - JavaScript
examples using clear() var mymap = new map(); mymap.set('bar', 'baz'); mymap.set(1, 'foo'); mymap.size; // 2 mymap.has('bar'); // true mymap.clear(); mymap.size; // 0 mymap.has('bar') // false specifications specification ecmascript (ecma-262)the definition of 'map.prototype.clear' in that specification.
Map.prototype.entries() - JavaScript
xamples using entries() let mymap = new map() mymap.set('0', 'foo') mymap.set(1, 'bar') mymap.set({}, 'baz') let mapiter = mymap.entries() console.log(mapiter.next().value) // ["0", "foo"] console.log(mapiter.next().value) // [1, "bar"] console.log(mapiter.next().value) // [object, "baz"] specifications specification ecmascript (ecma-262)the definition of 'map.prototype.entries' in that specification.
Map.prototype.forEach() - JavaScript
nt in an map object: function logmapelements(value, key, map) { console.log(`map.get('${key}') = ${value}`) } new map([['foo', 3], ['bar', {}], ['baz', undefined]]).foreach(logmapelements) // logs: // "map.get('foo') = 3" // "map.get('bar') = [object object]" // "map.get('baz') = undefined" specifications specification ecmascript (ecma-262)the definition of 'map.prototype.foreach' in that specification.
Map.prototype.get() - JavaScript
examples using get() let mymap = new map(); mymap.set('bar', 'foo'); mymap.get('bar'); // returns "foo" mymap.get('baz'); // returns undefined specifications specification ecmascript (ecma-262)the definition of 'map.prototype.get' in that specification.
Map.prototype.has() - JavaScript
examples using has() let mymap = new map() mymap.set('bar', "foo") mymap.has('bar') // returns true mymap.has('baz') // returns false specifications specification ecmascript (ecma-262)the definition of 'map.prototype.has' in that specification.
Map.prototype.keys() - JavaScript
examples using keys() var mymap = new map(); mymap.set('0', 'foo'); mymap.set(1, 'bar'); mymap.set({}, 'baz'); var mapiter = mymap.keys(); console.log(mapiter.next().value); // "0" console.log(mapiter.next().value); // 1 console.log(mapiter.next().value); // object specifications specification ecmascript (ecma-262)the definition of 'map.prototype.keys' in that specification.
Map.prototype.set() - JavaScript
mymap.set('bar', 'foo') .set(1, 'foobar') .set(2, 'baz'); specifications specification ecmascript (ecma-262)the definition of 'map.prototype.set' in that specification.
Map.prototype.size - JavaScript
examples using size var mymap = new map(); mymap.set('a', 'alpha'); mymap.set('b', 'beta'); mymap.set('g', 'gamma'); mymap.size // 3 specifications specification ecmascript (ecma-262)the definition of 'map.prototype.size' in that specification.
Map.prototype.values() - JavaScript
examples using values() var mymap = new map(); mymap.set('0', 'foo'); mymap.set(1, 'bar'); mymap.set({}, 'baz'); var mapiter = mymap.values(); console.log(mapiter.next().value); // "foo" console.log(mapiter.next().value); // "bar" console.log(mapiter.next().value); // "baz" specifications specification ecmascript (ecma-262)the definition of 'map.prototype.values' in that specification.
Number.prototype.valueOf() - JavaScript
examples using valueof let numobj = new number(10) console.log(typeof numobj) // object let num = numobj.valueof() console.log(num) // 10 console.log(typeof num) // number specifications specification ecmascript (ecma-262)the definition of 'number.prototype.valueof' in that specification.
Object.prototype.__defineGetter__() - JavaScript
mefive); // 5 standard-compliant ways // using the get operator var o = { get gimmefive() { return 5; } }; console.log(o.gimmefive); // 5 // using object.defineproperty var o = {}; object.defineproperty(o, 'gimmefive', { get: function() { return 5; } }); console.log(o.gimmefive); // 5 specifications specification ecmascript (ecma-262)the definition of 'object.prototype.__definegetter__()' in that specification.
Object.prototype.__defineSetter__() - JavaScript
e = 5; console.log(o.value); // undefined console.log(o.anothervalue); // 5 // using object.defineproperty var o = {}; object.defineproperty(o, 'value', { set: function(val) { this.anothervalue = val; } }); o.value = 5; console.log(o.value); // undefined console.log(o.anothervalue); // 5 specifications specification ecmascript (ecma-262)the definition of 'object.prototype.__definesetter__()' in that specification.
Object.prototype.__lookupSetter__() - JavaScript
y setter var obj = { set foo(value) { this.bar = value; } }; // non-standard and deprecated way obj.__lookupsetter__('foo') // (function(value) { this.bar = value; }) // standard-compliant way object.getownpropertydescriptor(obj, 'foo').set; // (function(value) { this.bar = value; }) specifications specification ecmascript (ecma-262)the definition of 'object.prototype.__lookupsetter__()' in that specification.
RegExp.prototype.compile() - JavaScript
var regexobj = new regexp('foo', 'gi'); regexobj.compile('new foo', 'g'); specifications specification ecmascript (ecma-262)the definition of 'regexp.prototype.compile' in that specification.
Set.prototype[@@iterator]() - JavaScript
symbol.iterator](); console.log(setiter.next().value); // "0" console.log(setiter.next().value); // 1 console.log(setiter.next().value); // object using [@@iterator]() with for..of const myset = new set(); myset.add('0'); myset.add(1); myset.add({}); for (const v of myset) { console.log(v); } specifications specification ecmascript (ecma-262)the definition of 'set.prototype[@@iterator]' in that specification.
Set.prototype.add() - JavaScript
examples using the add method var myset = new set(); myset.add(1); myset.add(5).add('some text'); // chainable console.log(myset); // set [1, 5, "some text"] specifications specification ecmascript (ecma-262)the definition of 'set.prototype.add' in that specification.
Set.prototype.clear() - JavaScript
examples using the clear method var myset = new set(); myset.add(1); myset.add('foo'); myset.size; // 2 myset.has('foo'); // true myset.clear(); myset.size; // 0 myset.has('bar') // false specifications specification ecmascript (ecma-262)the definition of 'set.prototype.clear' in that specification.
Set.prototype.delete() - JavaScript
setobj.foreach(function(point){ if (point.x > 10){ setobj.delete(point) } }) specifications specification ecmascript (ecma-262)the definition of 'set.prototype.delete' in that specification.
Set.prototype.entries() - JavaScript
examples using entries() var myset = new set(); myset.add('foobar'); myset.add(1); myset.add('baz'); var setiter = myset.entries(); console.log(setiter.next().value); // ["foobar", "foobar"] console.log(setiter.next().value); // [1, 1] console.log(setiter.next().value); // ["baz", "baz"] specifications specification ecmascript (ecma-262)the definition of 'set.prototype.entries' in that specification.
Set.prototype.forEach() - JavaScript
he following code logs a line for each element in a set object: function logsetelements(value1, value2, set) { console.log('s[' + value1 + '] = ' + value2); } new set(['foo', 'bar', undefined]).foreach(logsetelements); // logs: // "s[foo] = foo" // "s[bar] = bar" // "s[undefined] = undefined" specifications specification ecmascript (ecma-262)the definition of 'set.prototype.foreach' in that specification.
Set.prototype.has() - JavaScript
oo'); // returns true myset.has('bar'); // returns false var set1 = new set(); var obj1 = {'key1': 1}; set1.add(obj1); set1.has(obj1); // returns true set1.has({'key1': 1}); // returns false because they are different object references set1.add({'key1': 1}); // now set1 contains 2 entries specifications specification ecmascript (ecma-262)the definition of 'set.prototype.has' in that specification.
Set.prototype.size - JavaScript
examples using size var myset = new set(); myset.add(1); myset.add(5); myset.add('some text') myset.size; // 3 specifications specification ecmascript (ecma-262)the definition of 'set.prototype.size' in that specification.
Set.prototype.values() - JavaScript
examples using values() var myset = new set(); myset.add('foo'); myset.add('bar'); myset.add('baz'); var setiter = myset.values(); console.log(setiter.next().value); // "foo" console.log(setiter.next().value); // "bar" console.log(setiter.next().value); // "baz" specifications specification ecmascript (ecma-262)the definition of 'set.prototype.values' in that specification.
SharedArrayBuffer.prototype.byteLength - JavaScript
examples using bytelength var sab = new sharedarraybuffer(1024); sab.bytelength; // 1024 specifications specification ecmascript (ecma-262)the definition of 'sharedarraybuffer.prototype.bytelength' in that specification.
String.prototype[@@iterator]() - JavaScript
ole.log(striter.next().value); // "a" console.log(striter.next().value); // "\ud835\udc68" using [@@iterator]() with for..of var str = 'a\ud835\udc68b\ud835\udc69c\ud835\udc6a'; for (var v of str) { console.log(v); } // "a" // "\ud835\udc68" // "b" // "\ud835\udc69" // "c" // "\ud835\udc6a" specifications specification ecmascript (ecma-262)the definition of 'string.prototype[@@iterator]()' in that specification.
String.prototype.anchor() - JavaScript
examples using anchor() var mystring = 'table of contents'; document.body.innerhtml = mystring.anchor('contents_anchor'); will output the following html: <a name="contents_anchor">table of contents</a> specifications specification ecmascript (ecma-262)the definition of 'string.prototype.anchor' in that specification.
String.prototype.big() - JavaScript
; // <big>hello, world</big> console.log(worldstring.fontsize(7)); // <fontsize=7>hello, world</fontsize> with the element.style object you can get the element's style attribute and manipulate it more generically, for example: document.getelementbyid('yourelemid').style.fontsize = '2em'; specifications specification ecmascript (ecma-262)the definition of 'string.prototype.big' in that specification.
String.prototype.blink() - JavaScript
string: var worldstring = 'hello, world'; console.log(worldstring.blink()); // <blink>hello, world</blink> console.log(worldstring.bold()); // <b>hello, world</b> console.log(worldstring.italics()); // <i>hello, world</i> console.log(worldstring.strike()); // <strike>hello, world</strike> specifications specification ecmascript (ecma-262)the definition of 'string.prototype.blink' in that specification.
String.prototype.bold() - JavaScript
string: var worldstring = 'hello, world'; console.log(worldstring.blink()); // <blink>hello, world</blink> console.log(worldstring.bold()); // <b>hello, world</b> console.log(worldstring.italics()); // <i>hello, world</i> console.log(worldstring.strike()); // <strike>hello, world</strike> specifications specification ecmascript (ecma-262)the definition of 'string.prototype.bold' in that specification.
String.prototype.charAt() - JavaScript
} if (idx >= end || idx < 0) { return '' } ret += str.charat(idx) if (/[\ud800-\udbff]/.test(ret) && /[\udc00-\udfff]/.test(str.charat(idx + 1))) { // go one further, since one of the "characters" is part of a surrogate pair ret += str.charat(idx + 1) } return ret } specifications specification ecmascript (ecma-262)the definition of 'string.prototype.charat' in that specification.
String.prototype.charCodeAt() - JavaScript
odeat(idx); var hi, low; if (0xd800 <= code && code <= 0xdbff) { hi = code; low = str.charcodeat(idx + 1); // go one further, since one of the "characters" // is part of a surrogate pair return ((hi - 0xd800) * 0x400) + (low - 0xdc00) + 0x10000; } return code; } specifications specification ecmascript (ecma-262)the definition of 'string.prototype.charcodeat' in that specification.
String.prototype.fixed() - JavaScript
examples using fixed() the following example uses the fixed method to change the formatting of a string: var worldstring = 'hello, world'; console.log(worldstring.fixed()); // "<tt>hello, world</tt>" specifications specification ecmascript (ecma-262)the definition of 'string.prototype.fixed' in that specification.
String.prototype.fontcolor() - JavaScript
red in hexadecimal in this line'); // '<font color="ff00">hello, world</font> is red in hexadecimal in this line' with the element.style object you can get the element's style attribute and manipulate it more generically, for example: document.getelementbyid('yourelemid').style.color = 'red'; specifications specification ecmascript (ecma-262)the definition of 'string.prototype.fontcolor' in that specification.
String.prototype.fontsize() - JavaScript
// <big>hello, world</big> console.log(worldstring.fontsize(7)); // <font size="7">hello, world</fontsize> with the element.style object you can get the element's style attribute and manipulate it more generically, for example: document.getelementbyid('yourelemid').style.fontsize = '0.7em'; specifications specification ecmascript (ecma-262)the definition of 'string.prototype.fontsize' in that specification.
String.prototype.italics() - JavaScript
f a string: var worldstring = 'hello, world'; console.log(worldstring.blink()); // <blink>hello, world</blink> console.log(worldstring.bold()); // <b>hello, world</b> console.log(worldstring.italics()); // <i>hello, world</i> console.log(worldstring.strike()); // <strike>hello, world</strike> specifications specification ecmascript (ecma-262)the definition of 'string.prototype.italics' in that specification.
String.prototype.lastIndexOf() - JavaScript
logs 8 console.log('the index of the first w from the end is ' + anystring.lastindexof('w')); // logs 10 console.log('the index of "new" from the beginning is ' + anystring.indexof('new')); // logs 6 console.log('the index of "new" from the end is ' + anystring.lastindexof('new')); // logs 6 specifications specification ecmascript (ecma-262)the definition of 'string.prototype.lastindexof' in that specification.
String.prototype.link() - JavaScript
var hottext = 'mdn'; var url = 'https://developer.mozilla.org/'; console.log('click to return to ' + hottext.link(url)); // click to return to <a href="https://developer.mozilla.org/">mdn</a> specifications specification ecmascript (ecma-262)the definition of 'string.prototype.link' in that specification.
String.prototype.normalize() - JavaScript
ibly-composed (nfkc) // u+1e69: latin small letter s with dot below and dot above str.normalize('nfkc'); // '\u1e69' // compatibly-decomposed (nfkd) // u+0073: latin small letter s // u+0323: combining dot below // u+0307: combining dot above str.normalize('nfkd'); // '\u0073\u0323\u0307' specifications specification ecmascript (ecma-262)the definition of 'string.prototype.normalize' in that specification.
String.prototype.padEnd() - JavaScript
examples using padend 'abc'.padend(10); // "abc " 'abc'.padend(10, "foo"); // "abcfoofoof" 'abc'.padend(6, "123456"); // "abc123" 'abc'.padend(1); // "abc" specifications specification ecmascript (ecma-262)the definition of 'string.prototype.padend' in that specification.
String.prototype.padStart() - JavaScript
// "abc" fixed width string number conversion // javascript version of: (unsigned) // printf "%0*d" width num function leftfillnum(num, targetlength) { return num.tostring().padstart(targetlength, 0); } const num = 123; console.log(leftfillnum(num, 5)); // expected output: "00123" specifications specification ecmascript (ecma-262)the definition of 'string.prototype.padstart' in that specification.
String.prototype.replace() - JavaScript
function f2c(x) { function convert(str, p1, offset, s) { return ((p1 - 32) * 5/9) + 'c'; } let s = string(x); let test = /(-?\d+(?:\.\d*)?)f\b/g; return s.replace(test, convert); } specifications specification ecmascript (ecma-262)the definition of 'string.prototype.replace' in that specification.
String.prototype.slice() - JavaScript
console.log(str.slice(-5, -1)) // => "n us" specifications specification ecmascript (ecma-262)the definition of 'string.prototype.slice' in that specification.
String.prototype.small() - JavaScript
// <big>hello, world</big> console.log(worldstring.fontsize(7)); // <font size="7">hello, world</fontsize> with the element.style object you can get the element's style attribute and manipulate it more generically, for example: document.getelementbyid('yourelemid').style.fontsize = '0.7em'; specifications specification ecmascript (ecma-262)the definition of 'string.prototype.small' in that specification.
String.prototype.split() - JavaScript
specifications specification ecmascript (ecma-262)the definition of 'string.prototype.split' in that specification.
String.prototype.strike() - JavaScript
of a string: var worldstring = 'hello, world'; console.log(worldstring.blink()); // <blink>hello, world</blink> console.log(worldstring.bold()); // <b>hello, world</b> console.log(worldstring.italics()); // <i>hello, world</i> console.log(worldstring.strike()); // <strike>hello, world</strike> specifications specification ecmascript (ecma-262)the definition of 'string.prototype.strike' in that specification.
String.prototype.sub() - JavaScript
specifications specification ecmascript (ecma-262)the definition of 'string.prototype.sub' in that specification.
String.prototype.sup() - JavaScript
r supertext = 'superscript'; var subtext = 'subscript'; console.log('this is what a ' + supertext.sup() + ' looks like.'); // "this is what a <sup>superscript</sup> looks like." console.log('this is what a ' + subtext.sub() + ' looks like.'); // "this is what a <sub>subscript</sub> looks like." specifications specification ecmascript (ecma-262)the definition of 'string.prototype.sup' in that specification.
String.prototype.toLowerCase() - JavaScript
examples using tolowercase() console.log('alphabet'.tolowercase()); // 'alphabet' specifications specification ecmascript (ecma-262)the definition of 'string.prototype.tolowercase' in that specification.
WeakMap.prototype.delete() - JavaScript
specifications specification ecmascript (ecma-262)the definition of 'weakmap.prototype.delete' in that specification.
WeakMap.prototype.get() - JavaScript
specifications specification ecmascript (ecma-262)the definition of 'weakmap.prototype.get' in that specification.
WeakMap.prototype.has() - JavaScript
examples using the has method var wm = new weakmap(); wm.set(window, 'foo'); wm.has(window); // returns true wm.has('baz'); // returns false specifications specification ecmascript (ecma-262)the definition of 'weakmap.prototype.has' in that specification.
WeakMap.prototype.set() - JavaScript
examples using the set method var wm = new weakmap(); var obj = {}; // add new elements to the weakmap wm.set(obj, 'foo').set(window, 'bar'); // chainable // update an element in the weakmap wm.set(obj, 'baz'); specifications specification ecmascript (ecma-262)the definition of 'weakmap.prototype.set' in that specification.
WeakRef.prototype.deref() - JavaScript
= () => { // get the element from the weak reference, if it still exists const element = this.ref.deref(); if (element) { element.textcontent = ++this.count; } else { // the element doesn't exist anymore console.log("the element is gone."); this.stop(); this.ref = null; } }; specifications specification weakrefsthe definition of 'weakref.prototype.deref()' in that specification.
WeakSet.prototype.add() - JavaScript
examples using add var ws = new weakset(); ws.add(window); // add the window object to the weakset ws.has(window); // true // weakset only takes objects as arguments ws.add(1); // results in "typeerror: invalid value used in weak set" in chrome // and "typeerror: 1 is not a non-null object" in firefox specifications specification ecmascript (ecma-262)the definition of 'weakset.prototype.add' in that specification.
WeakSet.prototype.delete() - JavaScript
specifications specification ecmascript (ecma-262)the definition of 'weakset.prototype.delete' in that specification.
WeakSet.prototype.has() - JavaScript
examples using the has method var ws = new weakset(); var obj = {}; ws.add(window); myset.has(window); // returns true myset.has(obj); // returns false specifications specification ecmascript (ecma-262)the definition of 'weakset.prototype.has' in that specification.
WebAssembly.Instance.prototype.exports - JavaScript
the exports readonly property of the webassembly.instance object prototype returns an object containing as its members all the functions exported from the webassembly module instance, to allow them to be accessed and used by javascript.
WebAssembly.Memory.prototype.buffer - JavaScript
the buffer prototype property of the webassembly.memory object returns the buffer contained in the memory.
WebAssembly.Table.prototype.grow() - JavaScript
the grow() prototype method of the webassembly.table object increases the size of the table instance by a specified number of elements.
WebAssembly.Table.prototype.length - JavaScript
the length prototype property of the webassembly.table object returns the length of the table, i.e.
Index - Web APIs
WebAPIIndex
below is a list of all the apis and interfaces (object types) that you may be able to use while developing your web app or site.
... 2 angle_instanced_arrays api, reference, webgl, webgl extension the angle_instanced_arrays extension is part of the webgl api and allows to draw the same object, or groups of similar objects multiple times, if they share the same vertex data, primitive count and type.
... 16 abstractrange api, abstract, abstract interface, abstractrange, dom, dom api, interface, range, reference the abstractrange abstract interface is the base class upon which all dom range types are defined.
...And 393 more matches
Index - Archive of obsolete content
37 two types of scripts no summary!
... 91 lang/type functions for working with type detection.
... 186 finding window handles add-ons, code snippets, extensions, xpcom, js-ctypes no summary!
...And 130 more matches
Textbox (XPFE autocomplete) - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is created by setting the type attribute of a textbox to autocomplete.
... it is used to create a textbox with a popup containing a list of possible completions for what the user has started to type.
...tches, ignoreblurwhilesearching, 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...
...And 115 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
WebHTMLElementinput
the html <input> element is used to create interactive controls for web-based forms in order to accept data from the user; a wide variety of types of input data and control widgets are available, depending on the device and user agent.
... the <input> element is one of the most powerful and complex in all of html due to the sheer number of combinations of input types and attributes.
... <input> types how an <input> works varies considerably depending on the value of its type attribute, hence the different types are covered in their own separate reference pages.
...And 115 more matches
Index
26 js::autovectorrooter jsapi reference, reference, référence(2), spidermonkey js::autovectorrooter<t> holds a variable-size rooted array of type t.
... 27 js::booleanvalue jsapi reference, reference, référence(2), spidermonkey js::booleanvalue converts a c boolean of type bool to js::value, the type of javascript values.
... 39 js::doublenanvalue jsapi reference, reference, référence(2), spidermonkey js::doublenanvalue returns a value of type js::value that represents an ieee floating-point quiet not-a-number (nan).
...And 111 more matches
WebIDL bindings
if your interface does inherit from another interface, just inherit from the c++ type that the other interface corresponds to.
...the return type of getparentobject doesn't matter other than it must either singly-inherit from nsisupports or have a corresponding tosupports method that can produce an nsisupports from it.
... the actual type returned from getparentobject must be defined in a header included from your implementation header, so that this type's definition is visible to the binding code.
...And 91 more matches
textbox (Toolkit autocomplete) - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is created by setting the type attribute of the textbox to autocomplete.
... it is used to create a textbox with a popup containing a list of possible completions for what the user has started to type.
... completeselectedindex,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, t...
...And 83 more matches
Index
the common structure to store such an untyped block is secitem, which contains a size and an untyped c pointer variable.
...jss also provides a pure java interface for asn.1 types and ber/der encoding.
... /* nspr headers */ #include <prprf.h> #include <prtypes.h> #include <plgetopt.h> #include <prio.h> #include <prprf.h> /* nss headers */ #include <secoid.h> #include <secmodt.h> #include <sechash.h> typedef struct { const char *hashname; secoidtag oid; } nametagpair; /* the hash algorithms supported */ static const nametagpair hash_names[] = { { "md2", sec_oid_md2 }, { "md5", sec_oid_md5 }, { "sha1", sec_oid_s...
...And 77 more matches
Parser API
example: > var expr = reflect.parse("obj.foo + 42").body[0].expression > expr.left.property ({loc:null, type:"identifier", name:"foo"}) > expr.right ({loc:{source:null, start:{line:1, column:10}, end:{line:1, column:12}}, type:"literal", value:42}) it is also 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...
... target string default: script a type of the parsing target, can be either script or module.
... node objects by default, reflect.parse() produces node objects, which are plain javascript objects (i.e., their prototype derives from the standard object prototype).
...And 77 more matches
textbox - Archive of obsolete content
attributes cols, decimalplaces, disabled, emptytext, hidespinbuttons, increment, label, max, maxlength, min, multiline, newlines, onblur, onchange, onfocus, oninput, placeholder, preference, readonly, rows, searchbutton, size, spellcheck, tabindex, timeout, type, value, wrap, wraparound properties accessibletype, clickselectsall, decimalplaces, decimalsymbol, defaultvalue, disabled, editor, emptytext, increment, inputfield, label, max, maxlength, min, placeholder, readonly, searchbutton, selectionend, selectionstart, size, spinbuttons, tabindex, textlength, timeout, type, value, valuenumber, wraparound methods decrease, increase, reset, select,...
... setselectionrange style classes plain examples <vbox> <label control="your-name" value="enter your name:"/> <textbox id="your-name" value="john"/> </vbox> attributes cols type: integer for multiline textboxes, the number of columns to display.
... decimalplaces type: integer the number of decimal places to display.
...And 70 more matches
Index - Archive of obsolete content
ArchiveMozillaXULIndex
this is a special type of button which is drawn differently.
... 4 accessibility/xul accessibility reference accessibility, xul this table is designed to show how to expose text properly for various xul element types.
... 30 browser.type xul attributes, xul reference type: one of the values below.the type of browser, which can be used to set access of the document loaded inside the browser.
...And 67 more matches
tabbrowser - Archive of obsolete content
backgroup, goforward, goforwardgroup, gohome, gotoindex, loadgroup, loadonetab, loadtabs, loaduri, loaduriwithflags, movetabto, pintab, reload, reloadalltabs, reloadtab, reloadwithflags, removealltabsbut, removecurrenttab, removeprogresslistener, removetab, removetabsprogresslistener,replacegroup, selecttabatindex, seticon, showonlythesetabs, stop, unpintab attributes autocompleteenabled type: boolean set to true to enable autocomplete of fields.
... autocompletepopup type: id the id of a popup element used to hold autocomplete results for the element.
... autoscroll type: boolean set to false to disable autoscroll for this browser.
...And 67 more matches
nsIAnnotationService
string aname, in double avalue, in long aflags, in unsigned short aexpiration); void setitemannotationdouble(in long long aitemid, in autf8string aname, in double avalue, in long aflags, in unsigned short aexpiration); void setpageannotationbinary(in nsiuri auri, in autf8string aname,[const, array, size_is(adatalen)] in octet adata, in unsigned long adatalen, in autf8string amimetype, in long aflags, in unsigned short aexpiration); void setitemannotationbinary(in long long aitemid, in autf8string aname,[const, array, size_is(adatalen)] in octet adata, in unsigned long adatalen, in autf8string amimetype, in long aflags, in unsigned short aexpiration); nsivariant getpageannotation(in nsiuri auri, in autf8string aname); nsivariant getitemannotation(in ...
...getitemannotationint64(in long long aitemid, in autf8string aname); double getpageannotationdouble(in nsiuri auri, in autf8string aname); double getitemannotationdouble(in long long aitemid, in autf8string aname); void getpageannotationbinary(in nsiuri auri, in autf8string aname,[array, size_is(adatalen)] out octet adata, out unsigned long adatalen, out autf8string amimetype); void getitemannotationbinary(in long long aitemid, in autf8string aname,[array, size_is(adatalen)] out octet adata, out unsigned long adatalen, out autf8string amimetype); void getpageannotationinfo(in nsiuri auri, in autf8string aname, out print32 aflags, out unsigned short aexpiration, out autf8string amimetype, out unsigned short atype); void getitemannotationinfo(...
...in long long aitemid, in autf8string aname, out long aflags, out unsigned short aexpiration, out autf8string amimetype, out unsigned short atype); pruint16 getpageannotationtype(in nsiuri auri, in autf8string aname); pruint16 getitemannotationtype(in long long aitemid, in autf8string aname); void getpageswithannotation(in autf8string name, [optional] out unsigned long resultcount, [retval, array, size_is(resultcount)] out nsiuri results); void getitemswithannotation(in autf8string name, [optional] out unsigned long resultcount, [retval, array, size_is(resultcount)] out long long results); void getpageannotationnames(in nsiuri auri, [optional] out unsigned long count, [retval, array, size_is(count)] out nsivariant result); void getitemannota...
...And 62 more matches
Details of the object model - JavaScript
« previousnext » javascript is an object-based language based on prototypes, rather than being class-based.
...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 prototype-based language, such as javascript, does not make this distinction: it simply has objects.
...And 62 more matches
Plug-in Basics - Plugins
with the plug-in api, you can create dynamically loaded plug-ins that can: register one or more mime types draw into a part of a browser window receive keyboard and mouse events obtain data from the network using urls post data to urls add hyperlinks or hotspots that link to new urls draw into sections on an html page communicate with javascript/dom from native code you can see which plug-ins are installed on your system and have been properly associated with the browser by consulting the in...
...type "about:plugins" in the location bar.
... the installed plug-ins page lists each installed plug-in along with its mime type or types, description, file extensions, and the current state (enabled or disabled) of the plug-in for each mime type assigned to it.
...And 58 more matches
nsIContentPolicy - Archive of obsolete content
implementations of this interface can be used to control the loading of various types of out-of-line content, or the processing of certain types of inline content.
... method overview short shouldload(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetypeguess, in nsisupports aextra, in nsiprincipal arequestprincipal); short shouldprocess(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetype, in nsisupports aextra, in nsiprincipal arequestprincipal); cons...
...tants content types constant value description type_other 1 indicates content whose type is unknown, or is not interesting outside a limited use case.
...And 57 more matches
Bytecode Descriptions
typeof, typeofexpr stack: val ⇒ (typeof val) the typeof operator.
...the result is always a string that depends on the type of val.
... jsop::typeof and jsop::typeofexpr are the same except that--amazingly--jsop::typeof affects the behavior of an immediately preceding jsop::getname or jsop::getgname instruction!
...And 56 more matches
Uint8ClampedArray - JavaScript
the uint8clampedarray typed array represents an array of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the range of [0,255], 0 or 255 will be set instead; if you specify a non-integer, the nearest integer will be set.
...in the case of the uint8clampedarray type: "uint8clampedarray".
... instance properties uint8clampedarray.prototype.buffer returns the arraybuffer referenced by the uint8clampedarray fixed at construction time and thus read only.
...And 54 more matches
BigInt64Array - JavaScript
the bigint64array typed array represents an array of 64-bit signed integers in the platform byte order.
...in the case of the bigint64array type, this is "bigint64array".
... instance properties bigint64array.prototype.buffer returns the arraybuffer referenced by the bigint64array.
...And 53 more matches
BigUint64Array - JavaScript
the biguint64array typed array represents an array of 64-bit unsigned integers in the platform byte order.
...in the case of the biguint64array type this is "biguint64array".
... instance properties biguint64array.prototype.buffer returns the arraybuffer referenced by the biguint64array.
...And 53 more matches
Float32Array - JavaScript
the float32array typed array represents an array of 32-bit floating point numbers (corresponding to the c float data type) in the platform byte order.
...in the case of the float32array type: "float32array".
... instance properties float32array.prototype.buffer returns the arraybuffer referenced by the float32array fixed at construction time and thus read only.
...And 53 more matches
Float64Array - JavaScript
the float64array typed array represents an array of 64-bit floating point numbers (corresponding to the c double data type) in the platform byte order.
...in the case of the float64array type: "float64array".
... instance properties float64array.prototype.buffer returns the arraybuffer referenced by the float64array fixed at construction time and thus read only.
...And 53 more matches
Int16Array - JavaScript
the int16array typed array represents an array of twos-complement 16-bit signed integers in the platform byte order.
...in the case of the int16array type: "int16array".
... instance properties int16array.prototype.buffer returns the arraybuffer referenced by the int16array fixed at construction time and thus read only.
...And 53 more matches
Int32Array - JavaScript
the int32array typed array represents an array of twos-complement 32-bit signed integers in the platform byte order.
...in the case of the int32array type: "int32array".
... instance properties int32array.prototype.buffer returns the arraybuffer referenced by the int32array fixed at construction time and thus read only.
...And 53 more matches
Int8Array - JavaScript
the int8array typed array represents an array of twos-complement 8-bit signed integers.
...in the case of the int8array type: "int8array".
... instance properties int8array.prototype.buffer returns the arraybuffer referenced by the int8array fixed at construction time and thus read only.
...And 53 more matches
Uint16Array - JavaScript
the uint16array typed array represents an array of 16-bit unsigned integers in the platform byte order.
...in the case of the uint16array type: "uint16array".
... instance properties uint16array.prototype.buffer returns the arraybuffer referenced by the uint16array fixed at construction time and thus read only.
...And 53 more matches
Uint32Array - JavaScript
the uint32array typed array represents an array of 32-bit unsigned integers in the platform byte order.
...in the case of the uint32array type: "uint32array".
... instance properties uint32array.prototype.buffer returns the arraybuffer referenced by the uint32array fixed at construction time and thus read only.
...And 53 more matches
Uint8Array - JavaScript
the uint8array typed array represents an array of 8-bit unsigned integers.
...in the case of the uint8array type: "uint8array".
... instance properties uint8array.prototype.buffer returns the arraybuffer referenced by the uint8array fixed at construction time and thus read only.
...And 53 more matches
XUL element attributes - Archive of obsolete content
« xul reference home the following attributes are common to all xul elements: align type: one of the values below the align attribute specifies how child elements of the box are aligned, when the size of the box is larger than the total size of the children.
... allowevents type: boolean if true, events are passed to children of the element.
... allownegativeassertions type: boolean valid on any element that has a datasources attribute.
...And 48 more matches
Date - JavaScript
instance methods date.prototype.getdate() returns the day of the month (1–31) for the specified date according to local time.
... date.prototype.getday() returns the day of the week (0–6) for the specified date according to local time.
... date.prototype.getfullyear() returns the year (4 digits for 4-digit years) of the specified date according to local time.
...And 48 more matches
XPIDL
note: starting in gecko 9.0, the older xpidl utility, which was previously used to generate c++ header files, typelib information, and so forth has been replaced with pyxpidl in the gecko sdk.
... writing xpidl interface files xpidl closely resembles omg idl, with extended syntax to handle iids and additional types.
...at the top level, we can define typedefs, native types, or interfaces.
...And 47 more matches
StringView - Archive of obsolete content
the aims of this library are: to create a c-like interface for strings (i.e., an array of character codes — an arraybufferview in javascript) based upon the javascript arraybuffer interface to create a highly extensible library that anyone can extend by adding methods to the object stringview.prototype to create a collection of methods for such string-like objects (since now: stringviews) which work strictly on arrays of numbers rather than on creating new immutable javascript strings to work with unicode encodings other than javascript's default utf-16 domstrings introduction as web applications become more and more powerful, adding features such as audio and video manipulation, access to raw data using websockets, and so forth, it has become clear that there are times when...
... javascript typed arrays provide a mechanism for accessing raw binary data much more efficiently.
... the stringview constructor is one level above typed arrays.
...And 46 more matches
nsIMsgDBView
to create an instance, use: var dbview = components.classes[@mozilla.org/messenger/msgdbview;1?type=] .createinstance(components.interfaces.nsimsgdbview); where type designates different types of view's available.
... available in the mozilla codebase are types "quicksearch", "threadswithunread", "watchedthreadswithunread", "xfvf" (virtual folders), "search", "group", and "threaded" each with their own implementation of nsimsgdbview that provides a different sorting/view of the data.
... method overview void open(in nsimsgfolder folder, in nsmsgviewsorttypevalue sorttype, in nsmsgviewsortordervalue sortorder, in nsmsgviewflagstypevalue viewflags, out long count); void openwithhdrs(in nsisimpleenumerator aheaders, in nsmsgviewsorttypevalue asorttype, in nsmsgviewsortordervalue asortorder, in nsmsgviewflagstypevalue aviewflags, out long acount); void close(); void init(in nsimessenger amessengerinstance, in nsimsgwindow amsgwindow, in nsimsgdbviewcommandupdater acommandupdater); void sort(in nsmsgviewsorttypevalue sorttype, in nsmsgviewsortordervalue sortorder); void docommand(in nsmsgviewcommandtypevalue command); void docommandwithfolder(in nsmsgviewcommandtypevalue command, in nsimsgfolder destfolder); ...
...And 46 more matches
HTML documentation index - HTML: Hypertext Markup Language
WebHTMLIndex
16 dropzone deprecated, global attributes, html, reference the dropzone global attribute is an enumerated attribute indicating what types of content can be dropped on an element, using the html drag and drop api.
... 19 inputmode attribute, editing, forms, global attributes, html, input, reference, text, web, contenteditable, global, inputmode, text input the inputmode global attribute is an enumerated attribute that hints at the type of data that might be entered by the user while editing the element or its contents.
... 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.
...And 46 more matches
browser - Archive of obsolete content
attributes autocompleteenabled, autocompletepopup, autoscroll, disablehistory, disableglobalhistory, disablesecurity, droppedlinkhandler, homepage, showcaret, src, type properties accessibletype, cangoback, cangoforward, contentdocument, contentprincipal, contenttitle, contentvieweredit, contentviewerfile, contentwindow, currenturi, docshell, documentcharsetinfo, homepage, markupdocumentviewer, messagemanager, preferences, securityui, sessionhistory, webbrowserfind, webnavigation, webprogress methods addprogresslistener, goback, goforward, gohome, goto...
...index, loaduri, loaduriwithflags, reload, reloadwithflags, removeprogresslistener, stop, swapdocshells examples <!-- shows mozilla homepage inside a groupbox --> <groupbox flex="1"> <caption label="mozilla homepage"/> <browser type="content" src="http://www.mozilla.org" flex="1"/> </groupbox> attributes autocompleteenabled type: boolean set to true to enable autocomplete of fields.
... autocompletepopup type: id the id of a popup element used to hold autocomplete results for the element.
...And 45 more matches
Index
MozillaTechXPCOMIndex
8 generating guids add-ons, developing mozilla, developing_mozilla:tools, extensions, tools, xpcom guids are used in mozilla programming for identifying several types of entities, including xpcom interfaces (this type of guids is callled iid), components (cid), and legacy add-ons—like extensions and themes—that were created prior to firefox 1.5.
... 29 components.stack xpcom:language bindings, xpconnect components.stack is a read only property of type nsistackframe (idl definition) that represents a snapshot of the current javascript callstack.
... 95 xpcom category image-sniffing-services add-ons, extensions, needscontent in versions of firefox prior to firefox 3, extensions could add decoders for new image types.
...And 45 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
color.sethsv(h, s, v); return color; } function hsvacolor(h, s, v, a) { var color = new color(); color.sethsv(h, s, v); color.a = a; return color; } function hslcolor(h, s, l) { var color = new color(); color.sethsl(h, s, l); return color; } function hslacolor(h, s, l, a) { var color = new color(); color.sethsl(h, s, l); color.a = a; return color; } color.prototype.copy = function copy(obj) { if(obj instanceof color !== true) { console.log('typeof parameter not color'); return; } this.r = obj.r; this.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 setfo...
...rmat(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; this.r = red | 0; this.g = green | 0; this.b = blue | 0; if (this.isvalidrgbvalue(alpha) === true) this.a = alpha | 0; }; color.prototype.setbyname = function setbyname(name, value) { if (name === 'r' || name === 'g' || nam...
...e === 'b') { if(this.isvalidrgbvalue(value) === false) return; this[name] = value; this.updatehsx(); } }; color.prototype.sethsv = function sethsv(hue, saturation, value) { this.hue = hue; this.saturation = saturation; this.value = value; this.hsvtorgb(); }; color.prototype.sethsl = function sethsl(hue, saturation, lightness) { this.hue = hue; this.saturation = saturation; this.lightness = lightness; this.hsltorgb(); }; color.prototype.sethue = function sethue(value) { if (typeof(value) !== 'number' || isnan(value) === true || value < 0 || value > 359) return; this.hue = value; this.updatergb(); }; color.prototype.setsaturation = function setsaturation(value) { if (typeof(value) !== 'number' || isnan(value) === true || value < 0 || v...
...And 45 more matches
jspage - Archive of obsolete content
var mootools={version:"1.2.4",build:"0d9113241a90b9cd5643b926795852a2026710d4"};var native=function(k){k=k||{};var a=k.name;var i=k.legacy;var b=k.protect; var c=k.implement;var h=k.generics;var f=k.initialize;var g=k.afterimplement||function(){};var d=f||i;h=h!==false;d.constructor=native;d.$family={name:"native"}; if(i&&f){d.prototype=i.prototype;}d.prototype.constructor=d;if(a){var e=a.tolowercase();d.prototype.$family={name:e};native.typize(d,e);}var j=function(n,l,o,m){if(!b||m||!n.prototype[l]){n.prototype[l]=o; }if(h){native.genericize(n,l,b);}g.call(n,l,o);return n;};d.alias=function(n,l,p){if(typeof n=="string"){var o=this.prototype[n];if((n=o)){return j(this,l,n,p); }}for(var m in n){this.alias(m,n[m],l);}return this;};d.implement=function(m,l,o){if(typeof m=="string"){return...
... j(this,m,l,o);}for(var n in m){j(this,n,m[n],l); }return this;};if(c){d.implement(c);}return d;};native.genericize=function(b,c,a){if((!a||!b[c])&&typeof b.prototype[c]=="function"){b[c]=function(){var d=array.prototype.slice.call(arguments); return b.prototype[c].apply(d.shift(),d);};}};native.implement=function(d,c){for(var b=0,a=d.length;b<a;b++){d[b].implement(c);}};native.typize=function(a,b){if(!a.type){a.type=function(c){return($type(c)===b); };}};(function(){var a={array:array,date:date,function:function,number:number,regexp:regexp,string:string};for(var h in a){new native({name:h,initialize:a[h],protect:true}); }var d={"boolean":boolean,"native":native,object:object};for(var c in d){native.typize(d[c],c);}var f={array:["concat","indexof","join","lastindexof","pop","push","reverse","s...
...hift","slice","sort","splice","tostring","unshift","valueof"],string:["charat","charcodeat","concat","indexof","lastindexof","match","replace","search","slice","split","substr","substring","tolowercase","touppercase","valueof"]}; for(var e in f){for(var b=f[e].length;b--;){native.genericize(a[e],f[e][b],true);}}})();var hash=new native({name:"hash",initialize:function(a){if($type(a)=="hash"){a=$unlink(a.getclean()); }for(var b in a){this[b]=a[b];}return this;}});hash.implement({foreach:function(b,c){for(var a in this){if(this.hasownproperty(a)){b.call(c,this[a],a,this); }}},getclean:function(){var b={};for(var a in this){if(this.hasownproperty(a)){b[a]=this[a];}}return b;},getlength:function(){var b=0;for(var a in this){if(this.hasownproperty(a)){b++; }}return b;}});hash.alias("foreach","each"...
...And 44 more matches
listbox - Archive of obsolete content
attributes disabled, disablekeynavigation, preference, rows, seltype, suppressonselect, tabindex, value properties accessibletype, currentindex, currentitem, disabled, disablekeynavigation, itemcount, listboxobject, selectedcount, selectedindex, selecteditem, selecteditems, seltype, suppressonselect, tabindex, value methods additemtoselection, appenditem, clearselection, ensureelementisvisible, ensureindexisvisible, getindexoffirstvisiblerow, getindexofi...
... for (var i = 0; i < gems.length; i++) { var row = document.createelement('listitem'); var cell = document.createelement('listcell'); cell.setattribute('label', gems[i].gem); row.appendchild(cell); cell = document.createelement('listcell'); cell.setattribute('label', gems[i].price ); row.appendchild(cell); thelist.appendchild(row); } attributes disabled type: boolean indicates whether the element is disabled or not.
... disablekeynavigation type: boolean if this attribute is not used, the user can navigate to specific items within the element by pressing keys corresponding to letters in the item's label.
...And 44 more matches
toolbarbutton - Archive of obsolete content
attributes accesskey, autocheck, checkstate, checked, command, crop, dir, disabled, dlgtype, group, image, label, oncommand, open, orient, tabindex, title, type, validate properties accesskey, accessibletype, autocheck, checkstate, checked, command, crop, dir, disabled, dlgtype, group, image, label, open, orient, tabindex, type examples <toolbar id="test-toolbar"> <toolbarbutton accesskey="p" label="plain"/> <toolbarbutton accesskey="c" label="checkbox" type="checkbox"...
.../> <toolbarbutton accesskey="b" label="menu-button" type="menu-button"> <menupopup> <menuitem label="menu item 1"/> <menuitem label="menu item 2"/> </menupopup> </toolbarbutton> <toolbarbutton accesskey="m" label="menu" type="menu"> <menupopup> <menuitem label="menu item 1"/> <menuitem label="menu item 2"/> </menupopup> </toolbarbutton> </toolbar> <toolbar id="radio-toolbar"> <toolbarbutton accesskey="1" label="radio 1" type="radio" group="radiogroup"/> <toolbarbutton accesskey="2" label="radio 2" type="radio" group="radiogroup"/> <toolbarbutton accesskey="3" label="radio 3" type="radio" group="radiogroup"/> </toolbar> attributes accesskey type: character this should be set to a character that is used as a shortcut key.
... autocheck type: boolean if this attribute is true or left out, the checked state of the button will be switched each time the button is pressed.
...And 44 more matches
Add to iPhoto
this extension for mac os x serves as a demonstration of how to use js-ctypes to call mac os x carbon, core foundation, and other system frameworks from an extension written entirely in javascript.
...this extension uses a number of methods and data types, as well as constants, from three system frameworks.
... for the sake of organization, i chose to implement each system framework (and, mind you, i only declare the apis i actually use, not all of them) as a javascript object containing all the types and methods that framework's api.
...And 44 more matches
richlistbox - Archive of obsolete content
attributes disabled, disablekeynavigation, preference, seltype, suppressonselect, tabindex, value properties accessibletype, currentindex, currentitem, disabled, disablekeynavigation, itemcount, scrollboxobject, selectedcount, selectedindex, selecteditem, selecteditems, seltype, suppressonselect, tabindex, value methods additemtoselection, appenditem, clearselection, ensureelementisvisible, ensureindexisvisible, getindexoffirstvisiblerow, getindexo...
... attributes disabled type: boolean indicates whether the element is disabled or not.
... disablekeynavigation type: boolean if this attribute is not used, the user can navigate to specific items within the element by pressing keys corresponding to letters in the item's label.
...And 43 more matches
Working with data
creating cdata objects data types for use with js-ctypes are represented by ctype objects.
... these are javascript constructors; as such, they're callable functions that you can use to create new cdata objects of that type.
... creating uninitialized cdata objects there are three forms of the syntax for creating cdata objects without immediately assigning them a value: var mycdataobj = new type; var mycdataobj = new type(); var mycdataobj = type(); these all do the same thing: they return a new cdata object of the specified type, whose data buffer has been populated entirely with zeroes.
...And 43 more matches
button - Archive of obsolete content
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...
... autocheck type: boolean if this attribute is true or left out, the checked state of the button will be switched each time the button is pressed.
...when autocheck is true, the button type should be "checkbox" or "radio".
...And 41 more matches
Places utilities for JavaScript
these are: qi_node qi_node(anode, aiid) runs a query interface on a bookmark node to expose the interface available to that type.
...ode anode); boolean nodeislivemarkcontainer(nsinavhistoryresultnode anode); obsolete since gecko 21 boolean nodeislivemarkitem(nsinavhistoryresultnode anode); obsolete since gecko 21 boolean isreadonlyfolder(nsinavhistoryresultnode anode); int getindexofnode(nsinavhistoryresultnode anode); string wrapnode(nsinavhistoryresultnode anode, string atype, nsiuri aoverrideuri); array unwrapnodes(string blob, string atype); nsitransaction maketransaction(string data, string type, nsinavhistoryresultnode container, int index, boolean copy); nsinavhistoryresult getfoldercontents(int afolderid, boolean aexcludeitems, boolean aexpandqueries); boolean showaddbookmarkui(nsiuri auri, string atitle, string adescription, ...
... 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); getviewfornode(nsidomnode anode); void markpageastyped(string aurl); void markpageasfollowedbookmark(string aurl); boolean checkurlsecurity(nsinavhistoryresultnode aurinode); string getquerystringforfolder(int afolderid); string getdescriptionfromdocument(nsidomdocument doc); string setpostdataforbookmark(int aboomarkid, string apostdata); string getpostdataforbookmark(int aboomarkid); a...
...And 41 more matches
menulist - Archive of obsolete content
attributes accesskey, crop, disableautoselect, disabled, editable, focused, image, label, oncommand, open, preference, readonly, sizetopopup, tabindex, value properties accessibletype, crop, description, disableautoselect, disabled, editable, editor, image, inputfield, itemcount, label, menuboxobject, menupopup, open, selectedindex, selecteditem, tabindex, value methods appenditem, contains, getindexofitem, getitematindex, insertitemat, removeallitems, removeitemat, select examples <menulist> <menupopup> <menuitem label="option 1" value="1"/> <menuitem labe...
...l="option 2" value="2"/> <menuitem label="option 3" value="3"/> <menuitem label="option 4" value="4"/> </menupopup> </menulist> attributes accesskey type: character this should be set to a character that is used as a shortcut key.
... crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute.
...And 39 more matches
tree - Archive of obsolete content
ArchiveMozillaXULtree
tree type view interfaces has dom nodes?
...in this situation, a content view (which implements the interface nsitreecontentview) which is a more specialized type of view, uses the treeitem elements and their descendants to determine the data to display in the tree.
...this is the type that should be used for rdf generated trees with lots of rows.
...And 39 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
27 base64 advanced, base64, javascript, typed arrays, uri, url, unicode problem, atob(), btoa() base64 is a group of similar binary-to-text encoding schemes that represent binary data in an ascii string format by translating it into a radix-64 representation.
... 30 bigint bigint, glossary, javascript, reference, arbitrary precision format in javascript, bigint is a numeric data type that can represent integers in the arbitrary precision format.
... in other programming languages different numeric types can exist, for examples: integers, floats, doubles, or bignums.
...And 38 more matches
JavaScript Daemons Management - Archive of obsolete content
|*| http://www.gnu.org/licenses/gpl-3.0.html |*| \*/ "use strict"; /**************************** * the daemon system * ****************************/ /* the global "daemon" constructor */ function daemon (oowner, ftask, nrate, nlen, finit, fonstart) { if (!(this && this instanceof daemon)) { return; } if (arguments.length < 2) { throw new typeerror("daemon - not enough arguments"); } if (oowner) { this.owner = oowner }; this.task = ftask; if (isfinite(nrate) && nrate > 0) { this.rate = math.floor(nrate); } if (nlen > 0) { this.length = math.floor(nlen); } if (fonstart) { this.onstart = fonstart; } if (finit) { this.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!
... */ daemon.prototype; 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 ?
...And 37 more matches
Using XMLHttpRequest - Web APIs
function reqlistener () { console.log(this.responsetext); } var oreq = new xmlhttprequest(); oreq.addeventlistener("load", reqlistener); oreq.open("get", "http://www.example.org/example.txt"); oreq.send(); types of requests a request made via xmlhttprequest can fetch the data in one of two ways, asynchronously or synchronously.
... the type of request is dictated by the optional async argument (the third argument) that is set on the xmlhttprequest.open() method.
...a detailed discussion and demonstrations of these two types of requests can be found on the synchronous and asynchronous requests page.
...And 37 more matches
Box-shadow generator - CSS: Cascading Style Sheets
box-shadow generator html content <div id="container"> <div class="group section"> <div id="layer_manager"> <div class="group section"> <div class="button" data-type="add"> </div> <div class="button" data-type="move-up"> </div> <div class="button" data-type="move-down"> </div> </div> <div id="stack_container"></div> </div> <div id="preview_zone"> <div id="layer_menu" class="col span_12"> <div class="button" id="element" data-type="subject" data-title="element"> element </div> <div class="button" id="before" data-type="subject" da...
...ta-title=":before"> :before <span class="delete" data-type="disable"></span> </div> <div class="button" id="after" data-type="subject" data-title=":after"> :after <span class="delete" data-type="disable"></span> </div> <div class="ui-checkbox" data-topic='before' data-label=":before"></div> <div class="ui-checkbox" data-topic='after' data-label=":after"></div> </div> <div id="preview"> <div id="obj-element"> <div class="content"> </div> <div id="obj-before"> </div> <div id="obj-after"> </div> </div> </div> ...
... <div class="group property"> <div class="ui-slider-name"> inset </div> <div class="ui-checkbox" data-topic='inset'></div> </div> <div class="slidergroup"> <div class="ui-slider-name"> position x </div> <div class="ui-slider-btn-set" data-topic="posx" data-type="sub"></div> <div class="ui-slider" data-topic="posx" data-min="-500" data-max="500" data-step="1"> </div> <div class="ui-slider-btn-set" data-topic="posx" data-type="add"></div> <div class="ui-slider-input" data-topic="posx" data-unit="px"></div> </div> <div...
...And 37 more matches
AddonManager
one of the forces of the addonmanager is that it deals with any kind (type) of add-on in a generic manner.
... to do so many methods of the addonmanager take the add-on types as parameters.
... the existing add-on types are defined in xpiprovider.jsm and are, at this time, the following: extension, theme, locale, multipackage, dictionary and experiment.
...And 36 more matches
NSS API Guidelines
the public headers is a list of header files that contain types, and functions, that are publicly available to higer-level apis.
... library description layer directory public headers certdb provides all certificate handling functions and types.
... high cert lib/certhigh ocsp.h, ocspt.h crmf provides functions, and data types, to handle certificate management message format (cmmf) and certificate request message format (crmf, see rfc 2511) data.
...And 36 more matches
nsIDOMWindowUtils
oat ax, in float ay, in boolean aignorerootscrollframe, in boolean aflushlayout); void entermodalstate(); nsidomelement findelementwithviewid(in nsviewid aid); void focus(in nsidomelement aelement); void forceupdatenativemenuat(in astring indexstring); void garbagecollect([optional] in nsicyclecollectorlistener alistener); short getcursortype(); astring getdocumentmetadata(in astring aname); nsidomwindow getouterwindowwithid(in unsigned long long aouterwindowid); long getpccountscriptcount(); astring getpccountscriptsummary(in long ascript); astring getpccountscriptcontents(in long ascript); void getscrollxy(in boolean aflushlayout, out long ascrollx, out long ascrolly);...
... astring getvisiteddependentcomputedstyle(in nsidomelement aelement, in astring apseudoelement, in astring apropertyname); boolean isinmodalstate(); void leavemodalstate(); void loadsheet(in nsiuri sheeturi, in unsigned long type); nsidomnodelist nodesfromrect(in float ax, in float ay, in float atopsize, in float arightsize, in float abottomsize, in float aleftsize, in boolean aignorerootscrollframe, in boolean aflushlayout); void processupdates(); obsolete since gecko 13.0 void purgepccounts(); unsigned long redraw([optional] in unsigned long acount); void renderdocument(in nsconstrect arect, in pruint32 aflags, in nscolor abackgroundcolor, in gfxcontext athebescontext); native code only!
... void removesheet(in nsiuri sheeturi, in unsigned long type); void resumetimeouts(); void sendcompositionevent(in astring atype); obsolete since gecko 9 void sendcompositionevent(in astring atype, in astring adata, in astring alocale); obsolete since gecko 38.0 void sendcontentcommandevent(in astring atype, [optional] in nsitransferable atransferable); void getclassname(in object aobj); boolean sendkeyevent(in astring atype, in long akeycode, in long acharcode, in long amodifiers, [optional] in boolean apreventdefault); obsolete since gecko 15.0 boolean sendkeyevent(in astring atype, in long akeycode, in long acharcode, in long amodifiers, [optional] in unsigned long aadditionalflags); deprecated since gecko 38.0 ...
...And 36 more matches
Color picker tool - CSS: Cascading Style Sheets
nd-image: url('https://mdn.mozillademos.org/files/6071/color-wheel.png'); background-repeat:no-repeat; background-position: center left 30%; } #color-info .copy-container { position: absolute; top: -100%; } #color-info .property { min-width: 280px; height: 30px; margin: 10px 0; text-align: center; line-height: 30px; } #color-info .property > * { float: left; } #color-info .property .type { width: 60px; height: 100%; padding: 0 16px 0 0; text-align: right; } #color-info .property .value { width: 200px; height: 100%; padding: 0 10px; font-family: "segoe ui", arial, helvetica, sans-serif; font-size: 16px; color: #777; text-align: center; background-color: #fff; border: none; } #color-info .property .value:hover { color: #37994a; } #color-info .property .value:hover ...
... color.sethsv(h, s, v); return color; } function hsvacolor(h, s, v, a) { var color = new color(); color.sethsv(h, s, v); color.a = a; return color; } function hslcolor(h, s, l) { var color = new color(); color.sethsl(h, s, l); return color; } function hslacolor(h, s, l, a) { var color = new color(); color.sethsl(h, s, l); color.a = a; return color; } color.prototype.copy = function copy(obj) { if(obj instanceof color !== true) { console.log('typeof parameter not color'); return; } this.r = obj.r; this.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 setfo...
...rmat(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; this.r = red | 0; this.g = green | 0; this.b = blue | 0; if (this.isvalidrgbvalue(alpha) === true) this.a = alpha | 0; }; color.prototype.setbyname = function setbyname(name, value) { if (name === 'r' || name === 'g' || nam...
...And 36 more matches
String - JavaScript
let s_prim = 'foo' let s_obj = new string(s_prim) console.log(typeof s_prim) // logs "string" console.log(typeof s_obj) // logs "object" string primitives and string objects also give different results when using eval().
...it performs type conversion when called as a function, rather than as a constructor, which is usually more useful.
... instance properties string.prototype.length reflects the length of the string.
...And 36 more matches
Basic native form controls - Learn web development
next we will look at the functionality of the different form controls, or widgets, in detail — studying all the different options available to collect different types of data.
...this article covers: the common input types button, checkbox, file, hidden, image, password, radio, reset, submit, and text.
...if you want a more advanced reference, you should consult our html forms element reference, and in particular our extensive <input> types reference.
...And 35 more matches
Drag Operations - Web APIs
the drag data contains two pieces of information, the type (or format) of the data, and the data's value.
... the format is a type string (such as text/plain for text data), and the value is a string of text.
... when the drag begins, you add data by providing a type and the data.
...And 35 more matches
Array - JavaScript
description arrays are list-like objects whose prototype has methods to perform traversal and mutation operations.
... neither the length of a javascript array nor the types of its elements are fixed.
...in general, these are convenient characteristics; but if these features are not desirable for your particular use, you might consider using typed arrays.
...And 35 more matches
JXON - Archive of obsolete content
conversion snippets now imagine you have this sample xml document: example.xml <?xml version="1.0"?> <!doctype catalog system "catalog.dtd"> <catalog> <product description="cardigan sweater"> <catalog_item gender="men's"> <item_number>qwz5671</item_number> <price>39.95</price> <size description="medium"> <color_swatch image="red_cardigan.jpg">red</color_swatch> <color_swatch image="burgundy_cardigan.jpg">burgundy</color_swatch> </size> <size description="large">...
...atch image="burgundy_cardigan.jpg">burgundy</color_swatch> </size> </catalog_item> <catalog_item gender="women's"> <item_number>rrx9856</item_number> <discount_until>dec 25, 1995</discount_until> <price>42.50</price> <size description="medium"> <color_swatch image="black_cardigan.jpg">black</color_swatch> </size> </catalog_item> </product> <script type="text/javascript"><![cdata[function matchwo(a,b) { if (a < b && a < 0) { return 1; } else { return 0; } }]]></script> </catalog> first, create a dom tree like the previous example as described in the how to create a dom tree article.
... the algorithms proposed here (see: #1, #2, #3, #4) will consider only the following types of nodes and their attributes: document (only as function argument), documentfragment (only as function argument), element, text (never as function argument), cdatasection (never as function argument), attr (never as function argument).
...And 34 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
nodetype returns the type of the current node.
... 2 attribute node 3 text node 4 cdata section node 5 entity reference node 6 entity node 7 processing instruction node 8 comment node 9 document node 10 document type node 11 document fragment node 12 notation node nodevalue returns the value of the current node.
...every node has a nodetype property specifying the node type.
...And 34 more matches
prefwindow - Archive of obsolete content
attributes buttonalign, buttondir, buttonorient, buttonpack, buttons, defaultbutton, lastselected, onbeforeaccept, ondialogaccept, ondialogcancel, ondialogdisclosure, ondialoghelp, onload, onunload, title, type properties buttons, currentpane, defaultbutton, lastselected, preferencepanes, type methods acceptdialog, addpane, canceldialog, centerwindowonscreen, getbutton, opensubdialog, openwindow, showpane examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <prefwindow xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <prefpan...
...e id="saveoptions" label="backups"> <preferences> <preference id="pref-backup" name="myapp.mybackups" type="bool"/> <preference id="pref-backupduration" name="myapp.mybackups.duration" type="int"/> </preferences> <checkbox label="automatically save backups" preference="pref-backup"/> <textbox label="duration:" preference="pref-backupduration"/> </prefpane> </prefwindow> attributes activetitlebarcolor type: color string specify background color of the window's titlebar when it is active (foreground).
... buttonalign type: string the value of the align attribute for the box containing the buttons.
...And 34 more matches
IAccessibleText
1.0 66 introduced gecko 1.9 inherits from: iunknown last changed in gecko 1.9 (firefox 3) this enum defines values which specify a text() boundary type.
...however, if the application developer was not satisfied with how screen readers have handled the reading of sentences this boundary type could be implemented and screen readers could use the application's version of a sentence rather than the screen reader's.
... the rest of the boundary types must be supported.
...And 34 more matches
Standard OS Libraries
this article gives the names of standard libraries that can be accessed with js-ctypes.
... these libraries are what enable js-ctypes to work.
... the alternative to standard libraries is creating your own dll (for windows) or so (for linux) file with c functions that can be called from your add-on with js-ctypes.
...And 34 more matches
Classes and Inheritance - Archive of obsolete content
each constructor function has an associated object, known as its prototype, which is shared between all instances of that class.
... we will show how to define classes using constructors, and how to use prototypes to efficiently define member functions on each instance.
... classical inheritance can be implemented in javascript using constructors and prototypes.
...And 33 more matches
Introduction to using XPath in JavaScript - XPath
var xpathresult = document.evaluate( xpathexpression, contextnode, namespaceresolver, resulttype, result ); parameters the evaluate function takes a total of five parameters: xpathexpression: a string containing the xpath expression to be evaluated.
... resulttype: a constant that specifies the desired result type to be returned as a result of the evaluation.
... the most commonly passed constant is xpathresult.any_type which will return the results of the xpath expression as the most natural type.
...And 33 more matches
menuitem - Archive of obsolete content
attributes acceltext, accesskey, allowevents, autocheck, checked, closemenu, command, crop, description, disabled, image, key, label, name, selected, tabindex, type, validate, value properties accessibletype, accesskey, command, control, crop, disabled, image, label, labelelement, parentcontainer, selected, tabindex, value style classes menuitem-iconic, menuitem-non-iconic examples <menulist> <menupopup> <menuitem label="option 1" value="1"/> <menuitem label="option 2" value="2"/> <menuitem label="option 3" value="3"/> <menui...
...tem label="option 4" value="4"/> </menupopup> </menulist> attributes acceltext type: string text that appears beside the menu label to indicate the shortcut key (accelerator key) to use to invoke the command.
... accesskey type: character this should be set to a character that is used as a shortcut key.
...And 32 more matches
JIT Optimization Outcomes
notypeinfo optimization failed because there was no type information associated with an object containing the property.
... 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.
...And 32 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
overview javascript is a multi-paradigm, dynamic language with types and operators, standard built-in objects, and methods.
...javascript supports object-oriented programming with object prototypes, instead of classes (see more about prototypical inheritance and es2015 classes).
... let's start off by looking at the building blocks of any language: the types.
...And 32 more matches
Object - JavaScript
the object class represents one of javascript's data types.
... 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.
...with object.setprototypeof).
...And 32 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.
...for example, class types and typedefs are declared and will have a .loc property.
...And 31 more matches
panel - Archive of obsolete content
ArchiveMozillaXULpanel
« xul reference home [ examples | attributes | properties | methods | related ] a panel is a used as a temporary floating popup window that may contain any type of content.
...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.
... 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.
...And 31 more matches
JIT Optimization Strategies
getprop_constant attempts to optimize reading a property that contains a uniquely-typed (or "singleton") object.
... with uniquely-typed objects, it is guaranteed that no other object has that same type.
... unique (or "singleton") types are assigned to certain kinds of objects, like global objects, top-level functions, and object literals declared at the top-level of a script.
...And 28 more matches
nsIPermissionManager
the nsipermissionmanager interface is used to persistently store permissions for different object types (cookies, images, and so on) on a site-by-site basis.
... last changed in gecko 16 (firefox 16 / thunderbird 16 / seamonkey 2.13) inherits from: nsisupports method overview void add(in nsiuri uri, in string type, in pruint32 permission, [optional] in pruint32 expiretype, [optional] in print64 expiretime); void addfromprincipal(in nsiprincipal principal, in string type, in pruint32 permission, [optional] in pruint32 expiretype, [optional] in print64 expiretime); void remove(in autf8string host, in string type); void removefromprincipal(in nsiprincipal principal, in string type); void removepermission(in nsipermission perm); void removeallsince(in int64_t since); ...
...void removeall(); pruint32 testexactpermission(in nsiuri uri, in string type); pruint32 testexactpermissionfromprincipal(in nsiprincipal principal, in string type); pruint32 testpermission(in nsiuri uri, in string type); pruint32 testpermissionfromprincipal(in nsiprincipal principal, in string type); attributes attribute type description enumerator nsisimpleenumerator enumerates all stored permissions.
...And 28 more matches
dialog - Archive of obsolete content
t, buttonlabelaccept, buttonlabelcancel, buttonlabeldisclosure, buttonlabelextra1, buttonlabelextra2, buttonlabelhelp, buttonorient, buttonpack, buttons, defaultbutton, title properties buttons, defaultbutton methods acceptdialog, canceldialog, centerwindowonscreen, getbutton, movetoalertposition examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog id="donothing" title="dialog example" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" buttons="accept,cancel" buttonlabelcancel="cancel" buttonlabelaccept="save"> <dialogheader title="options" description="my preferences"/> <groupbox> <caption label="colour"/> <radiogroup> <radio label="red"/> <radio label="green" selecte...
...d="true"/> <radio label="blue"/> </radiogroup> <label value="nickname"/> <textbox/> </groupbox> </dialog> attributes activetitlebarcolor type: color string specify background color of the window's titlebar when it is active (foreground).
... buttonaccesskeyaccept type: string the access key to use for the "accept" button.
...And 27 more matches
tab - Archive of obsolete content
ArchiveMozillaXULtab
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.
... afterselected type: boolean this is set to true if the tab is immediately after the currently selected tab.
... beforeselected type: boolean this is set to true if the tab is immediately before the currently selected tab.
...And 27 more matches
Advanced form styling - Learn web development
previous overview: forms next in this article, we will see what can be done with css to style the types of form control that are more difficult to style — the "bad" and "ugly" categories.
... to recap what we said in the previous article, we have: the bad: some elements are more difficult to style, requiring more complex css or some more specific tricks: checkboxes and radio buttons <input type="search"> the ugly: some elements can't be styled thoroughly using css.
... <input type="color"> date-related controls such as <input type="datetime-local"> <input type="range"> <input type="file"> <progress> and <meter> let's first talk about the appearance property, which is pretty useful for making all of the above more stylable.
...And 27 more matches
Index - Learn web development
15 how can we design for all types of users?
... 66 inheritance in javascript article, beginner, codingscripting, constructor, function, getter, inheritance, javascript, learn, oojs, oop, object, object member, prototype, extends, l10n:priority, setter this article has covered the remainder of the core oojs theory and syntax that we think you should know now.
... at this point you should understand javascript object and oop basics, prototypes and prototypal inheritance, how to create classes (constructors) and object instances, add features to classes, and create subclasses that inherit from other classes.
...And 27 more matches
Plug-in Development Overview - Gecko Plugin API Reference
decide the mime type for the plug-in (see registering plug-ins).
... registering plug-ins gecko identifies a plug-in by the mime type it supports.
... when it needs to display data of a particular mime type, the browser finds and invokes the plug-in object that supports that type.
...And 26 more matches
Inheritance in JavaScript - Learn web development
prototypal inheritance so far we have seen some inheritance in action — we have seen how prototype chains work, and how members are inherited going up a chain.
...me 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!
...And 26 more matches
Plug-in Development Overview - Plugins
decide the mime type for the plug-in (see registering plug-ins).
... registering plug-ins gecko identifies a plug-in by the mime type it supports.
... when it needs to display data of a particular mime type, the browser finds and invokes the plug-in object that supports that type.
...And 26 more matches
Understanding WebAssembly text format - WebAssembly
the first label inside the parenthesis tells you what type of node it is, and after that there is a space-separated list of either attributes or child nodes.
... the locals are like vars in javascript, but with explicit types declared.
... signatures and parameters the signature is a sequence of parameter type declarations followed by a list of return type declarations.
...And 26 more matches
LiveConnect Overview - Archive of obsolete content
working with wrappers in javascript, a wrapper is an object of the target language data type that encloses an object of the source language.
...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.
... note: because java is a strongly typed language and javascript is weakly typed, the javascript runtime engine converts argument values into the appropriate data types for the other language when you use liveconnect.
...And 25 more matches
Client-side form validation - Learn web development
different types of client-side validation there are two different types of client-side validation that you'll encounter on the web: built-in form validation uses html5 form validation features, which we've discussed in many places throughout this module.
... minlength and maxlength: specifies the minimum and maximum length of textual data (strings) min and max: specifies the minimum and maximum values of numerical input types type: specifies whether the data needs to be a number, an email address, or some other specific preset type.
... note: there are several errors that will prevent the form from being submitted, including a badinput, patternmismatch, rangeoverflow or rangeunderflow, stepmismatch, toolong or tooshort, typemismatch, valuemissing, or a customerror.
...And 25 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
you can type these examples up and open them in firefox to see how they behave and appear.
...again, since xul is a type of xml, stylesheets are read in using the xml-stylesheet processing instruction.
...in this section, we’ll look at three typical types of root element: the window, page, and dialog elements.
...And 24 more matches
listitem - Archive of obsolete content
by default it contains a single listcell element of type and class appropriate to that of the listitem.
... attributes accesskey, checked, command, crop, current, disabled, image, label, preference, selected, tabindex, type, value properties accesskey, accessible, checked, control, crop, current, disabled, image, label, selected, tabindex, value style classes listitem-iconic examples <listbox id="thelist"> <listitem label="ruby"/> <listitem label="emerald"/> <listitem label="sapphire" selected="true"/> <listitem label="diamond"/> </listbox> attributes accesskey type: character this should be set to a character that is used as a shortcut key.
... checked type: boolean indicates whether the element is checked or not.
...And 24 more matches
Gecko Compatibility Handbook - Archive of obsolete content
(more about css) content differs in gecko browsers and internet explorer incorrect layout mode specified by doctype.
... if pages should be displayed by legacy browsers such as netscape navigator 4 or internet explorer 4 and 5, be sure to specify quirks mode layout via the doctype.
... incorrect layout mode specified by doctype.
...And 23 more matches
Multiprocess on Windows
com metadata midl outputs two different types of metadata: "fast format strings" (also known as oicf) and (optionally, if a library statement is included in the idl) type libraries (also known as typelib).
... oicf metadata is much richer than typelib metadata, however com requires typelibs whenever it is being used with interpreted languages.
... in particular, typelibs were originally designed to work with 1990s-era visual basic.
...And 23 more matches
CustomizableUI.jsm
customizableui is aware of two types of areas: toolbars and the menu panel.
... there are three main types of widgets: 'legacy' xul widgets, which are the way customizableui represents widgets whose dom representation is present (or overlaid) into a window; api-style widgets, which are the new widgets customizableui can create and manage for you.
... these come in 3 types themselves: button which are simple toolbar buttons which do something when clicked view which are toolbar buttons with a 'view' of further options.
...And 23 more matches
WebRequest.jsm
name type description callback function the callback argument is a function to be called when the event is triggered.
... in particular, "blocking" may be passed to several event types, and will make the event dispatch synchronous, so the browser will wait for the event listener to return before continuing with the request.
... filter is an object that may contain up to two properties: urls and types.
...And 23 more matches
nsIWindowMediator
inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) the two most common uses of nsiwindowmediator are, enumerating all windows of a given type and getting the most recent / any window of a given type.
... nsisimpleenumerator getenumerator(in wstring awindowtype); nsidomwindow getmostrecentwindow(in wstring awindowtype); nsidomwindow getouterwindowwithid(in unsigned long long aouterwindowid); nsisimpleenumerator getxulwindowenumerator(in wstring awindowtype); pruint32 getzlevel(in nsixulwindow awindow); native code only!
... nsisimpleenumerator getzorderdomwindowenumerator(in wstring awindowtype, in boolean afronttoback); nsisimpleenumerator getzorderxulwindowenumerator(in wstring awindowtype, in boolean afronttoback); void registerwindow(in nsixulwindow awindow); native code only!
...And 23 more matches
menupopup - Archive of obsolete content
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.
... 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.
... <menupopup id="clipmenu"> <menuitem label="cut"/> <menuitem label="copy"/> <menuitem label="paste"/> </menupopup> <label value="right click for popup" context="clipmenu"/> attributes ignorekeys type: boolean if true, keyboard navigation between items in the popup is disabled.
...And 22 more matches
tooltip - Archive of obsolete content
attributes crop, default, label, noautohide, onpopuphidden, onpopuphiding, onpopupshowing, onpopupshown, page, position properties accessibletype, label, popupboxobject, position, state methods hidepopup, moveto, openpopup, openpopupatscreen, showpopup, sizeto examples <tooltip id="moretip" orient="vertical" style="background-color: #33dd00;"> <label value="click here to see more information"/> <label value="really!" style="color: red;"/> </tooltip> <vbox> <button label="simple" tooltiptext="a simple popup"/> <button...
... label="more" tooltip="moretip"/> </vbox> attributes crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute.
...for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } default type: boolean if true, the tooltip is used as the default popup for displaying tooltips in the window.
...And 22 more matches
wizard - Archive of obsolete content
attributes firstpage, lastpage, pagestep, title, windowtype properties canadvance, canrewind, currentpage, onfirstpage, onlastpage, pagecount, pageindex, pagestep, title, wizardpages methods advance, cancel, extra1, extra2, getbutton, getpagebyid, goto, rewind examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <wizard id="thewizard" title="secret code wizard" xmlns="http://www.mozilla.org/keymast...
...byid('thewizard').canadvance = (document.getelementbyid('secretcode').value == "cabbage"); } </script> <wizardpage onpageshow="checkcode();"> <label value="enter the secret code:"/> <textbox id="secretcode" onkeyup="checkcode();"/> </wizardpage> <wizardpage> <label value="that is the correct secret code."/> </wizardpage> </wizard> attributes activetitlebarcolor type: color string specify background color of the window's titlebar when it is active (foreground).
... firstpage type: boolean true if the wizard is on the first page.
...And 22 more matches
Property cache
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.
...when recording a getprop, the jit needs to know the result type before the interpreter executes the instruction.
...in the case of shared permanent properties, this differs from the notion of "own property" seen by scripts via object.prototype.hasownproperty.
...And 22 more matches
nsIMessenger
method overview void setdisplaycharset(in acstring acharset); void setwindow(in nsidomwindow ptr, in nsimsgwindow msgwindow); void openurl(in acstring aurl); void loadurl(in nsidomwindow ptr, in acstring aurl); void launchexternalurl(in acstring aurl); boolean canundo(); boolean canredo(); unsigned long getundotransactiontype(); unsigned long getredotransactiontype(); void undo(in nsimsgwindow msgwindow); void redo(in nsimsgwindow msgwindow); void sendunsentmessages(in nsimsgidentity aidentity, in nsimsgwindow amsgwindow); void setdocumentcharset(in acstring characterset); void saveas(in acstring auri, in boolean aasfile, in nsimsgidentity aidentity, in astring ams...
... void openattachment(in acstring contenttpe, in acstring url, in acstring displayname, in acstring messageuri, in boolean isexternalattachment); void saveattachment(in acstring contenttpe, in acstring url, in acstring displayname, in acstring messageuri, in boolean isexternalattachment); void saveallattachments(in unsigned long count, [array, size_is(count)] in string contenttypearray, [array, size_is(count)] in string urlarray, [array, size_is(count)] in string displaynamearray, [array, size_is(count)] in string messageuriarray); void saveattachmenttofile(in nsifile afile, in acstring aurl, in acstring amessageuri, in acstring acontenttype, in nsiurllistener alistener); void detachattachment(in string contenttpe, in string url, in string displayname, in...
... string messageuri, in boolean savefirst, [optional] in boolean withoutwarning); void detachallattachments(in unsigned long count, [array, size_is(count)] in string contenttypearray, [array, size_is(count)] in string urlarray, [array, size_is(count)] in string displaynamearray, [array, size_is(count)] in string messageuriarray, in boolean savefirst, [optional] in boolean withoutwarning); nsilocalfile saveattachmenttofolder(in acstring contenttype, in acstring url, in acstring displayname, in acstring messageuri, in nsilocalfile adestfolder); nsimsgmessageservice messageservicefromuri(in acstring auri); nsimsgdbhdr msghdrfromuri(in acstring auri); acstring getmsguriatnavigatepos(in long apos); acstring getfolderuriatnavigatepos(in long apos)...
...And 22 more matches
HTMLInputElement - Web APIs
formenctype string: returns / sets the element's formenctype attribute, containing the type of content that is used to submit the form to the server.
... this overrides the enctype attribute of the parent form.
... properties that apply to any type of input element that is not hidden name string: returns / sets the element's name attribute, containing a name that identifies the element when submitting the form.
...And 22 more matches
Using IndexedDB - Web APIs
this article documents the types of objects used by indexeddb, as well as the methods of the asynchronous api (the synchronous api was removed from spec).
...if everything succeeds, a success event (that is, a dom event whose type property is set to "success") is fired with request as its target.
...otherwise, if there was any problem, an error event (that is, a dom event whose type property is set to "error") is fired at request.
...And 22 more matches
SVGLength - Web APIs
WebAPISVGLength
svg length interface the svglength interface correspond to the <length> basic data type.
... interface overview also implement none methods void newvaluespecifiedunits(in unsigned short unittype, in float valueinspecifiedunits) void converttospecifiedunits(in unsigned short unittype) properties readonly unsigned short unittype float value float valueinspecifiedunits domstring valueasstring constants svg_lengthtype_unknown = 0 svg_lengthtype_number = 1 svg_lengthtype_percentage = 2 svg_lengthtype_ems = 3 svg_lengthtype_exs = 4 svg_lengthtype_px = 5 svg_lengthtype_cm = 6 svg_lengthtype_mm = 7 ...
... svg_lengthtype_in = 8 svg_lengthtype_pt = 9 svg_lengthtype_pc = 10 normative document svg 1.1 (2nd edition) example <svg height="200" onload="start();" version="1.1" width="200" xmlns="http://www.w3.org/2000/svg"> <script type="text/javascript"><![cdata[ function start() { var rect = document.getelementbyid("myrect"); var val = rect.x.baseval; // read x in pixel and cm units console.log("value: " + val.value + ", valueinspecifiedunits: " + val.unittype + ": " + val.valueinspecifiedunits + ", valueasstring: " + val.valueasstring); // set x = 20pt and read it out in pixel and pt units val.newvaluespecifiedunits(svglength.svg_lengthtype_pt, 20); console.log("value: " + val.value + ", valueinspecifie...
...And 22 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()".
... 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.
...And 22 more matches
simple-prefs - Archive of obsolete content
"preferences": [{ "name": "somepreference", "title": "some preference title", "description": "some short description for the preference", "type": "string", "value": "this is the default string value" }, { "description": "how many of them we have.", "name": "myinteger", "type": "integer", "value": 8, "title": "how many?" }] } each preference is defined by a group of attributes.
... there are: mandatory attributes that all preferences must have optional attributes attributes that are specific to the preference's data type mandatory common attributes these are attributes that all preferences must have.
... attribute description type the type of preference, as defined in the "preference types" section below.
...And 21 more matches
menu - Archive of obsolete content
ArchiveMozillaXULmenu
attributes acceltext, accesskey, allowevents, command, crop, disabled, image, label, menuactive, open, sizetopopup, tabindex, value properties accessibletype, accesskey, command, control, crop, disabled, image, itemcount, label, labelelement, menupopup, open, parentcontainer, selected, tabindex, value methods appenditem, getindexofitem, getitematindex, insertitemat, removeitemat style classes menu-iconic example <menubar id="sample-menubar"> <menu id="file-menu" label="file"> <menupopup id="file-popup"> <menuitem label="new"/> ...
... <menuitem label="open"/> <menuitem label="save"/> <menuseparator/> <menuitem label="exit"/> </menupopup> </menu> <menu id="edit-menu" label="edit"> <menupopup id="edit-popup"> <menuitem label="undo"/> <menuitem label="redo"/> </menupopup> </menu> </menubar> attributes acceltext type: string text that appears beside the menu label to indicate the shortcut key (accelerator key) to use to invoke the command.
... accesskey type: character this should be set to a character that is used as a shortcut key.
...And 21 more matches
menuseparator - Archive of obsolete content
attributes acceltext, accesskey, allowevents, command, crop, disabled, image, label, selected, tabindex, value properties accessibletype, accesskey, command, control, crop, disabled, image, label, labelelement, parentcontainer, selected, tabindex, value examples <menu label="menu"> <menupopup> <menuitem label="item1"/> <menuseparator/> <menuitem label="item2"/> <menuitem label="item3"/> </menupopup> </menu> attributes acceltext type: string text that appears beside the menu label to indicate the shortcut ...
... accesskey type: character this should be set to a character that is used as a shortcut key.
... allowevents type: boolean if true, events are passed to children of the element.
...And 21 more matches
tabs - Archive of obsolete content
ArchiveMozillaXULtabs
attributes closebutton, disableclose, disabled, onclosetab, onnewtab, onselect, setfocus, selectedindex, tabbox, tabindex, tooltiptextnew, value, properties accessibletype, disabled, itemcount, selectedindex, selecteditem, tabindex, value, methods advanceselectedtab, appenditem, getindexofitem, getitematindex, insertitemat, removeitemat examples (example needed) attributes closebutton obsolete since gecko 1.9.2 type: boolean if this attribute is set to true, the tabs row will have a "new tab" button and "close" button on the ends.
... disableclose type: boolean if this attribute is true the close button will be disabled.
... disabled type: boolean indicates whether the element is disabled or not.
...And 21 more matches
JSAPI reference
ecallback added in spidermonkey 17 js_newcompartmentandglobalobject added in spidermonkey 1.8.1 obsolete since jsapi 16 js_entercrosscompartmentcall added in spidermonkey 1.8.1 obsolete since jsapi 18 js_leavecrosscompartmentcall added in spidermonkey 1.8.1 obsolete since jsapi 18 locale callbacks: struct jslocalecallbacks js_getlocalecallbacks js_setlocalecallbacks locale callback types: jslocaletouppercase jslocaletolowercase jslocalecompare jslocaletounicode scripts just running some javascript code is straightforward: class js::compileoptions added in spidermonkey 17 class js::owningcompileoptions added in spidermonkey 31 class js::readonlycompileoptions added in spidermonkey 31 class js::sourcebufferholder added in spidermonkey 31 js::evaluate added in spide...
...n js_decompilefunctionbody js_compilefunction obsolete since jsapi 36 js_compilefunctionforprincipals obsolete since jsapi 28 js_compileucfunction obsolete since jsapi 36 js_compileucfunctionforprincipals obsolete since jsapi 28 error handling struct jserrorformatstring added in spidermonkey 17 class jserrorreport class js::autosaveexceptionstate added in spidermonkey 31 enum jsexntype added in spidermonkey 17 js_reporterror js_reportwarning js_reporterrornumber js_reporterrornumberuc js_reporterrorflagsandnumber js_reporterrorflagsandnumberuc js_reporterrornumberucarray added in spidermonkey 24 js_reportoutofmemory js_reportallocationoverflow added in spidermonkey 1.8 js_geterrorreporter js_seterrorreporterobsolete since jsapi 52 js_errorfromexception js_geterrorp...
...rototype jsreport_is_exception jsreport_is_strict jsreport_is_warning jsreport_is_strict_mode_error the following functions allow c/c++ functions to throw and catch javascript exceptions: js::createerror added in spidermonkey 38 js_isexceptionpending js_getpendingexception js_setpendingexception js_clearpendingexception js_throwstopiteration added in spidermonkey 1.8 js_isstopiteration added in spidermonkey 31 typedef jsexceptionstate js_saveexceptionstate js_restoreexceptionstate js_dropexceptionstate these functions translate errors into exceptions and vice versa: js_reportpendingexception js_errorfromexception js_throwreportederror obsolete since jsapi 29 values and types typedef jsval js::value js::value constructors: js::nullvalue added in spid...
...And 21 more matches
XPCOM array guide
MozillaTechXPCOMGuideArrays
introduction array types mozilla has many array classes because each array is optimized for a particular usage pattern.
... nstarray<t> - a c++ class which provides a typesafe container for objects or primitive types (pointers, integers, and so on).
...note that this class differs from the other array types by using unsigned indices.
...And 21 more matches
Web Console remoting - Firefox Developer Tools
protocol packets look as follows: { "to": "root", "type": "listtabs" } { "from": "root", "consoleactor": "conn0.console9", "selected": 2, "tabs": [ { "actor": "conn0.tab2", "consoleactor": "conn0.console7", "title": "", "url": "https://tbpl.mozilla.org/?tree=fx-team" }, // ...
... startlisteners(listeners, onresponse) the new startlisteners packet: { "to": "conn0.console9", "type": "startlisteners", "listeners": [ "pageerror", "consoleapi", "networkactivity", "fileactivity" ] } the reply is: { "startedlisteners": [ "pageerror", "consoleapi", "networkactivity", "fileactivity" ], "nativeconsoleapi": true, "from": "conn0.console9" } the reply tells which listeners were started and it includes a flag nativeconsoleapi which tell...
... when page navigation starts the following packet is sent from the tab actor: { "from": tabactor, "type": "tabnavigated", "state": "start", "url": newurl, "nativeconsoleapi": true } the nativeconsoleapi property tells if the window.console object is native or not for the top level window object for the given tab - this is always true when navigation starts.
...And 21 more matches
Working with objects - JavaScript
in javascript, an object is a standalone entity, with properties and type.
...examples are as follows: // four variables are created and assigned in a single go, // separated by commas var myobj = new object(), str = 'mystring', rand = math.random(), obj = new object(); myobj.type = 'dot syntax'; myobj['date created'] = 'string with space'; myobj[str] = 'string value'; myobj[rand] = 'random number'; myobj[obj] = 'object'; myobj[''] = 'even an empty string'; console.log(myobj); please note that all keys in the square bracket notation are converted to string unless they're symbols, since javascript object ...
...to illustrate how this works, the following function displays the properties of the object when you pass the object and the object's name as arguments to the function: function showprops(obj, objname) { var result = ``; for (var i in obj) { // obj.hasownproperty() is used to filter out properties from the object's prototype chain if (obj.hasownproperty(i)) { result += `${objname}.${i} = ${obj[i]}\n`; } } return result; } so, the function call showprops(mycar, "mycar") would return the following: mycar.make = ford mycar.model = mustang mycar.year = 1969 enumerate the properties of an object starting with ecmascript 5, there are three native ways to list/traverse object properties: for...in l...
...And 21 more matches
DataView - JavaScript
the dataview view provides a low-level interface for reading and writing multiple number types in a binary arraybuffer, without having to care about the platform's endianness.
... instance properties dataview.prototype.buffer the arraybuffer referenced by this view.
... dataview.prototype.bytelength the length (in bytes) of this view from the start of its arraybuffer.
...And 21 more matches
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.
...if you do not set the editortype attribute on an editor, you must enable editing using the makeeditable method.
...And 20 more matches
timepicker - Archive of obsolete content
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.
... hideseconds type: boolean indicates whether to show the seconds field.
... readonly type: boolean if set to true, then the user cannot change the value of the element.
...And 20 more matches
window - Archive of obsolete content
attributes accelerated, chromemargin, disablechrome, disablefastfind, drawintitlebar, fullscreenbutton, height, hidechrome, id, lightweightthemes, lightweightthemesfooter, screenx, screeny, sizemode, title, width, windowtype examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <!-- run this example using copy & paste in this live xul editor: https://github.com/km-200/xul --> <!-- extremely recommended to keep this css include!!
... <hbox> <label control="your-lname" value="enter last name:"/> <textbox id="your-lname" value="hernandez"/> </hbox> <hbox> <button oncommand="alert('save!')"> <description>save</description> </button> </hbox> </vbox> </radiogroup> </groupbox> </vbox> </window> attributes accelerated type: booleanset this attribute to true to allow hardware layer managers to accelerate the window.
... activetitlebarcolor type: color string specify background color of the window's titlebar when it is active (foreground).
...And 20 more matches
source-editor.jsm
method overview initialization and destruction void destroy(); void init(element aelement, object aconfig, function acallback); search operations number find(string astring, [optional] object options); number findnext(boolean awrap); number findprevious(boolean awrap); event management void addeventlistener(string aeventtype, function acallback); void removeeventlistener(string aeventtype, function acallback); undo stack operations boolean canredo(); boolean canundo(); void endcompoundchange(); boolean redo(); void resetundo(); void startcompoundchange(); boolean undo(); display management operations void focus(); ...
...set); void setcaretposition(number aline, [optional] number acolumn, [optional] number aalign); void setselection(number astart, number aend); breakpoint management void addbreakpoint(number alineindex, [optional] string acondition); array getbreakpoints(); boolean removebreakpoint(number alineindex); properties attribute type description dirty boolean set this value to false whenever you save the text; the editor will update it to true when the content is changed.
... this object has the following properties: property type description str string the last string that was searched for.
...And 20 more matches
nss tech note1
the main non-streaming apis for these two decoders have an identical prototype : secstatus sec_asn1decodeitem(prarenapool *pool, void *dest, const sec_asn1template *t, secitem *item); secstatus sec_quickderdecodeitem(prarenapool* arena, void* dest, const sec_asn1template* templateentry, secitem* src); here is a description of the arguments : secitem* src† is a structure containing a pointer to the binary data to be decoded, as well as its size.
...the number of required templates is determined by the type of the first template.when multiple templates are required, the pointer must point to a null-terminated array of templates.
...the type is undefined as it is completely dependent on the content of the decoder templates.† this typically points to a struct that is described (or partially described) by the templates.
...And 20 more matches
nsIDocShell
obsolete since gecko 1.8 nsisimpleenumerator getdocshellenumerator(in long aitemtype, in long adirection); nsidomstorage getsessionstorageforprincipal(in nsiprincipal principal, in domstring documenturi, in boolean create); nsidomstorage getsessionstorageforuri(in nsiuri uri, in domstring documenturi); void historypurged(in long numentries); void internalload(in nsiuri auri, in nsiuri areferrer, in nsisupports aowner, in pruint32 aflags, in ...
...wstring awindowtarget, in string atypehint, in nsiinputstream apostdatastream, in nsiinputstream aheadersstream, in unsigned long aloadflags, in nsishentry ashentry, in boolean firstparty, out nsidocshell adocshell, out nsirequest arequest); native code only!
... boolean isbeingdestroyed(); void loadstream(in nsiinputstream astream, in nsiuri auri, in acstring acontenttype, in acstring acontentcharset, in nsidocshellloadinfo aloadinfo); native code only!
...And 20 more matches
Debugger.Object - Firefox Developer Tools
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.
... 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.prototype.copy and debugger.object.prototype.create to create new objects in debuggee compartments, allocated as if by particular debuggee globals.
... accessor properties of the debugger.object prototype a debugger.object instance inherits the following accessor properties from its prototype: proto the referent’s prototype (as a new debugger.object instance), or null if it has no prototype.
...And 20 more matches
HTTP Index - HTTP
WebHTTPIndex
9 mime types (iana media types) content-type, guide, http, mime types, meta, request header, response header, application/javascript, application/json, application/xml a media type (also known as a multipurpose internet mail extensions or mime type) is a standard that indicates the nature and format of a document, file, or assortment of bytes.
... 10 incomplete list of mime types audio, file types, files, http, mime, mime types, php, reference, text, types, video here is a list of mime types, associated by type of documents, ordered by their common extensions.
... 16 content security policy (csp) csp, content security policy, reference, security content security policy (csp) is an added layer of security that helps to detect and mitigate certain types of attacks, including cross site scripting (xss) and data injection attacks.
...And 20 more matches
Expressions and operators - JavaScript
operators javascript has the following types of operators.
...in most cases, if the two operands are not of the same type, javascript attempts to convert them to an appropriate type for the comparison.
...the sole exceptions to type conversion within comparisons involve the === and !== operators, which perform strict equality and inequality comparisons.
...And 20 more matches
XUL controls - Archive of obsolete content
button reference <button type="menu"> a button that has a drop down menu attached to it.
... <button type="menu" label="view"> <menupopup> <menuitem label="list"/> <menuitem label="details"/> </menupopup> </button> more information about this type of menu button element.
... button reference related elements: menupopup menuitem <button type="menu-button"> a button that that has a separate arrow button with a menu attached to it.
...And 19 more matches
radio - Archive of obsolete content
ArchiveMozillaXULradio
attributes accesskey, command, crop, disabled, focused, group, image, label, selected, tabindex, value properties accesskey, accessibletype, control, crop, disabled, image, label, radiogroup, selected, tabindex, value examples <radiogroup> <radio id="orange" label="red" accesskey="r"/> <radio id="violet" label="green" accesskey="g" selected="true"/> <radio id="yellow" label="blue" accesskey="b" disabled="true"/> </radiogroup> attributes accesskey type: character this should be set to a character that is used...
... command type: id set to the id of a command element that is being observed by the element.
... crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute.
...And 19 more matches
UI pseudo-classes - Learn web development
an <input type="checkbox"> with the checked attribute set, or an <option> element with the selected attribute set).
...for example: <form> <fieldset> <legend>feedback form</legend> <div> <label for="fname">first name: </label> <input id="fname" name="fname" type="text" required> </div> <div> <label for="lname">last name: </label> <input id="lname" name="lname" type="text" required> </div> <div> <label for="email">email address (include if you want a response): </label> <input id="email" name="email" type="email"> </div> <div><button>submit</button></div> </fieldset> </form> here, the first name and last ...
...for example, in our custom radio buttons example, we use generated content to handle the placement and animation of the inner circle when a radio button is selected: input[type="radio"]::before { display: block; content: " "; width: 10px; height: 10px; border-radius: 6px; background-color: red; font-size: 1.2em; transform: translate(3px, 3px) scale(0); transform-origin: center; transition: all 0.3s ease-in; } input[type="radio"]:checked::before { transform: translate(3px, 3px) scale(1); transition: all 0.3s cubic-bezier(0.25, 0.25, 0.56, 2); } ...
...And 19 more matches
An Overview of XPCOM
the nsisupports interface is shown below: the nsisupports interface class sample: public nsisupports { private: nsrefcnt mrefcnt; public: sample(); virtual ~sample(); ns_imethod queryinterface(const nsiid &aiid, void **aresult); ns_imethod_(nsrefcnt) addref(void); ns_imethod_(nsrefcnt) release(void); }; the various types used in the interface are described in the xpcom types section below.
...but casting can become more involved where you must first cast void then to the requested type, because you must return the interface pointer in the vtable corresponding to the requested interface.
... xpcom identifier classes the nsiid class is actually a typedef for the nsid class.
...And 19 more matches
nsINavBookmarkObserver
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 21.0 (firefox 21.0 / thunderbird 21.0 / seamonkey 2.18) method overview void onbeforeitemremoved(in long long aitemid, in unsigned short aitemtype, in long long aparentid, in acstring aguid, in acstring aparentguid); obsolete since gecko 21.0 void onbeginupdatebatch(); void onendupdatebatch(); void onfolderadded(in print64 folder, in print64 parent, in print32 index); obsolete since gecko 1.9 void onfolderchanged(in print64 folder, in acstring property); obsolete since gecko 1.9 void onfoldermoved(in print64 fol...
...der, in print64 oldparent, in print32 oldindex, in print64 newparent, in print32 newindex); obsolete since gecko 1.9 void onfolderremoved(in print64 folder, in print64 parent, in print32 index); obsolete since gecko 1.9 void onitemadded(in long long aitemid, in long long aparentid, in long aindex, in unsigned short aitemtype, in nsiuri auri, in autf8string atitle, in prtime adateadded, in acstring aguid, in acstring aparentguid); void onitemchanged(in long long aitemid, in acstring aproperty, in boolean aisannotationproperty, in autf8string anewvalue, in prtime alastmodified, in unsigned short aitemtype, in long long aparentid, in acstring aguid, in acstring aparentguid); void onitemmoved(in long long aitemid, in long long aoldparentid, in long aoldindex, in...
... long long anewparentid, in long anewindex, in unsigned short aitemtype, in acstring aguid, in acstring aoldparentguid, in acstring anewparentguid); void onitemremoved(in long long aitemid, in long long aparentid, in long aindex, in unsigned short aitemtype, in nsiuri auri, in acstring aguid, in acstring aparentguid); void onitemreplaced(in print64 folder, in nsiuri item, in nsiuri newitem); obsolete since gecko 1.9 void onitemvisited(in long long aitemid, in long long avisitid, in prtime atime, in unsigned long atransitiontype, in nsiuri auri, in long long aparentid, in acstring aguid, in acstring aparentguid); void onseparatoradded(in print64 parent, in print32 index); obsolete since gecko 1.9 void onseparatorremoved(in print64 parent, in print32...
...And 19 more matches
WindowOrWorkerGlobalScope.setInterval() - Web APIs
<!doctype html> <html> <head> <meta charset="utf-8" /> <title>setinterval/clearinterval example</title> <script> var nintervid; function changecolor() { nintervid = setinterval(flashtext, 1000); } function flashtext() { var oelem = document.getelementbyid('my_box'); oelem.style.color = oelem.style.color == 'red' ?
... } function stoptextcolor() { clearinterval(nintervid); } </script> </head> <body onload="changecolor();"> <div id="my_box"> <p>hello world</p> </div> <button onclick="stoptextcolor();">stop</button> </body> </html> example 3: typewriter simulation the following example simulates typewriter by first clearing and then slowly typing content into the nodelist that matches a specified group of selectors.
... <!doctype html> <html> <head> <meta charset="utf-8" /> <title>javascript typewriter - mdn example</title> <script> function typewriter (sselector, nrate) { function clean () { clearinterval(nintervid); btyping = false; bstart = true; ocurrent = null; asheets.length = nidx = 0; } function scroll (osheet, npos, beraseandstop) { if (!osheet.hasownproperty('parts') || amap.length < npos) { return true; } var orel, bexit = false; if (amap.length === npos) { amap.push(0); } while (amap[npos] < osheet.parts.length) { orel = osheet.parts[amap[npos]]; scroll(orel, npos + 1, beraseandstop) ?
...And 19 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
it's available in the global for a window, but in jsm you'll need to fetch it from an interface: const xmlhttprequest = components.constructor("@mozilla.org/xmlextras/xmlhttprequest;1", "nsixmlhttprequest"); here's how to load a file using it: function loadfile(url,type,returnresult) { var request = new xmlhttprequest(); request.open("get", url, true); // async=true request.responsetype = type; request.onerror = function(event) { logerrormessage("error attempting to load: " + url); returnresult(null); }; request.onload = function(event) { if (request.response) returnresult(request.response); el...
...se request.onerror(event); }; request.send(); } loadfile("chrome://myaddon/content/filename.ext",datatype,function(data) { /* do stuff with data */ }); note: when using xmlhttprequest to access a file:// url the request.status is not properly set to 200 to indicate success.
... if your file is text, use "text" as your data type.
...And 18 more matches
preference - Archive of obsolete content
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.
... instantapply type: boolean if true, the preference will be changed as soon as the user interface is modified.
...And 18 more matches
toolbar - Archive of obsolete content
it is a type of box that defaults to horizontal orientation.
... attributes autohide, currentset, customindex, customizable, defaultset, grippyhidden, grippytooltiptext, height, iconsize, mode, toolbarname properties accessibletype, currentset, firstpermanentchild, lastpermanentchild, toolbarname, toolboxid methods insertitem style classes chromeclass-toolbar examples <toolbox> <toolbar id="nav-toolbar"> <toolbarbutton id="nav-users" accesskey="u" label="users"/> <toolbarbutton id="nav-groups" accesskey="p" label="groups"/> <toolbarbutton id="nav-events" accesskey="e" label="events" disabled="t...
...rue"/> </toolbar> </toolbox> attributes autohide type: boolean when set to true, the toolbar will be invisible unless the alt key is pressed by the user.
...And 18 more matches
CSS values and units - 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 about the different types of values and units used in css properties.
... 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.
...And 18 more matches
NSS tools : certutil
options and arguments running certutil always requires one and only one command option to specify the type of certificate operation.
... certutil supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new sqlite databases (cert9.db, key4.db, and pkcs11.txt).
... nss recognizes the following prefixes: · sql: requests the newer database · dbm: requests the legacy database if no prefix is specified the default type is retrieved from nss_default_db_type.
...And 18 more matches
JS_InitClass
make a jsclass accessible to javascript code by creating its prototype, constructor, properties, and functions.
... 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.
... parent_proto js::handleobject pointer to an object to be used as a prototype.
...And 18 more matches
nsINavHistoryService
se this service, use: var historyservice = components.classes["@mozilla.org/browser/nav-history-service;1"] .getservice(components.interfaces.nsinavhistoryservice); method overview astring getpagetitle(in nsiuri auri); void markpageasfollowedbookmark(in nsiuri auri); void markpageasfollowedlink(in nsiuri auri); void markpageastyped(in nsiuri auri); boolean canadduri(in nsiuri auri); long long addvisit(in nsiuri auri, in prtime atime, in nsiuri areferringuri, in long atransitiontype, in boolean aisredirect, in long long asessionid); obsolete since gecko 22.0 nsinavhistoryquery getnewquery(); nsinavhistoryqueryoptions getnewqueryoptions(); nsinavhistoryresult executequery(in nsin...
...erver, in boolean ownsweak); void removeobserver(in nsinavhistoryobserver observer); void runinbatchmode(in nsinavhistorybatchcallback acallback, in nsisupports aclosure); void importhistory(in nsifile file); astring getcharsetforuri(in nsiuri auri); astring setcharsetforuri(in nsiuri auri, in astring acharset); attributes attribute type description hashistoryentries boolean true if there is any history.
... constants transition type constants constant value description transition_link 1 this transition type means the user followed a link and got a new toplevel window.
...And 18 more matches
Using media queries - CSS: Cascading Style Sheets
media queries are useful when you want to modify your site or app depending on a device's general type (such as print vs.
... note: the examples on this page use css's @media for illustrative purposes, but the basic syntax remains the same for all types of media queries.
... syntax a media query is composed of an optional media type and any number of media feature expressions.
...And 18 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.
... 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.
...And 18 more matches
Venkman Introduction - Archive of obsolete content
to see which version of venkman you have, type /version in the interactive session view.
...this is the same text you would get from the tosource method of the function prototype.
...files are listed in alphabetical order, grouped by file type.
...And 17 more matches
datepicker - Archive of obsolete content
three types are available, which can be specified using the type attribute.
... 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.
... firstdayofweek type: integer which day of the week to display as the first day in the grid.
...And 17 more matches
scale - Archive of obsolete content
ArchiveMozillaXULscale
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.
... disabled type: boolean indicates whether the element is disabled or not.
... increment type: integer the amount by which the curpos (for scroll bars) or value (for number boxes and scale) attribute changes when the arrows are clicked(or scales are dragged).
...And 17 more matches
NPVariant - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary npvariant is a struct that holds a value and the type of that value.
... the value is held in a union, and the type is one of types defined in the npvarianttype enumeration.
... syntax typedef struct _npvariant { npvarianttype type; union { bool boolvalue; int32_t intvalue; double_t doublevalue; npstring stringvalue; npobject *objectvalue; } value; } npvariant; fields the data structure has the following fields: type a member of the npvarianttype enumeration specifying the data type contained in the npvariant.
...And 17 more matches
Mozilla DOM Hacking Guide
in javascript, there is no knowledge of types, like there is in c++.
...this means that when we use the dom from javascript, we pass arguments that have no type.
... however, since the dom is coded in c++, we expect to receive an argument of the correct type for our function.
...And 17 more matches
nss tech note5
ck_mechanism_type ciphermech = ckm_des_cbc_pad <big>(for example)</big> choose a slot on which to to do the operation pk11slotinfo* slot = pk11_getbestslot(ciphermech, null); or pk11slotinfo* slot = pk11_getinternalkeyslot(); /* alwys returns internal slot, may not be optimal */ prepare the key if using a raw key /* turn the raw key into a secitem */ secitem keyitem; ...
... ck_mechanism_type digestmech = ckm_md5 <big>(for example)</big> choose a slot on which to to do the operation pk11slotinfo* slot = pk11_getbestslot(digestmech, null); or pk11slotinfo* slot = pk11_getinternalkeyslot(); /* always returns int slot, may not be optimal */ prepare the key if using a raw key /* turn the raw key into a secitem */ secitem keyitem; keyitem.da...
...you can find a list of hmac mechanisms in security/nss/lib/softoken/pkcs11.c - grep for ckf_sn_vr, and choose the mechanisms that contain hmac in the name ck_mechanism_type hmacmech = ckm_md5_hmac; <big>(for example)</big> choose a slot on which to to do the operation pk11slotinfo* slot = pk11_getbestslot(hmacmech, null); or pk11slotinfo* slot = pk11_getinternalkeyslot(); /* always returns int slot, may not be optimal */ prepare the key if using a raw key /* turn the raw key into a secitem */ secitem keyitem; keyitem.
...And 17 more matches
nsINavHistoryQueryOptions
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10) method overview nsinavhistoryqueryoptions clone(); attributes attribute type description applyoptionstocontainers boolean if true, the query options are only applied to the containers.
... querytype short the type of search to use when querying the db; this attribute is only honored by query nodes.
...see query type constants for possible values.
...And 17 more matches
nsITimer
method overview void cancel(); void init(in nsiobserver aobserver, in unsigned long adelay, in unsigned long atype); void initwithcallback(in nsitimercallback acallback, in unsigned long adelay, in unsigned long atype); void initwithfunccallback(in nstimercallbackfunc acallback, in voidptr aclosure, in unsigned long adelay, in unsigned long atype); native code only!
... attributes attribute type description callback nsitimercallback the nsitimercallback object passed to initwithcallback().
... type unsigned long defines the timer type: one shot, repeating slack or repeating precise.
...And 17 more matches
Debugger.Object - Firefox Developer Tools
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.
... 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.prototype.copy and debugger.object.prototype.create to create new objects in debuggee compartments, allocated as if by particular debuggee globals.
... accessor properties of the debugger.object prototype a debugger.object instance inherits the following accessor properties from its prototype: proto the referent's prototype (as a new debugger.object instance), or null if it has no prototype.
...And 17 more matches
CSS values and units - CSS: Cascading Style Sheets
there are a common set of data types -- values and units -- that css properties accept.
... below is an overview of most of these data types.
... refer to the page for each value type for more detailed information.
...And 17 more matches
<link>: The External Resource Link element - HTML: Hypertext Markup Language
WebHTMLElementlink
as you'll see from our link types reference, there are many different kinds of relationship.
... there are a number of other common types you'll come across.
... for example, a link to the site's favicon: <link rel="icon" href="favicon.ico"> there are a number of other icon rel values, mainly used to indicate special icon types for use on various mobile platforms, e.g.: <link rel="apple-touch-icon-precomposed" sizes="114x114" href="apple-icon-114.png" type="image/png"> the sizes attribute indicates the icon size, while the type contains the mime type of the resource being linked.
...And 17 more matches
RegExp - JavaScript
flags in constructor starting with ecmascript 6, new regexp(/ab+c/, 'i') no longer throws a typeerror ("can't supply flags when constructing one regexp from another") when the first argument is a regexp and the second flags argument is present.
... instance properties regexp.prototype.flags a string that contains the flags of the regexp object.
... regexp.prototype.dotall whether .
...And 17 more matches
Preferences - Archive of obsolete content
: // get the root branch var prefs = components.classes["@mozilla.org/preferences-service;1"] .getservice(components.interfaces.nsiprefbranch); // get the "extensions.myext." branch var prefs = components.classes["@mozilla.org/preferences-service;1"] .getservice(components.interfaces.nsiprefservice); prefs = prefs.getbranch("extensions.myext."); simple types there are three types of preferences: string, integer, and boolean.
... each entry in the preferences database (prefs.js) has one of those types.
...var value = prefs.getboolpref("typeaheadfind"); // get a pref (accessibility.typeaheadfind) prefs.setboolpref("typeaheadfind", !value); // set a pref (accessibility.typeaheadfind) complex types as noted in the previous section, each entry in the preferences database (prefs.js) must have a string, an integer, or a boolean value.
...And 16 more matches
checkbox - Archive of obsolete content
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.
... checked type: boolean indicates whether the element is checked or not.
... for buttons, the type attribute must be set to checkbox or radio for this attribute to have any effect.
...And 16 more matches
radiogroup - Archive of obsolete content
attributes disabled, focused, preference, tabindex, value properties accessibletype, disabled, focuseditem, itemcount, selectedindex, selecteditem, tabindex, value methods appenditem, checkadjacentelement, getindexofitem, getitematindex, insertitemat, removeitemat examples <radiogroup> <radio id="orange" label="red"/> <radio id="violet" label="green" selected="true"/> <radio id="yellow" label="blue"/> </radiogroup> attributes disabled type: boolean ind...
... focused type: boolean this attribute is true if the element is focused.
... preference type: id connects the element to a corresponding preference.
...And 16 more matches
treecol - Archive of obsolete content
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="true"> <treecols> <treecol label="active" type="checkbox" editable="true"/> <treecol label="name" flex="1" /> </treecols> <treechildren> <treeitem> <treerow> <treecell value="true"/> <treecell label="alice"/> </treerow> </treeitem> <treeitem> <treerow> <treecell value="false"/> <treecell label="bob"/> </treerow> </treeitem> </treechildren> </tree> to make the checkbox visible on some platforms, the following styles need to be added to the stylesheet (see treecol.type).
... attributes crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute.
...And 16 more matches
Basic math in JavaScript — numbers and operators - Learn web development
types of numbers in programming, even the humble decimal number system that we all know so well is more complicated than you might think.
... we use different terms to describe different types of decimal numbers, for example: integers are whole numbers, e.g.
... doubles are a specific type of floating point number that have greater precision than standard floating point numbers (meaning that they are accurate to a greater number of decimal places).
...And 16 more matches
Accessibility API cross-reference
all accessibility apis to date define a list of possible object roles, or general types, such as button, menu item, text, etc.
...all accessibility apis to date define a list of possible object roles, or general types, such as button, menu item, text, etc.
... fill out tagged pdf column (relevant documents from pdf association) add missing aria properties fill out events cross reference table use this info to expand mozilla's accessibility api coverage to include mac, so that we can start to freeze them talk about the fact that msaa uses one interface (iaccessible), wherease gnome accessibility uses a lot of different interfaces depending on the type of object go through the atk info and make sure it's up-to-date accessible roles description & notes msaa role (role_system_*) java accessibility role gnome accessibility role (atk_role_*) mac os x accessibility role aria (role=*) html tagged pdf relevant xul for alerts, in java/gnome for any alert, in msaa if no other role applies.
...And 16 more matches
IPDL Tutorial
direction each message type includes a "direction." the message direction specifies whether the message can be sent from-parent-to-child, from-child-to-parent, or both ways.
...ipdl supports built-in and custom primitive types, as well as unions and arrays.
... the built-in simple types include the c++ integer types (bool, char, int, double) and xpcom string types (nsstring, nscstring).
...And 16 more matches
sample2
*/ /* nspr headers */ #include <prthread.h> #include <plgetopt.h> #include <prerror.h> #include <prinit.h> #include <prlog.h> #include <prtypes.h> #include <plstr.h> /* nss headers */ #include <cryptohi.h> #include <keyhi.h> #include <pk11priv.h> #include <cert.h> #include <base64.h> #include <secerr.h> #include <secport.h> #include <secoid.h> #include <secmodt.h> #include <secoidt.h> #include <sechash.h> /* our samples utilities */ #include "util.h" /* constants */ #define blocksize 32 #define modblocksize 128 #define default_key_bits 1024 /* header file constants */ #define enckey_...
...ine ns_cert_vfy_trailer "-----end certificate for signature verification-----" #define ns_sig_header "-----begin signature-----" #define ns_sig_trailer "-----end signature-----" #define ns_cert_header "-----begin certificate-----" #define ns_cert_trailer "-----end certificate-----" /* missing publically from nss versions earlier than 3.13 */ #ifndef sec_error_base #define sec_error_base (-0x2000) typedef enum { sec_error_io = sec_error_base + 0, sec_error_token_not_logged_in = (sec_error_base + 155), sec_error_end_of_list } secerrorcodes; #endif /* port_errortostring introduced in nss 3.13.
...*/ #ifndef port_errortostring #define port_errortostring(err) pr_errortostring((err), pr_language_i_default) #endif /* sample 6 commands */ typedef enum { generate_csr, add_cert_to_db, save_cert_to_header, encrypt, decrypt, sign, verify, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4, pubkey = 5, lab = 6, certenc= 7, certvfy= 8, sig = 9 } headertype; /* * print usage message and exit */ static void usage(const char *progname) { fprintf(stderr, "\nusage: %s %s %s %s %s %s %s %s %s %s\n\n", progname, " -<g|a|h|e|ds|v> -d <dbdirpath> ", "[-p <dbpwd> | -f <dbpwdfile>] [-z <noisefilename>] [-a <\"\">]", "-s <subject> -r <csr> | ", "-n <nickname> -t <tru...
...And 16 more matches
jsint
aliases for c/c++ integer types.
... syntax typedef ...
... jsint; typedef ...
...And 16 more matches
nsIApplicationCache
each entry in the cache can be marked with a set of types, specified in the constants section.
...method overview void activate(); void addnamespaces(in nsiarray namespaces); void discard(); void gatherentries(in pruint32 typebits, out unsigned long count, [array, size_is(count)] out string keys); nsiapplicationcachenamespace getmatchingnamespace(in acstring key); unsigned long gettypes(in acstring key); void initashandle(in acstring groupid, in acstring clientid); void markentry(in acstring key, in unsigned long typebits); void unmarkentry(in acstring key, in unsigned long typebits); attributes attribute type description active boolean true if the cache is ...
...gatherentries() returns a list of entries in the cache whose type matches one or more of the specified types.
...And 16 more matches
nsIHttpActivityObserver
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void observeactivity(in nsisupports ahttpchannel, in pruint32 aactivitytype, in pruint32 aactivitysubtype, in prtime atimestamp, in pruint64 aextrasizedata, in acstring aextrastringdata); attributes attribute type description isactive boolean true when the interface is active and should observe http activity, otherwise false.
... constants activity type constants constant value description activity_type_socket_transport 0x0001 socket transport activity has occurred.
... activity_type_http_transaction 0x0002 http transport activity has occurred.
...And 16 more matches
WebGL constants - Web APIs
all constants are of type glenum.
...x8038 texture_binding_2d 0x8069 sample_buffers 0x80a8 samples 0x80a9 sample_coverage_value 0x80aa sample_coverage_invert 0x80ab compressed_texture_formats 0x86a3 vendor 0x1f00 renderer 0x1f01 version 0x1f02 implementation_color_read_type 0x8b9a implementation_color_read_format 0x8b9b browser_default_webgl 0x9244 buffers constants passed to webglrenderingcontext.bufferdata(), webglrenderingcontext.buffersubdata(), webglrenderingcontext.bindbuffer(), or webglrenderingcontext.getbufferparameter().
... array_buffer 0x8892 passed to bindbuffer or bufferdata to specify the type of buffer being used.
...And 16 more matches
Using Web Workers - Web APIs
to illustrate this, let's create for didactical purpose a function named emulatemessage(), which will simulate the behavior of a value that is cloned and not shared during the passage from a worker to the main page or vice versa: function emulatemessage(vval) { return eval('(' + json.stringify(vval) + ')'); } // tests // test #1 var example1 = new number(3); console.log(typeof example1); // object console.log(typeof emulatemessage(example1)); // number // test #2 var example2 = true; console.log(typeof example2); // boolean console.log(typeof emulatemessage(example2)); // boolean // test #3 var example3 = new string('hello world'); console.log(typeof example3); // object console.log(typeof emulatemessage(example3)); // string // test #4 var example4 = { 'name'...
...: 'john smith', "age": 43 }; console.log(typeof example4); // object console.log(typeof emulatemessage(example4)); // object // test #5 function animal(stype, nage) { this.type = stype; this.age = nage; } var example5 = new animal('cat', 3); alert(example5.constructor); // animal alert(emulatemessage(example5).constructor); // object a value that is cloned and not shared is called message.
... */ this.sendquery = function() { if (arguments.length < 1) { throw new typeerror('queryableworker.sendquery takes at least one argument'); return; } worker.postmessage({ 'querymethod': arguments[0], 'queryarguments': array.prototype.slice.call(arguments, 1) }); } we finish queryableworker with the onmessage method.
...And 16 more matches
Variable fonts guide - CSS: Cascading Style Sheets
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, or style.
...for example linux oses need the latest linux freetype version, and macos prior to 10.13 does not support variable fonts.
... standard (or static) fonts in the past, a typeface would be produced as a number of individual fonts, and each font would represent one specific width/weight/style combination.
...And 16 more matches
Comparing Reflect and Object methods - JavaScript
returns a typeerror if the property was not successfully defined on the object.
...returns a typeerror if any properties were not successfully defined on the object.
...throws a typeerror if the target was not an object.
...And 16 more matches
core/heritage - Archive of obsolete content
if (!(this instanceof dog)) return new dog(name); this.name = name; }; // to define methods you need to make a dance with a special 'prototype' // property of the constructor function.
...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.
...And 15 more matches
Finding window handles - Archive of obsolete content
when working on windows platforms, many apis and frameworks require a window handle (hwnd type).
... os specific examples using javascript (js-ctypes) nsibasewindow -> nativehandle in all of the examples below, the native handle to the most recent navigator:browser is obtained and then it is focused.
... .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) .treeowner .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsibasewindow); var hwndstring = basewindow.nativehandle; components.utils.import('resource://gre/modules/ctypes.jsm'); var user32 = ctypes.open('user32.dll'); /* http://msdn.microsoft.com/en-us/library/ms633539%28v=vs.85%29.aspx * bool winapi setforegroundwindow( * __in_ hwnd hwnd * ); */ var setforegroundwindow = user32.declare('setforegroundwindow', ctypes.winapi_abi, ctypes.bool, // return bool ctypes.voidptr_t // hwnd ); var hwnd = ctypes.voidptr_t(ctypes.uint64(hwndstring)); var rez_...
...And 15 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
true javascript.options.strict (present in firefox 3.5+) enforces strict error output from javascript true table 1: preferences to set for developing extensions to make these changes, start your development profile, type about:config into firefox’s location bar and open the 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.
...chrome urls are structured as: chrome://%package name%/%package type%/%relative path to source file% for example, the chrome url for the firefox browser window is as follows: chrome://browser/content/browser.xul here, the package name is “browser”, the file “browser.xul”, and the type of the package is “content”.
...And 15 more matches
XUL Structure - Archive of obsolete content
how xul is handled in mozilla, xul is handled in much the same way as html or other types of content are handled.
... when you type the url of an html page into the browser's address field, the browser locates the web site and downloads the content.
... in fact, in mozilla, all document types, whether they are html or xul, or even svg, are all handled by the same underlying code.
...And 15 more matches
XForms Custom Controls - Archive of obsolete content
custom data types - existing xforms controls are not able to work properly with your data type advanced xforms controls - you need your controls to be able to do more things than traditional xforms controls can do new host language - you'd like to support xforms in host languages other than xhtml or xul custom presentation the mozilla xforms extension cannot anticipate all of the possible use cases that will evo...
...in many cases different values provided for the appearance or mediatype attributes will determine which xbl binding will be used for a particular xforms control on the form.
...here is a snippet from our .css file to show the type of css rule we would use to make such a determination.
...And 15 more matches
Using the Right Markup to Invoke Plugins - Archive of obsolete content
mozilla-based browsers support the netscape plugin architecture, which is not com based like activex (and thus, not invoked via a unique identifier) but rather, mime type based.
... mozilla-based browsers support the use of the object element along with a mime type.
... here is an example of this usage, once again for the macromedia flash plugin: <object type="application/x-shockwave-flash" data="javascript-to-flash.swf" width="366" height="142" id="myflash"> <param name="movie" value="javascript-to-flash.swf" /> <param name="quality" value="high" /> <param name="swliveconnect" value="true" /> <p>you need flash -- get the latest version from <a href= "http://www.macromedia.com/downloads/">here.</a></p> </object> in the above example, application/x-shockwave-flash is the flash mime type, and will invoke the netscape-specific flash architecture in mozilla-based browsers.
...And 15 more matches
How to structure a web form - Learn web development
here is a little example: <form> <fieldset> <legend>fruit juice size</legend> <p> <input type="radio" name="size" id="size_1" value="small"> <label for="size_1">small</label> </p> <p> <input type="radio" name="size" id="size_2" value="medium"> <label for="size_2">medium</label> </p> <p> <input type="radio" name="size" id="size_3" value="large"> <label for="size_3">large</label> </p> </fieldset> </form> note: you can find this example i...
...take this example, which we saw in the previous article: <label for="name">name:</label> <input type="text" id="name" name="user_name"> with the <label> associated correctly with the <input> via its for attribute (which contains the <input> element's id attribute), a screenreader will read out something like "name, edit text".
... <label for="name"> name: <input type="text" id="name" name="user_name"> </label> even in such cases however, it is considered best practice to set the for attribute to ensure all assistive technologies understand the relationship between label and widget.
...And 15 more matches
Gecko info for Windows accessibility vendors
these roles can occur on content because of the new accessible dhtml technology which allows the author to specify the type of document or container.
... these relations can affect the calculation for the next next or previous item of a certain type.
... here is an algorithm for iterating through the nodes, looking for an item of a particular type: store a pointer to the start_item if the current item has a flows_to relation, follow that relation otherwise, go to the next item in depth first search order if the current item matches your criteria, then return current_item if the current_item == start_item, return null (no item found) if the end has been reached, go back to the start if wrapping is desired, otherwise return null (no item found) go to step 2 checkable, required and invalid states are supported gecko defines three state constants using previously unused states: const unsigned long state_checkable = state_marqueed; // useful on menuitem, listitem // and treeitem.
...And 15 more matches
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
*/ /* nspr headers */ #include <prthread.h> #include <plgetopt.h> #include <prerror.h> #include <prinit.h> #include <prlog.h> #include <prtypes.h> #include <plstr.h> /* nss headers */ #include <keyhi.h> #include <pk11priv.h> /* our samples utilities */ #include "util.h" /* constants */ #define blocksize 32 #define modblocksize 128 #define default_key_bits 1024 /* header file constants */ #define enckey_header "-----begin wrapped enckey-----" #define enckey_trailer "-----end wrapped e...
...-begin certificate for signature verification-----" #define ns_cert_vfy_trailer "-----end certificate for signature verification-----" #define ns_sig_header "-----begin signature-----" #define ns_sig_trailer "-----end signature-----" #define ns_cert_header "-----begin certificate-----" #define ns_cert_trailer "-----end certificate-----" /* sample 6 commands */ typedef enum { generate_csr, add_cert_to_db, save_cert_to_header, encrypt, decrypt, sign, verify, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4, pubkey = 5, lab = 6, certenc= 7, certvfy= 8, sig = 9 } headertype; /* * print usage message and exit */ static ...
...y); if (rv != secsuccess) { pr_fprintf(pr_stderr, "problem while vfy_end\n"); goto cleanup; } cleanup: if (infile) { pr_close(infile); } if (vfy) { vfy_destroycontext(vfy, pr_true); } return rv; } /* * write cryptographic parameters to header file */ secstatus writetoheaderfile(const char *buf, unsigned int len, headertype type, prfiledesc *outfile) { secstatus rv; const char *header; const char *trailer; switch (type) { case symkey: header = enckey_header; trailer = enckey_trailer; break; case mackey: header = mackey_header; trailer = mackey_trailer; break; case iv: header = iv_header; ...
...And 15 more matches
nss tech note3
each cert has a "type" and a "key usage", each of which may contain one or more valid values.
... each of the above seccertusages translates into a required set of cert type and key usage for the certificate itself, and into another set of required cert type and key usage for all the ca certs in the cert chain.
... to determine if a cert is valid for a given cert usage, it must have the the cert type and key usage required for that cert usage, and all the ca certs in the cert chain must have the cert type and key usage required for ca certs for that cert usage.
...And 15 more matches
nsIAccessibleText
d 3.0 / seamonkey 2.0) method overview void addselection(in long startoffset, in long endoffset); nsiaccessible getattributerange(in long offset, out long rangestartoffset, out long rangeendoffset); obsolete since gecko 1.9.1 wchar getcharacteratoffset(in long offset); void getcharacterextents(in long offset, out long x, out long y, out long width, out long height, in unsigned long coordtype); long getoffsetatpoint(in long x, in long y, in unsigned long coordtype); void getrangeextents(in long startoffset, in long endoffset, out long x, out long y, out long width, out long height, in unsigned long coordtype); void getselectionbounds(in long selectionnum, out long startoffset, out long endoffset); astring gettext(in long startoffset, in long endoffset); astring gettextafter...
...offset(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); nsipersistentproperties 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 scrollsubstringtopoint(in long startindex, in long endindex, in unsigned long coordinatetype, in long x, in long y); void setselectionbounds(in lo...
...ng selectionnum, in long startoffset, in long endoffset); attributes attribute type description caretoffset long the current current caret offset.
...And 15 more matches
nsIDOMXPathResult
dom/interfaces/xpath/nsidomxpathresult.idlscriptable this interface describes an xpath result returned by nsidomxpathevaluator or document.evaluate inherits from: nsisupports last changed in gecko 1.7 method overview nsidomnode iteratenext(); nsidomnode snapshotitem(in unsigned long index); attributes attribute type description booleanvalue boolean if resulttype is boolean_type, the boolean value.
... numbervalue double if resulttype is number_type, the numeric value of the xpath value.
... resulttype unsigned short the type of result; can be any of the type constants except any_type.
...And 15 more matches
nsISupportsPrimitive
inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description type unsigned short this attribute provides access to the type represented by the nsisupportsprimitive instance.
... constants constant value description type_id 1 corresponding to nsisupportsid.
... type_cstring 2 corresponding to nsisupportscstring.
...And 15 more matches
Declaring and Using Callbacks
in these cases, js-ctypes allows you to pass a regular javascript function as the callback.
...there is no concurrency logic in js-ctypes, so invoking callbacks on other threads will cause things to crash.
... prerequiste understanding abi functiontype declaring callbacks a callback is declared by using ctypes.functiontype.
...And 15 more matches
Document.evaluate() - Web APIs
WebAPIDocumentevaluate
syntax var xpathresult = document.evaluate( xpathexpression, contextnode, namespaceresolver, resulttype, result ); xpathexpression is a string representing the xpath to be evaluated.
... resulttype is an integer that corresponds to the type of result xpathresult to return.
... use named constant properties, such as xpathresult.any_type, of the xpathresult constructor, which correspond to integers from 0 to 9.
...And 15 more matches
SVG documentation index - SVG: Scalable Vector Graphics
WebSVGIndex
3 compatibility sources svg the following sources are used for the compatibility tables on svg elements and attributes: 4 content type needstechnicalreview, svg, types, data types svg makes use of a number of data types.
... this article lists these types along with their syntax and descriptions of what they're used for.
...they specifies some script to run when the event of the given type is dispatched to the element on which the attributes are specified.
...And 15 more matches
Writing JavaScript for XHTML - Archive of obsolete content
in practise, very few xhtml documents are served over the web with the correct mime media type, application/xhtml+xml.
... whilst authored to the stricter rules of xml, they are sent with the media type for html (text/html).
...partially it is because, prior to version 9, internet explorer was incapable of handling xhtml sent with the official xhtml media type at all.
...And 14 more matches
Following the Android Toasts Tutorial from a JNI Perspective
the java code example above can be done with privileged javascript from firefox for android with the following code: window.nativewindow.toast.show("hello, firefox!", "short"); converting java to jni.jsm the first step is to look at the java code and see all the different types, methods, constructors, and fields that are being used.
... in the toast code we have the following: types - context, charsequence, int, toast, and void methods - maketext, show fields - length_short no constructors are used.
... declare the types we will start by declaring the types needed.
...And 14 more matches
certutil
options and arguments running certutil always requires one (and only one) option to specify the type of certificate operation.
... certutil supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new sqlite databases (cert9.db, key4.db, and pkcs11.txt).
... -k rsa|dsa|ec|all specify the type of a key.
...And 14 more matches
JS_NewObject
<jsobject*> proto); // obsolete since spidermonkey 38 jsobject * js_newobject(jscontext *cx, const jsclass *clasp, js::handle<jsobject*> proto, js::handle<jsobject*> parent); jsobject * js_newobjectwithgivenproto(jscontext *cx, const jsclass *clasp, js::handle<jsobject*> proto, js::handle<jsobject*> parent); // added in spidermonkey 1.8 name type description cx jscontext * the context in which to create the new object.
... proto js::handle&lt;jsobject*&gt; pointer to the prototype object to use for the new object.
... the new object will inherit all of the prototype object's properties and methods, and the new object's __proto__ property will be a reference to the prototype object.
...And 14 more matches
Mozilla internal string guide
the string classes distinguish, as part of the type hierarchy, between strings that must have a null-terminator at the end of their buffer (ns[c]string) and strings that are not required to have a null-terminator (nsa[c]string).
...functions taking strings as parameters should generally take one of these four types.
... there are a number of additional string classes: classes which exist primarily as constructors for the other types, particularly nsdependent[c]string and nsdependent[c]substring.
...And 14 more matches
Using Fetch - Web APIs
to extract the json body content from the response, we use the json() method (defined on the body mixin, which is implemented by both the request and response objects.) note: the body mixin also has similar methods to extract other types of body content; see the body section for more.
... mode: 'cors', // no-cors, *cors, same-origin cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached credentials: 'same-origin', // include, *same-origin, omit headers: { 'content-type': 'application/json' // 'content-type': 'application/x-www-form-urlencoded', }, redirect: 'follow', // manual, *follow, error referrerpolicy: 'no-referrer', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url body: json.stringify(data) // body data type must match "content-type...
..." header }); return response.json(); // parses json response into native javascript objects } postdata('https://example.com/answer', { answer: 42 }) .then(data => { console.log(data); // json data parsed by `data.json()` call }); note that mode: "no-cors" only allows a limited set of headers in the request: accept accept-language content-language content-type with a value of application/x-www-form-urlencoded, multipart/form-data, or text/plain sending a request with credentials included to cause browsers to send a request with credentials included, even for a cross-origin call, add credentials: 'include' to the init object you pass to the fetch() method.
...And 14 more matches
Geometry and reference spaces in WebXR - Web APIs
all times and durations in webxr are measured using the domhighrestimestamp type, which is a double-precision floating-point value specifying the time in milliseconds relative to the starting time.
... regardless of the type of reference space you choose, its type is xrreferencespace or is a type derived from xrreferencespace.
... the currently available reference space types, which are defined by the xrreferencespacetype enumeration, are shown below.
...And 14 more matches
XPathResult - Web APIs
since xpath expressions can result in a variety of result types, this interface makes it possible to determine and handle the type and value of the result.
... properties xpathresult.booleanvalueread only a boolean representing the value of the result if resulttype is boolean_type.
...it is true if resulttype is unordered_node_iterator_type or ordered_node_iterator_type and the document has been modified since this result was returned.
...And 14 more matches
HTML attribute reference - HTML: Hypertext Markup Language
attribute list attribute name elements description accept <form>, <input> list of types the server accepts, typically a file type.
... enctype <form> defines the content type of the form data when the method is post.
... formenctype <button>, <input> if the button/input is a submit button (type="submit"), this attribute sets the encoding type to use during form submission.
...And 14 more matches
Indexed collections - JavaScript
this includes arrays and array-like constructs such as array objects and typedarray objects.
... javascript does not have an explicit array data type.
... let arr = array(9.3) // rangeerror: invalid array length if your code needs to create arrays with single elements of an arbitrary data type, it is safer to use array literals.
...And 14 more matches
JavaScript modules - JavaScript
full support 10.3samsung internet android full support 8.0nodejs full support 13.2.0notes full support 13.2.0notes notes modules must either have a filename ending in .mjs, or the nearest parent package.json file must contain "type": "module".
... full support 12.0.0notes disabled notes modules must either have a filename ending in .mjs, or the nearest parent package.json file must contain "type": "module".
... full support 10.3samsung internet android full support 8.0nodejs full support 13.2.0notes full support 13.2.0notes notes modules must either have a filename ending in .mjs, or the nearest parent package.json file must contain "type": "module".
...And 14 more matches
Number - JavaScript
values of other types can be converted to numbers using the number() function.
... the javascript number type is a double-precision 64-bit binary format ieee 754 value, like double in java or c#.
...there is no separate integer type in common everyday use.
...And 14 more matches
Using the WebAssembly JavaScript API - WebAssembly
memory in the low-level memory model of webassembly, memory is represented as a contiguous range of untyped bytes called linear memory that are read and written by load and store instructions inside the module.
... growing memory a memory instance can be grown by calls to memory.prototype.grow(), where again the argument is specified in units of webassembly pages: memory.grow(1); if a maximum value was supplied upon creation of the memory instance, attempts to grow past this maximum will throw a webassembly.rangeerror exception.
... note: since an arraybuffer’s bytelength is immutable, after a successful memory.prototype.grow() operation the buffer getter will return a new arraybuffer object (with the new bytelength) and any previous arraybuffer objects become “detached”, or disconnected from the underlying memory they previously pointed to.
...And 14 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
bal_pref", true); lockpref("mail.identity.id1.reply_to", ""); //imap lockpref("mail.server.server2.hostname", "imap-int.int-evry.fr"); lockpref("mail.server.server2.issecure", true); lockpref("mail.server.server2.login_at_startup", true); lockpref("mail.server.server2.max_cached_connections", 5); //lockpref("mail.server.server2.name", "jehan.procaccia@int-evry.fr"); lockpref("mail.server.server2.type", "imap"); lockpref("mail.server.server2.username", env_user); //smtp lockpref("mail.identity.id1.smtpserver", "smtp1"); lockpref("mail.identity.id1.stationery_folder", "imap://" + env_user + "@imap-int.int-evry.fr/templates"); lockpref("mail.identity.id1.tmpl_folder_picker_mode", "0"); lockpref("mail.identity.id1.valid", true); //smtp general lockpref("mail.smtp.defaultserver", "smtp1"); lockp...
...pref("mail.identity.id1.fullname", userinfo.cn ); defaultpref("mail.identity.id1.smtpserver", "smtp1" ); defaultpref("mail.identity.id1.useremail", userinfo.mail ); // imap server settings defaultpref("mail.server.server1.hostname", "myimap.server.com" ); defaultpref("mail.server.server1.name", userinfo.mail ); defaultpref("mail.server.server1.port", 993 ); defaultpref("mail.server.server1.sockettype", 3 ); defaultpref("mail.server.server1.type", "imap" ); defaultpref("mail.server.server1.username", userinfo.mail ); // smtp server settings defaultpref("mail.smtpserver.smtp1.authmethod", 3 ); defaultpref("mail.smtpserver.smtp1.description", "my company name" ); defaultpref("mail.smtpserver.smtp1.hostname", "mysmtp.server.com" ); defaultpref("mail.smtpserver.smtp1.port", 465 ); defaultpref("ma...
... 3850 01-01-2010 00:00 defaults/profile/bookmarks.html 869 01-01-2010 00:00 defaults/profile/chrome/usercontent-example.css 1165 01-01-2010 00:00 defaults/profile/chrome/userchrome-example.css 366 01-01-2010 00:00 defaults/profile/localstore.rdf 569 01-01-2010 00:00 defaults/profile/mimetypes.rdf 76 01-01-2010 00:00 defaults/preferences/firefox-l10n.js 91656 01-01-2010 00:00 defaults/preferences/firefox.js 1593 01-01-2010 00:00 defaults/preferences/firefox-branding.js 473 01-01-2010 00:00 defaults/profile/prefs.js unlike old thunderbird 8, firefox 8 didn't include prefcalls.js in omni.jar , but other .js files though: [root@arvouin firefox]# jar...
...And 13 more matches
XForms Input Element - Archive of obsolete content
attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control accesskey - used to specify the keyboard shortcut for focusing this control single-node binding special inputmode - not supported for this control incremental - supported.
... mozilla extensions labelposition - only for boolean types: show the label before or after the checkbox (see below) type restrictions the input element can be bound to a node containing simple content of any data type except xsd:base64binary, xsd:hexbinray or any data type derived from these.
... representations the xforms input element can be represented by the following widgets for the spcified data types (or types derived from these data types): text field - the default widget when no type is specified or the data is of type xsd:string (xhtml/xul) checkbox - used for xsd:boolean instance data.
...And 13 more matches
Useful string methods - Learn web development
try entering the following lines: let browsertype = 'mozilla'; browsertype.length; this should return the number 7, because "mozilla" is 7 characters long.
...inside the square brackets you include the number of the character you want to return, so for example to retrieve the first letter you'd do this: browsertype[0]; remember: computers count from 0, not 1!
... to retrieve the last character of any string, we could use the following line, combining this technique with the length property we looked at above: browsertype[browsertype.length-1]; the length of "mozilla" is 7, but because the count starts at 0, the character position is 6; using length-1 gets us the last character.
...And 13 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
put the following content into your moreactions.svelte file: <script> import { createeventdispatcher } from 'svelte' const dispatch = createeventdispatcher() let completed = true const checkall = () => { dispatch('checkall', completed) completed = !completed } const removecompleted = () => dispatch('removecompleted') </script> <div class="btn-group"> <button type="button" class="btn btn__primary" on:click={checkall}>{completed ?
... 'check' : 'uncheck'} all</button> <button type="button" class="btn btn__primary" on:click={removecompleted}>remove completed</button> </div> we've also included a completed variable to toggle between checking and unchecking all tasks.
...> import { createeventdispatcher } from 'svelte' const dispatch = createeventdispatcher() export let todos let completed = true const checkall = () => { dispatch('checkall', completed) completed = !completed } const removecompleted = () => dispatch('removecompleted') $: completedtodos = todos.filter(t => t.completed).length </script> <div class="btn-group"> <button type="button" class="btn btn__primary" disabled={todos.length === 0} on:click={checkall}>{completed ?
...And 13 more matches
Handling common HTML and CSS problems - Learn web development
validation for html, validation involves making sure all your tags are properly closed and nested, you are using a doctype, and you are using tags for their correct purpose.
... in the search packages text field, type "lint" and press enter/return to search for linting-related packages.
... for example: <video id="video" controls preload="metadata" poster="img/poster.jpg"> <source src="video/tears-of-steel-battle-clip-medium.mp4" type="video/mp4"> <source src="video/tears-of-steel-battle-clip-medium.webm" type="video/webm"> <!-- offer download --> <p>your browser does not support html5 video; here is a link to <a href="video/tears-of-steel-battle-clip-medium.mp4">view the video</a> directly.</p> </video> this example includes a simple link allowing you to download the video if even the html5 video player doesn't work,...
...And 13 more matches
Enc Dec MAC Output Public Key as CSR
"-----end pad-----" #define lab_header "-----begin key label-----" #define lab_trailer "-----end key label-----" #define pubkey_header "-----begin pub key -----" #define pubkey_trailer "-----end pub key -----" #define ns_certreq_header "-----begin new certificate request-----" #define ns_certreq_trailer "-----end new certificate request-----" typedef enum { gen_csr, encrypt, decrypt, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4, pubkey = 5, lab = 6 } headertype; /* this is conditionalized because port_errortostring was introduced with nss 3.13.
... an input file and produces\n", "note :"); fprintf(stderr, "%-7s .enc and .header as intermediate output files.\n\n", ""); fprintf(stderr, "%-7s for decrypt, it takes .enc and .header\n", ""); fprintf(stderr, "%-7s as input files and produces as a final output file.\n\n", ""); exit(-1); } /* map option letter enumerated commad type */ static commandtype option2command(const char* c) { switch (*c) { case 'g': return gen_csr; case 'e': return encrypt; case 'd': return decrypt; default: return unknown; } } /* * wrap the symkey using public key */ secstatus wrapkey(pk11symkey* key, seckeypublickey *pubkey, secitem **wrappedkey) { secstatus rv; secitem *data = (secitem *)port_zalloc(sizeof(sec...
... goto cleanup; } rv = pk11_pubwrapsymkey(ckm_rsa_pkcs, pubkey, key, data); if (rv != secsuccess) { rv = secfailure; } else { *wrappedkey = data; return secsuccess; } cleanup: if (data) { secitem_freeitem(data, pr_true); } return rv; } /* * generate a symmetric key */ pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mechanism_type mechanism, int keysize, secitem *keyid, secupwdata *pwdata) { secstatus rv; pk11symkey *key; /* generate the symmetric key */ key = pk11_tokenkeygen(slot, mechanism, null, keysize, keyid, pr_false, pwdata); if (!key) { pr_fprintf(pr_stderr, "symmetric key generation failed \n"); } return key; } /* * macinit */ secstatus ...
...And 13 more matches
JSAPI User Guide
spidermonkey provides a few core javascript data types—numbers, strings, arrays, objects, and so on—and a few methods, such as array.push.
...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.
...the arguments do not have native c++ types like int and float; rather, they are jsvals, javascript values.
...And 13 more matches
SpiderMonkey 1.8.5
many jsapi types, functions, and callback signatures have changed, though most of them still have the same names and do the same things.
... previous versions of spidermonkey supported two types of native functions: jsnative and jsfastnative.
... all support for the slow native function type has been removed, and the fast signature has been renamed to jsnative.
...And 13 more matches
Querying Places
let options = placesutils.history.getnewqueryoptions(); // no query parameters will return everything let query = placesutils.history.getnewquery(); // execute the query let result = placesutils.history.executequery(query, options); result types nsinavhistoryqueryoptions has a resulttype property that allows configuration of the grouping and level of detail to be returned in the results.
... results_as_uri: this is the default, and returns one result node of type result_type_uri for each uri that matches the query.
...the nodes are of type result_type_visit, and provide a session id for each visit.
...And 13 more matches
nsIPluginHost
nsiplugin getplugin(in string amimetype); native code only!
... void getplugincount(out unsigned long aplugincount); obsolete since gecko 1.8 nsiplugin getpluginfactory(in string amimetype); native code only!
... void instantiateembeddedplugin(in string amimetype, in nsiuri aurl, in nsiplugininstanceowner aowner); native code only!
...And 13 more matches
Reference Manual
safety features type safeguards it is an invariant of nscomptr that it holds the xpcom-correct interface pointer for it's underlying type.
... nscomptr<nsifoo> foo = bar; // ns_assertion: "queryinterface needed" // ...even assuming you can get the line to compile // (either by casting, or because the types are related by c ) this invariant is relaxed for nscomptr<nsisupports>.
... like nsisupports* (or even void*), people generally use nscomptr<nsisupports> to mean "any xpcom interface." it would be annoying if nscomptr forced you to queryinterface to the xpcom-correct nsisupports within an object in places where you don't care to know the exact type.
...And 13 more matches
Signaling and video calling - Web APIs
the server supports several message types to handle tasks, such as registering new users, setting usernames, and sending public chat messages.
...we'll have to allow directing messages to one specific user instead of broadcasting to all connected users, and ensure unrecognized message types are passed through and delivered, without the server needing to know what they are.
... as the existing code allows the sending of arbitrary message types, no additional changes are required.
...And 13 more matches
HTML attribute: accept - HTML: Hypertext Markup Language
the accept attribute takes as its value a comma-separated list of one or more file types, or unique file type specifiers, describing which file types to allow.
... the accept property is an attribute of the file <input> type.
... because a given file type may be identified in more than one manner, it's useful to provide a thorough set of type specifiers when you need files of specific type, or use the wild card to denote a type of any format is acceptable.
...And 13 more matches
Error - JavaScript
see below for standard built-in error types.
... error types besides the generic error constructor, there are seven other core error constructors in javascript.
... typeerror creates an instance representing an error that occurs when a variable or parameter is not of a valid type.
...And 13 more matches
Intl.Locale - JavaScript
extension tags hold information about locale aspects such as calendar type, clock type, and numbering system type.
... instance properties intl.locale.prototype.basename returns basic, core information about the locale in the form of a substring of the complete data string.
... intl.locale.prototype.calendar returns the part of the locale that indicates the locale's calendar era.
...And 13 more matches
Enhanced Extension Installation - Archive of obsolete content
items that are installed must be visible in the extension manager user interface, even if the extension type is just an integration hook that has no meaningful ui presence.
...the model looks something like this: nsextensionsdatasource.prototype = { _composite // the composite that manages the two // datasources at the install locations for // read-only information requests _profileextensions // the rdf/xml datasource for the items at the // profile install location _globalextensions // the rdf/xml datasource for the it...
...rather, if the system needs to know where an item is located, it checks to see if the item is a member of the the appropriate type container (urn:mozilla:extension:root or urn:mozilla:theme:root) in each of the two datasources.
...And 12 more matches
JavaScript Client API - Archive of obsolete content
this involves writing types that extend the store, tracker, and record types as well.
... the skeleton of a sample record implementation: function foorecord(collection, id) { cryptowrapper.call(this, collection, id); } foorecord.prototype = { __proto__: cryptowrapper.prototype, _logname: "record.foo", ttl: foo_ttl, // optional get bar() this.cleartext.bar, set bar(value) { this.cleartext.bar = value; }, get baz() this.cleartext.baz, set baz(value) { this.cleartext.baz = value; } }; to save all that typing for declaring the getters and setters, you can also use utils.defergetset: function foorecord(co...
...llection, id) { cryptowrapper.call(this, collection, id); } foorecord.prototype = { __proto__: cryptowrapper.prototype, _logname: "record.foo", ttl: foo_ttl // optional }; utils.defergetset(foorec, "cleartext", ["bar", "baz"]); the store object the store object (which extends store, as defined in services/sync/modules/engines.js) has the job of creating and maintaining a set of record objects from the underlying data.
...And 12 more matches
prefpane - Archive of obsolete content
ted, 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"/> ...
...</prefpane> attributes helpuri type: uri the uri of the help page associated with a preference panel.
... image type: uri the uri of the image to appear on the element.
...And 12 more matches
The First Install Problem - Archive of obsolete content
if this happens, gecko-based browsers often won't be able to discover the plugin, and will prompt the user to download the plugin again if the affiliated mime type is encountered on the web.
...note that myapplication consists of one dll (which is an npapi plugin handling a given mimetype -- say application/x-myapp) and one xpt file, for scriptable interfaces.
... example: [hkey_local_machine\software\mozillaplugins\@mycompany.com/myapplication,version=5.01] version=5.01 mimetypes -- this is a subkey and contains individual mimetypes as further subkeys.
...And 12 more matches
The box model - Learn web development
block and inline boxes in css we broadly have two types of boxes — block boxes and inline boxes.
... padding, margin and border will cause other elements to be pushed away from the box unless we decide to change the display type to inline, elements such as headings (e.g.
... <h1>) and <p> all use block as their outer display type by default.
...And 12 more matches
Styling lists - Learn web development
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.
... the <dd> elements have margin-left of 40px (2.5em.) the <p> elements we've included for reference have a top and bottom margin of 16px (1em), the same as the different list types.
... rules 2 and 3 set relative font sizes for the headings, different list types (the children of the list elements inherit these), and paragraphs.
...And 12 more matches
NSS functions
the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references.
...the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references.
...the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references.
...And 12 more matches
NSS tools : ssltap
MozillaProjectsNSStoolsssltap
type = 22 (handshake) version = { 3,0 } length = 997 (0x3e5) handshake { 0: 02 00 00 46 |...f type = 2 (server_hello) length = 70 (0x000046) serverhello { server_version = {3, 0} random = {...} 0: 77 8c 6e 26 6c 0c ec c0 d9 58 4f 47 d3 2d 01 45 | wn&l.ì..xog.-.e 10: 5c 17 75 43 ...
... } cipher_suite = (0x0003) ssl3/rsa/rc4-40/md5 } 0: 0b 00 02 c5 |...Å type = 11 (certificate) length = 709 (0x0002c5) certificatechain { chainlength = 706 (0x02c2) certificate { size = 703 (0x02bf) data = { saved in file 'cert.001' } } } 0: 0c 00 00 ca |....
... type = 12 (server_key_exchange) length = 202 (0x0000ca) 0: 0e 00 00 00 |....
...And 12 more matches
SpiderMonkey Internals
design walk-through at heart, spidermonkey is a fast interpreter that runs an untyped bytecode and operates on values of type js::value—type-tagged values that represent the full range of javascript values.
... some spidermonkey bytecode operations have many special cases, depending on the type of their arguments.
... all state associated with an interpreter instance is passed through formal parameters to the interpreter entry point; most implicit state is collected in a type named jscontext.
...And 12 more matches
Shell global objects
this is what debugger.source.prototype.elementattributename returns.
...this is what debugger.source.prototype.elementattributename returns.
... objectemulatingundefined() return a new object obj for which typeof obj === "undefined", obj == null and obj == undefined (and vice versa for !=), and toboolean(obj) === false.
...And 12 more matches
Component Internals
the most common type of component is one that is written in c++ and compiled into a shared library (a dll on a windows system or a dso on unix).
... xpcom finds and processes the type library manifest (see type library manifests below).
... component manifests and type library manifests are described in the following section, xpcom registry manifests.
...And 12 more matches
nsIHTMLEditor
text(in astring ainputstring, in astring acontextstr, in astring ainfostr, in astring aflavor, in nsidomdocument asourcedoc, in nsidomnode adestinationnode, in long adestinationoffset, in boolean adeleteselection); void insertlinkaroundselection(in 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 removealldefaultproperties(); void removeallinlineproperties(); void removedefaultproperty(in nsiatom aproperty, in astring aattribute, in astri...
...ng avalue); void removeinlineproperty(in nsiatom aproperty, in astring aattribute); void removeinsertionlistener(in nsicontentfilter infilter); void removelist(in astring alisttype); void replaceheadcontentswithhtml(in astring asourcetoinsert); void selectelement(in nsidomelement aelement); void setbackgroundcolor(in astring acolor); void setbodyattribute(in astring aattr, in astring avalue); void setcaretafterelement(in nsidomelement aelement); void setcssinlineproperty(in nsiatom aproperty, in astring aattribute, in astring avalue); void setdocumenttitle(in astring atitle); void setinlineproperty(in nsiatom aproperty, in astring aattribute, in astring avalue); void setparagraphformat(i...
...n astring aparagraphformat); void updatebaseurl(); attributes attribute type description iscssenabled boolean a boolean which is true is the htmleditor has been instantiated with css knowledge and if the css pref is currently checked.
...And 12 more matches
Using files from web applications - Web APIs
this selection can be done by either using an html <input type="file"> element or by drag and drop.
... accessing selected file(s) consider this html: <input type="file" id="input" multiple> the file api makes it possible to access a filelist containing file objects representing the files selected by the user.
... type the mime type of the file as a read-only string or "" if the type couldn't be determined.
...And 12 more matches
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.
...you can use type="audio/mp4".
... we do this using the <source> element, which takes the attributes src and type.
...And 12 more matches
HTML attribute: rel - HTML: Hypertext Markup Language
WebHTMLAttributesrel
the type of relationships is given by the value of the rel attribute, which, if present, must have a value that is an unordered set of unique space-separated keywords, which are listed in the following table.
... values if there are multiple <link rel="icon">s, the browser uses their media attribute, type, and sizes attributes to select the most appropriate icon.
... note: apple's ios does not use this link type, nor the sizes attribute, like others mobile browsers do, to select a webpage icon for web clip or a start-up placeholder.
...And 12 more matches
event/core - Archive of obsolete content
an event listener may be registered to any event target using the on function: var { on, once, off, emit } = require('sdk/event/core'); var target = { name: 'target' }; on(target, 'message', function listener(event) { console.log('hello ' + event); }); on(target, 'data', console.log); an event of a specific type may be emitted on any event target object using the emit function.
... this will call all registered listeners for the given type on the given event target in the same order they were registered.
... emit(target, 'message', 'event'); // info: 'hello event' emit(target, 'data', { type: 'data' }, 'second arg'); // info: [object object] 'second arg' registered event listeners may be removed using off function: off(target, 'message'); emit(target, 'message', 'bye'); // info: 'hello bye' sometimes listener only cares about first event of specific type.
...And 11 more matches
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
listing 1: calling xpcom functions using xpconnect <?xml version="1.0" encoding="utf-8"?> <page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript"><![cdata[ var ioservice = components.classes['@mozilla.org/network/io-service;1'] .getservice(components.interfaces.nsiioservice); alert(ioservice); ]]></script> </page> calling xpconnect using local files try saving the contents of listing 1 as the file test.xul, somewhere on your desktop, and drag and drop it into firefox to open it.
... passing the name of the window type as the parameter of the nsiwindowmediator.getmostrecentwindow() method returns the most recently active window from among the root element's windows with that type set for the windowtype attribute value.
... active browser window netscape.security.privilegemanager .enableprivilege('universalxpconnect'); var windowmediator = components .classes['@mozilla.org/appshell/window-mediator;1'] .getservice(components.interfaces.nsiwindowmediator); var browser = windowmediator.getmostrecentwindow('navigator:browser'); alert(browser.gbrowser.mtabs.length); get overview of all windows with a certain type use the nsiwindowmediator.getenumerator() method to get an overview of all windows that have a certain type.
...And 11 more matches
findbar - Archive of obsolete content
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.
... findnextaccesskey 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.
...And 11 more matches
iframe - Archive of obsolete content
attributes showcaret, src, type, transparent properties accessibletype, contentdocument, contentwindow, docshell, webnavigation examples <iframe src="table.php" flex="2" id="browsertable" name="table_frame"/> selecting an url from a menu <menulist oncommand="donav(this);"> <menupopup> <menuitem label="mozilla" value="http://mozilla.org" /> <menuitem label="slashdot" value="http://slashdot.org"/> <menuitem ...
...label="sourceforge" value="http://sf.net" /> <menuitem label="freshmeat" value="http://freshmeat.net"/> </menupopup> </menulist> <iframe id="myframe" flex="1"/> <script> function donav(obj) { var url = obj.selecteditem.value; // note the firstchild is the menupopup element document.getelementbyid('myframe').setattribute('src', url); } </script> attributes showcaret type: boolean whether or not to cause a typing caret to be visible in the content area.
... src type: uri the uri of the content to appear in the element.
...And 11 more matches
notification - Archive of obsolete content
attributes image, label, priority, persistence, type, value properties accessibletype, control, image, label, priority, persistence, type, value methods close examples <notification label="this is a warning"/> attributes image type: uri the uri of the image to appear on the element.
... label type: string the label that will appear on the element.
... persistence type: integer the persistence may be set to a non-zero value so that the notificationbox's removetransientnotifications method does not remove them.
...And 11 more matches
Browser Detection and Cross Browser Support - Archive of obsolete content
an implicit assumption by many web authors around this time was the there were only two types of browser available...
...if (document.all) { // internet explorer 4+ document.write('<link rel="stylesheet" type="text/css" src="style-ie.css">'); } else if (document.layers) { // navigator 4 document.write('<link rel="stylesheet" type="text/css" src="style-nn.css">'); } note how the above example only provided stylesheets for internet explorer and navigator 4 and even then only if the visitor has javascript support turned on in their browser.
...many sites keyed off of the existence of the string netscape6 in the user agent and used tests similar to: if (navigator.useragent.indexof('netscape6') != -1) { // netscape 6 code } note how this type of detection misses any other gecko based browser.
...And 11 more matches
Mozilla XForms User Interface - Archive of obsolete content
we use the data type of the instance node that the form control is bound to as a clue when making a rendering decision.
...for example, a xforms input control may appear as a text field or as a datepicker depending on whether it is bound to a xsd:string type or a xsd:date type.
... when a xf:output binds to a node that has a type of xsd:date, we output the date value as plain text.
...And 11 more matches
Displaying Places information using views
places provides the following built-in views: tree menu toolbar instantiating the three built-in views are simply standard xul elements with a special type attribute whose value is "places".
... every xul document containing a built-in view must import the stylesheet browser/components/places/content/places.css and overlay the file browser/components/places/content/placesoverlay.xul: <?xml-stylesheet href="chrome://browser/content/places/places.css" ?> <?xul-overlay href="chrome://browser/content/places/placesoverlay.xul" ?> it's this stylesheet that binds elements with the special type attribute to one of the views.
... <tree type="places" place="place:terms=mozilla&amp;onlybookmarked=1&amp;querytype=1"> <treecols> <treecol id="title" label="my bookmarks" flex="1" primary="true" /> </treecols> <treechildren /> </tree> the next example does the same as the last but uses javascript to set the tree's place attribute: var histserv = cc["@mozilla.org/browser/nav-history-service;1"].
...And 11 more matches
NSS tools : ssltab
type = 22 (handshake) version = { 3,0 } length = 997 (0x3e5) handshake { 0: 02 00 00 46 |...f type = 2 (server_hello) length = 70 (0x000046) serverhello { server_version = {3, 0} random = {...} 0: 77 8c 6e 26 6c 0c ec c0 d9 58 4f 47 d3 2d 01 45 | wn&l.ì..xog.-.e 10: 5c 17 75 43 a7 4c 88 c7 88 64 3c 50 41 48 4f 7f | \.uc§l.Ç.d<paho.
...} cipher_suite = (0x0003) ssl3/rsa/rc4-40/md5 } 0: 0b 00 02 c5 |...Å type = 11 (certificate) length = 709 (0x0002c5) certificatechain { chainlength = 706 (0x02c2) certificate { size = 703 (0x02bf) data = { saved in file 'cert.001' } } } 0: 0c 00 00 ca |....
... type = 12 (server_key_exchange) length = 202 (0x0000ca) 0: 0e 00 00 00 |....
...And 11 more matches
NSS tools : ssltap
type = 22 (handshake) version = { 3,0 } length = 997 (0x3e5) handshake { 0: 02 00 00 46 |...f type = 2 (server_hello) length = 70 (0x000046) serverhello { server_version = {3, 0} random = {...} 0: 77 8c 6e 26 6c 0c ec c0 d9 58 4f 47 d3 2d 01 45 | wn&l.ì..xog.-.e 10: 5c 17 75 43 a7 4c 88 c7 88 64 3c 50 41 48 4f 7f | \.uc§l.Ç.d<paho.
...} cipher_suite = (0x0003) ssl3/rsa/rc4-40/md5 } 0: 0b 00 02 c5 |...Å type = 11 (certificate) length = 709 (0x0002c5) certificatechain { chainlength = 706 (0x02c2) certificate { size = 703 (0x02bf) data = { saved in file 'cert.001' } } } 0: 0c 00 00 ca |....
... type = 12 (server_key_exchange) length = 202 (0x0000ca) 0: 0e 00 00 00 |....
...And 11 more matches
Starting WebLock
the two functions look like this: static ns_method weblockregistration(nsicomponentmanager *acompmgr, nsifile *apath, const char *registrylocation, const char *componenttype, const nsmodulecomponentinfo *info); static ns_method weblockunregistration(nsicomponentmanager *acompmgr, nsifile *apath, const char *registrylocation, const nsmodulecomponentinfo *info); the names of the functions can be anything you wish.
...isupports1(weblock, nsiobserver); ns_imethodimp weblock::observe(nsisupports *asubject, const char *atopic, const prunichar *adata) { return ns_ok; } static ns_method weblockregistration(nsicomponentmanager *acompmgr, nsifile *apath, const char *registrylocation, const char *componenttype, const nsmodulecomponentinfo *info) { nsresult rv; nscomptr<nsiservicemanager> servman = do_queryinterface((nsisupports*)acompmgr, &rv); if (ns_failed(rv)) return rv; nscomptr<nsicategorymanager> catman; rv = servman->getservicebycontractid(ns_categorymanager_contractid, ns_get_iid(nsicategorymanager), ...
... instead of starting with the implementation, developers use xpidl (see xpidl and type libraries for more information about xpidl) to define the interface to the component: how the functionality should be organized, expressed, and exposed to its clients.
...And 11 more matches
nsIWindowsRegKey
method overview void close(); void create(in unsigned long rootkey, in astring relpath, in unsigned long mode); nsiwindowsregkey createchild(in astring relpath, in unsigned long mode); astring getchildname(in unsigned long index); astring getvaluename(in unsigned long index); unsigned long getvaluetype(in astring name); boolean haschanged(); boolean haschild(in astring name); boolean hasvalue(in astring name); boolean iswatching(); void open(in unsigned long rootkey, in astring relpath, in unsigned long mode); nsiwindowsregkey openchild(in astring relpath, in unsigned long mode); acstring readbinaryvalue(in astring name); u...
...e); void startwatching(in boolean recurse); void stopwatching(); void writebinaryvalue(in astring name, in acstring data); void writeint64value(in astring name, in unsigned long long data); void writeintvalue(in astring name, in unsigned long data); void writestringvalue(in astring name, in astring data); attributes attribute type description childcount unsigned long this attribute returns the number of child keys.
...this interface is not restricted to using only these access types.
...And 11 more matches
Debugger.Script - Firefox Developer Tools
accessor properties of the debugger.script prototype object a debugger.script instance inherits the following accessor properties from its prototype: isgeneratorfunction true if this instance refers to a jsscript for a function defined with a function* expression or statement.
...for example: function h() { var i = function() {}; // display name: h/i f(function () {}); // display name: h/< } var s = f(function () {}); // display name: s< if the instance refers to webassembly code, throw a typeerror.
...for function.prototype’s script, this is null.
...And 11 more matches
DevTools API - Firefox Developer Tools
showtoolbox(target [, toolid [, hosttype [, hostoptions]]]) opens a toolbox for given target either by creating a new one or activating an existing one.
... hosttype {string} - the position the toolbox will be placed.
...see hosttype for details.
...And 11 more matches
Index - Firefox Developer Tools
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.
...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".
...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.
...And 11 more matches
DataTransfer - Web APIs
it may hold one or more data items, each of one or more data types.
... properties standard properties datatransfer.dropeffect gets the type of drag-and-drop operation currently selected or sets the operation to a new type.
... datatransfer.effectallowed provides all of the types of operations that are possible.
...And 11 more matches
filter - CSS: Cascading Style Sheets
WebCSSfilter
filter: brightness(2) <svg style="position: absolute; top: -99999px" xmlns="http://www.w3.org/2000/svg"> <filter id="brightness"> <fecomponenttransfer> <fefuncr type="linear" slope="[amount]"/> <fefuncg type="linear" slope="[amount]"/> <fefuncb type="linear" slope="[amount]"/> </fecomponenttransfer> </filter> </svg> <table class="standard-table"> <thead> <tr> <th style="text-align: left;" scope="col">original image</th> <th style="text-align: left;" scope="col">live example</th> <th style="text-align: left;" scope="...
...files/3708/test_form.jpg" style="width: 100%;" /></td> <td><img alt="test_form.jpg" id="img2" class="internal default" src="/files/3708/test_form.jpg" style="width: 100%;" /></td> <td><div class="svg-container"><svg xmlns="http://www.w3.org/2000/svg" id="img3" viewbox="0 0 286 217" color-interpolation-filters="srgb"> <filter id="brightness"> <fecomponenttransfer> <fefuncr type="linear" slope="2"/> <fefuncg type="linear" slope="2"/> <fefuncb type="linear" slope="2"/> </fecomponenttransfer> </filter> <image xlink:href="/files/3708/test_form.jpg" filter="url(#brightness)" width="286px" height="217px" /> </svg><div></td> <td><img alt="test_form_s.jpg" id="img4" class="internal default" src="/files/3709/test_form_s.jpg" style="width: 100%;" /><...
... filter: contrast(200%) <svg style="position: absolute; top: -99999px" xmlns="http://www.w3.org/2000/svg"> <filter id="contrast"> <fecomponenttransfer> <fefuncr type="linear" slope="[amount]" intercept="-(0.5 * [amount]) + 0.5"/> <fefuncg type="linear" slope="[amount]" intercept="-(0.5 * [amount]) + 0.5"/> <fefuncb type="linear" slope="[amount]" intercept="-(0.5 * [amount]) + 0.5"/> </fecomponenttransfer> </filter> </svg> <table class="standard-table"> <thead> <tr> <th style="text-align: left;" scope="col">original image</th> ...
...And 11 more matches
Constraint validation - Developer guides
html5 introduced new mechanisms for forms: it added new semantic types for the <input> element and constraint validation to ease the work of checking the form content on the client side.
... intrinsic and basic constraints in html5, basic constraints are declared in two ways: by choosing the most semantically appropriate value for the type attribute of the <input> element, e.g., choosing the email type automatically creates a constraint that checks whether the value is a valid e-mail address.
... semantic input types the intrinsic constraints for the type attribute are: input type constraint description associated violation <input type="url"> the value must be an absolute url, as defined in the url living standard.
...And 11 more matches
Cross-Origin Resource Sharing (CORS) - HTTP
WebHTTPCORS
web fonts (for cross-domain font usage in @font-face within css), so that servers can deploy truetype fonts that can only be cross-site loaded and used by web sites that are permitted to do so.
...additionally, for http request methods that can cause side-effects on server data (in particular, http methods other than get, or post with certain mime types), the specification mandates that browsers "preflight" the request, soliciting supported methods from the server with the http options request method, and then, upon "approval" from the server, sending the actual request.
...ead post apart from the headers automatically set by the user agent (for example, connection, user-agent, or the other headers defined in the fetch spec as a “forbidden header name”), the only headers which are allowed to be manually set are those which the fetch spec defines as a “cors-safelisted request-header”, which are: accept accept-language content-language content-type (but note the additional requirements below) dpr downlink save-data viewport-width width the only allowed values for the content-type header are: application/x-www-form-urlencoded multipart/form-data text/plain no event listeners are registered on any xmlhttprequestupload object used in the request; these are accessed using the xmlhttprequest.upload property.
...And 11 more matches
Map - JavaScript
an object has a prototype, so it contains default keys that could collide with your own keys if you're not careful.
... key types a map's keys can be any value (including functions, objects, or any primitive).
... instance properties map.prototype.size returns the number of key/value pairs in the map object.
...And 11 more matches
new operator - JavaScript
the new operator lets developers create an instance of a user-defined object type or of one of the built-in object types that has a constructor function.
... syntax new constructor[([arguments])] parameters constructor a class or function that specifies the type of the object instance.
... creating a user-defined object requires two steps: define the object type by writing a function.
...And 11 more matches
OpenSearch description format
<opensearchdescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/"> <shortname>[snk]</shortname> <description>[search engine full name and summary]</description> <inputencoding>[utf-8]</inputencoding> <image width="16" height="16" type="image/x-icon">[https://example.com/favicon.ico]</image> <url type="text/html" template="[searchurl]"> <param name="[key name]" value="{searchterms}"/> <!-- other params if you need them… --> <param name="[other key name]" value="[parameter value]"/> </url> <url type="application/x-suggestions+json" template="[suggestionurl]"/> <moz:searchform>[https://example.com/search]</m...
...when possible, include a 16×16 image of type image/x-icon (such as /favicon.ico) and a 64×64 image of type image/jpeg or image/png.
...(you can generate a data: uri from an icon file at the data: uri kitchen.) <image height="16" width="16" type="image/x-icon">https://example.com/favicon.ico</image> <!-- or --> <image height="16" width="16">data:image/x-icon;base64,aaabaaeaebaaa … daaa=</image> firefox caches the icon as a base64 data: uri (search plug-ins are stored in the profile's searchplugins/ folder).
...And 11 more matches
Using XPInstall to Install Plugins - Archive of obsolete content
plugins can consist of the following types of files, all of which can be installed via an xpi package: shared libraries (i.e.
...many plugins are part of additional software for media types.
...often, the smartupdate download was triggered via the pluginurl attribute of the embed tag: <embed type="application/x-randomtype" src="myfile.typ" width="50" height="50" pluginurl="http://mytypecompany.xyz/jarpacks/mytypeplugin.jar"></embed> in the example above, the pluginurl attribute points to the signed jar file, which netscape communicator 4.x would then download (subject to the security dialog boxes) if the plugin was not located on the user's machine.
...And 10 more matches
Filtering - Archive of obsolete content
generating a filter menu templates may be used to generate any type of content.
...the syntax is the same regardless of what type of content is being created.
...or, we could use an rdf type to specify the countries.
...And 10 more matches
notificationbox - Archive of obsolete content
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties currentnotification type: notification element the currently displayed notification element or null.
... allnotifications type: nodelist nodelist of all notifications.
... notificationshidden type: boolean indicating whether the notification area should be hidden.
...And 10 more matches
richlistitem - Archive of obsolete content
attributes disabled, searchlabel, selected, tabindex, value properties accessible, control, disabled, label, selected, tabindex, value examples (example needed) attributes disabled type: boolean indicates whether the element is disabled or not.
... searchlabel type: string text used for 'find-as-you-type' (fayt) searching.
... selected type: boolean indicates whether the element is selected or not.
...And 10 more matches
Styling web forms - Learn web development
type text, url, email...), except for <input type="search">.
... multi-line <textarea>s buttons (both <input> and <button>s) <label> <output> the bad some elements are more difficult to style, requiring more complex css or some more specific tricks: checkboxes and radio buttons <input type="search"> we describe how to handle these more specific features in the article advanced form styling.
...these include: <input type="color"> date-related controls such as <input type="datetime-local"> <input type="range"> <input type="file"> elements involved in creating dropdown widgets, including <select>, <option>, <optgroup> and <datalist>.
...And 10 more matches
Video and audio content - Learn web development
as we talked about before, different browsers support different video and audio formats, and different container formats (like mp3, mp4, and webm, which in turn can contain different types of video and audio).
...for example, for some types of audio, a codec's data is often stored without a container, or with a simplified container.
...see choosing the right container in media container formats (file types) for help selecting the container file format best suited for your needs; similarly, see choosing a video codec in web video codec guide and choosing an audio codec in web audio codec guide for help selecting the first media codecs to use for your content and your target audience.
...And 10 more matches
NSS Sample Code Sample_3_Basic Encryption and MACing
sample code 3 /* nspr headers */ #include <prthread.h> #include <plgetopt.h> #include <prerror.h> #include <prinit.h> #include <prlog.h> #include <prtypes.h> #include <plstr.h> /* nss headers */ #include <keyhi.h> #include <pk11priv.h> /* our samples utilities */ #include "util.h" #define buffersize 80 #define digestsize 16 #define ptext_mac_buffer_size 96 #define ciphersize 96 #define blocksize 32 #define cipher_header "-----begin cipher-----" #define cipher_trailer "-----end cipher-----" #define enckey_header "-----begin aeskey ckaid-----" #define enckey_trailer "-----end aeskey ckaid-----" #...
... "-----begin mackey ckaid-----" #define mackey_trailer "-----end mackey ckaid-----" #define iv_header "-----begin iv-----" #define iv_trailer "-----end iv-----" #define mac_header "-----begin mac-----" #define mac_trailer "-----end mac-----" #define pad_header "-----begin pad-----" #define pad_trailer "-----end pad-----" typedef enum { encrypt, decrypt, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4 } headertype; /* print a usage message and exit */ static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -c <a|b> -d <dbdirpath> [-z <noisefilename>] " "[-p <dbpwd> | -f <dbpwdfile>] -i <ipfilename> -o <opfilen...
...*/ /* nspr headers */ #include <prthread.h> #include <plgetopt.h> #include <prerror.h> #include <prinit.h> #include <prlog.h> #include <prtypes.h> #include <plstr.h> /* * gather a cka_id */ secstatus gathercka_id(pk11symkey* key, secitem* buf) { secstatus rv = pk11_readrawattribute(pk11_typesymkey, key, cka_id, buf); if (rv != secsuccess) { pr_fprintf(pr_stderr, "pk11_readrawattribute returned (%d)\n", rv); pr_fprintf(pr_stderr, "could not read symkey cka_id attribute\n"); return rv; } return r...
...And 10 more matches
ssltyp.html
upgraded documentation may be found in the current nss reference selected ssl types and structures chapter 3 selected ssl types and structures this chapter describes some of the most important types and structures used with the functions described in the rest of this document, and how to manage the memory used for them.
... additional types are described with the functions that use them or in the header files.
... types and structures managing secitem memory types and structures these types and structures are described here: certcertdbhandle certcertificate pk11slotinfo secitem seckeyprivatekey secstatus additional types used by a single function only are described with the function's entry in each chapter.
...And 10 more matches
NSS Tools ssltap
syntax to run the ssl debugging tool, type this command in a command shell: ssltap [-vhfsxl] [-p port] hostname:port options the command does not require any options other than hostname:port, but you normally use them to control the connection interception and output.
... type = 22 (handshake) version = { 3,0 } length = 997 (0x3e5) handshake { 0: 02 00 00 46 |...f type = 2 (server_hello) length = 70 (0x000046) serverhello { server_version = {3, 0} random = {...} 0: 77 8c 6e 26 6c 0c ec c0 d9 58 4f 47 d3 2d 01 45 |wn&amp;l.ì..xog.-.e 10: 5c 17 75 43 a7 4c 88 c7 88 64 3...
... } cipher_suite = (0x0003) ssl3/rsa/rc4-40/md5 } 0: 0b 00 02 c5 |...Å type = 11 (certificate) length = 709 (0x0002c5) certificatechain { chainlength = 706 (0x02c2) certificate { size = 703 (0x02bf) data = { saved in file 'cert.001' } } } 0: 0c 00 00 ca |....
...And 10 more matches
JS_ConvertValue
converts a javascript value to a value of a specific javascript type.
... syntax bool js_convertvalue(jscontext *cx, js::handlevalue v, jstype type, js::mutablehandlevalue vp); name type description cx jscontext * the context in which to perform the conversion.
... type jstype the type to which the value is to be converted.
...And 10 more matches
imgIContainer
nsiframe getrootlayoutframe(); violates the xpcom interface guidelines pruint16 gettype(); violates the xpcom interface guidelines void init(in print32 awidth, in print32 aheight, in imgicontainerobserver aobserver); obsolete since gecko 2.0 void lockimage(); void removeframe(in gfxiimageframe item); obsolete since gecko 1.9.2 void requestdecode(); void requestdiscard(); void requestrefresh([const] in timestamp atime); violat...
... obsolete since gecko 2.0 void setdiscardable(in string amimetype); native code only!
...ete since gecko 2.0 void setframehasnoalpha(in unsigned long framenumber); obsolete since gecko 2.0 void setframetimeout(in unsigned long framenumber, in print32 atimeout); obsolete since gecko 2.0 void startanimation(); obsolete since gecko 2.0 void stopanimation(); obsolete since gecko 2.0 void unlockimage(); attributes attribute type description animated boolean whether this image is animated.
...And 10 more matches
nsINavHistoryResultNode
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) attributes attribute type description accesscount unsigned long total number of times the uri has been accessed.
... bookmarkindex long when this item is in a bookmark folder (its parent is of type folder), this is the index into that folder at which this node resides.
...for hosts, or other node types with children, this is the most recent access time for any of the children.
...And 10 more matches
nsIVariant
xpcom/ds/nsivariant.idlscriptable xpconnect has magic to transparently convert between nsivariant and js types.
...but we mark all the methods and attributes [noscript] since any nsivariant object will be automatically converted to a js type anyway.
... nsresult getasarray(out pruint16 type, out nsiid iid, out pruint32 count, out voidptr ptr); violates the xpcom interface guidelines astring getasastring(); native code only!
...And 10 more matches
Working with ArrayBuffers
introductory reading the pointer types section of the type conversion page explains the fundamentals of this operation.
...the js-ctypes equivalent is a ctypes.uint8_t.array(###) (ctypes.unsigned_char are also ctypes.uint8_t).
... this feature is based on the following work: //github.com/realityripple/uxp/blob/master/js/src/ctypes/ctypes.cpp#3080 //github.com/realityripple/uxp/blob/master/js/src/vm/arraybufferobject.cpp#1301 example 1 - image data the following example illustrates how to transfer a byte array pointed by ctypes.uint8_t.ptr to imagedata of canvas.
...And 10 more matches
The JavaScript input interpreter - Firefox Developer Tools
single-line mode for single-line entry, you can type javascript expressions in the field at the bottom of the console log, at the >> prompt.
... to enter expressions in single-line mode, type at the prompt and press enter.
... the expression you type is echoed under the input prompt, followed by the result.
...And 10 more matches
Blob - Web APIs
WebAPIBlob
instance properties blob.prototype.size read only the size, in bytes, of the data contained in the blob object.
... blob.prototype.type read only a string indicating the mime type of the data contained in the blob.
... if the type is unknown, this string is empty.
...And 10 more matches
EventTarget.addEventListener() - Web APIs
addeventlistener() works by adding a function or an object that implements eventlistener to the list of event listeners for the specified event type on the eventtarget on which it's called.
... syntax target.addeventlistener(type, listener [, options]); target.addeventlistener(type, listener [, usecapture]); target.addeventlistener(type, listener [, usecapture, wantsuntrusted ]); // gecko/mozilla only parameters type a case-sensitive string representing the event type to listen for.
... listener the object that receives a notification (an object that implements the event interface) when an event of the specified type occurs.
...And 10 more matches
KeyboardEvent() - Web APIs
syntax event = new keyboardevent(typearg, keyboardeventinit); values typearg is a domstring representing the name of the event.
... keyboardeventinitoptional is a keyboardeventinit dictionary, having the following fields: "key", optional and defaulting to "", of type domstring, that sets the value of keyboardevent.key.
... "code", optional and defaulting to "", of type domstring, that sets the value of keyboardevent.code.
...And 10 more matches
MouseEvent() - Web APIs
syntax event = new mouseevent(typearg, mouseeventinit); values typearg is a domstring representing the name of the event.
... mouseeventinit optional is a mouseeventinit dictionary, having the following fields: "screenx", optional and defaulting to 0, of type long, that is the horizontal position of the mouse event on the user's screen; setting this value doesn't move the mouse pointer.
... "screeny", optional and defaulting to 0, of type long, that is the vertical position of the mouse event on the user's screen; setting this value doesn't move the mouse pointer.
...And 10 more matches
RTCPeerConnection - Web APIs
however, browsers are not required to provide any default ice servers at all.iceconnectionstate read only the read-only property rtcpeerconnection.iceconnectionstate returns an enum of type rtciceconnectionstate which state of the ice agent associated with the rtcpeerconnection.icegatheringstate read only the read-only property rtcpeerconnection.icegatheringstate returns an enum of type rtcicegatheringstate that describes connection's ice gathering state.
...see signaling in lifetime of a webrtc session for more details about the signaling process.event handlersalso inherits event handlers from: eventtargetonaddstream the rtcpeerconnection.onaddstream event handler is a property containing the code to execute when the addstream event, of type mediastreamevent, is received by this rtcpeerconnection.
...this event, of type rtcdatachannelevent, is sent when an rtcdatachannel is added to the connection by the remote peer calling createdatachannel().onicecandidatethe rtcpeerconnection property onicecandidate property is an eventhandler which specifies a function to be called when the icecandidate event occurs on an rtcpeerconnection instance.
...And 10 more matches
SVGAngle - Web APIs
WebAPISVGAngle
constants svg_angletype_unknown some unknown type of value.
... svg_angletype_unspecified a unitless <number> interpreted as a value in degrees.
... svg_angletype_deg an <angle> with a deg unit.
...And 10 more matches
Using the User Timing API - Web APIs
there are two types of user defined timing entry types: the "mark" entry type and the "measure" entry type.
... this document shows how to create mark and measure performance entry types and how to use user timing methods (which are extensions of the performance interface) to retrieve and remove entries from the browser's performance timeline.
...the following examples shows how to use each of these methods (performance.getentries(), performance.getentriesbytype(entrytype), and performance.getentriesbyname(name, entrytype) ) to retrieve one or more marks.
...And 10 more matches
User Timing API - Web APIs
there are two types of user defined timing event types: the "mark" event type and the "measure" event type.
... this document provides an overview of the mark and measure performance event types including the four user timing methods that extend the performance interface.
... for more details and example code regarding these two performance event types and the methods, see using the user timing api.
...And 10 more matches
WebGLRenderingContext.texImage2D() - Web APIs
syntax // webgl1: void gl.teximage2d(target, level, internalformat, width, height, border, format, type, arraybufferview?
... pixels); void gl.teximage2d(target, level, internalformat, format, type, imagedata?
... pixels); void gl.teximage2d(target, level, internalformat, format, type, htmlimageelement?
...And 10 more matches
Audio and Video Delivery - Developer guides
you can find compatibility information in the guide to media types and formats on the web.
... html audio <audio controls preload="auto"> <source src="audiofile.mp3" type="audio/mpeg"> <!-- fallback for browsers that don't support mp3 --> <source src="audiofile.ogg" type="audio/ogg"> <!-- fallback for browsers that don't support audio tag --> <a href="audiofile.mp3">download audio</a> </audio> the code above will create an audio player that attempts to preload as much audio as possible for smooth playback.
... for further info see cross browser audio basics (html5 audio in detail) html video <video controls width="640" height="480" poster="initialimage.png" autoplay muted> <source src="videofile.mp4" type="video/mp4"> <!-- fallback for browsers that don't support mp4 --> <source src="videofile.webm" type="video/webm"> <!-- specifying subtitle files --> <track src="subtitles_en.vtt" kind="subtitles" srclang="en" label="english"> <track src="subtitles_no.vtt" kind="subtitles" srclang="no" label="norwegian"> <!-- fallback for browsers that don't support video tag --> <a href="videofile.mp4">download video</a> </video> the code above creates a video player of dimensions 640x480 pixels, displaying a poster imag...
...And 10 more matches
<script>: The Script element - HTML: Hypertext Markup Language
WebHTMLElementscript
type this attribute indicates the type of script represented.
... the value of this attribute will be in one of the following categories: omitted or a javascript mime type: this indicates the script is javascript.
... the html5 specification urges authors to omit the attribute rather than provide a redundant mime type.
...And 10 more matches
itemscope - HTML: Hypertext Markup Language
a related attribute, itemtype, is used to specify the valid url of a vocabulary (such as schema.org) that describes the item and its properties context.
...an itemscope element that does not have an associated itemtype must have an associated itemref.
... note: find more about itemtype attributes at http://schema.org/thing simple example html the following example specifies the itemscope attribute.
...And 10 more matches
Index - HTTP
WebHTTPHeadersIndex
2 accept http, http header, reference, request header the accept request http header advertises which content types, expressed as mime types, the client is able to understand.
... using content negotiation, the server then selects one of the proposals, uses it and informs the client of its choice with the content-type response header.
...using content negotiation, the server then selects one of the proposals, uses it and informs the client of its choice within the content-type response header.
...And 10 more matches
Equality comparisons and sameness - JavaScript
there are four equality algorithms in es2015: abstract equality comparison (==) strict equality comparison (===): used by array.prototype.indexof, array.prototype.lastindexof, and case-matching samevaluezero: used by %typedarray% and arraybuffer constructors, as well as map and set operations, and also string.prototype.includes and array.prototype.includes since es2016 samevalue: used in all other places javascript provides three different value-comparison operations: === - strict equality comparison ("strict equality", "identity", "triple equals") == - abstract equality comparison ("loose equality", "double equals") object.is provides samevalue (new in es2015).
...briefly: double equals (==) will perform a type conversion when comparing two things, and will handle nan, -0, and +0 specially to conform to ieee 754 (so nan != nan, and -0 == +0); triple equals (===) will do the same comparison as double equals (including the special handling for nan, -0, and +0) but without type conversion; if the types differ, false is returned.
... object.is does no type conversion and no special handling for nan, -0, and +0 (giving it the same behavior as === except on those special numeric values).
...And 10 more matches
Introduction - JavaScript
the javascript language resembles java but does not have java's static typing and strong type checking.
... in contrast to java's compile-time system of classes built by declarations, javascript supports a runtime system based 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.
...And 10 more matches
clipboard - Archive of obsolete content
usage you can optionally specify the type of the data to set and retrieve.
... the following types are supported: text (plain text) html (a string of html) image (a base-64 encoded png) if no data type is provided, then the module will detect it for you.
... currently the image type doesn't support transparency on windows.
...And 9 more matches
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
it also handles determining the mime type of the data, which is used to decide who gets the data.
...nsiuricontentlistener implementations we try to find one of these which can handle data of the type we're looking at (that is, it can give us an nsistreamlistener to pump data into).
... most often, the one we find is nsdsuricontentlistener, which corresponds to a docshell and handles most of the data types that mozilla handles internally.
...And 9 more matches
Introduction to XUL - Archive of obsolete content
in fact, it is just xml with specific meaning defined for a few element types, and into which html can be scattered.
... a word on case and namespaces, and filetypes xml is of course case sensitive.
...for this reason, we've defined a mime type "text/xul" mapped to files with the extension ".xul".
...And 9 more matches
arrowscrollbox - Archive of obsolete content
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 clicktoscroll type: boolean clicktoscroll, if true, the arrows must be clicked to scroll the scrollbox content.
... disabled type: boolean indicates whether the element is disabled or not.
... smoothscroll type: boolean true initially enables smooth scrolling for the corresponding arrowscrollbox, false disables it.
...And 9 more matches
colorpicker - Archive of obsolete content
attributes disabled, color, onchange, preference, tabindex, type properties accessibletype, color, disabled, open, tabindex, value examples <colorpicker/> attributes disabled type: boolean indicates whether the element is disabled or not.
... color type: color string the currently selected color.
...a change event is fired in different ways for different xul input elements as listed below: onchange type: script code textbox when enter key is pressed radio/check box when the state is changed select list when the selected item is changed what is accessible the script context at this point can only access the following things: global values/functions i.e.
...And 9 more matches
label - Archive of obsolete content
ArchiveMozillaXULlabel
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.
... control type: id this attribute specifies the id of the element with which the label is associated.
... crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute.
...And 9 more matches
tabbox - Archive of obsolete content
attributes eventnode, handlectrlpageupdown, handlectrltab properties accessibletype, eventnode, handlectrlpageupdown, handlectrltab, selectedindex, selectedpanel, selectedtab, tabs, tabpanels examples <tabbox id="mytablist" selectedindex="2"> <tabs> <tab label="a first tab"/> <tab label="second tab"/> <tab label="another tab"/> <tab label="last tab"/> </tabs> <tabpanels> <tabpanel><!-- tabpanel first elements go here --></tabpanel> <tabpanel><!--...
... tabpanel second elements go here --></tabpanel> <tabpanel><button label="click me"/></tabpanel> <tabpanel><!-- tabpanel fourth elements go here --></tabpanel> </tabpanels> </tabbox> attributes eventnode type: one of the values below indicates where keyboard navigation events are listened to.
... 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.
...And 9 more matches
HTML forms in legacy browsers - Learn web development
and html5 <input> types don't fail when not supported: they fall back to type=text.
... html input types the input types added in html5 are all useable, even in ancient browsers, because the way they degrade is highly predictable.
... if a browser does not know the value of the type attribute of an <input> element, it will fall back as if the value were text.
...And 9 more matches
Client-Server Overview - Learn web development
p, deflate, sdch, br accept-charset: iso-8859-1,utf-8;q=0.7,*;q=0.7 accept-language: en-us,en;q=0.8,es;q=0.6 cookie: sessionid=6ynxs23n521lu21b1t136rhbv7ezngie; csrftoken=zipujsazv6pcgcbjscj1zu6pqzbfmuat; dwf_section_edit=false; dwf_sg_task_completion=false; _gat=1; _ga=ga1.2.1688886003.1471911953; ffo=true the first and second lines contain most of the information we talked about above: the type of request (get).
... we can see that the response is text/html formatted (content-type).
... we can also see that it uses the utf-8 character set (content-type: text/html; charset=utf-8).
...And 9 more matches
Beginning our React todo list - Learn web development
</label> </h2> <input type="text" id="new-todo-input" classname="input input__lg" name="text" autocomplete="off" /> <button type="submit" classname="btn btn__primary btn__lg"> add </button> </form> <div classname="filters btn-group stack-exception"> <button type="button" classname="btn toggle-btn" aria-pressed="true"> <s...
...pan classname="visually-hidden">show </span> <span>all</span> <span classname="visually-hidden"> tasks</span> </button> <button type="button" classname="btn toggle-btn" aria-pressed="false"> <span classname="visually-hidden">show </span> <span>active</span> <span classname="visually-hidden"> tasks</span> </button> <button type="button" classname="btn toggle-btn" aria-pressed="false"> <span classname="visually-hidden">show </span> <span>completed</span> <span classname="visually-hidden"> tasks</span> </button> </div> <h2 id="list-heading"> 3 tasks remaining </h2> <ul role="list" classname="todo-list stack-large stack-exception" ...
... aria-labelledby="list-heading" > <li classname="todo stack-small"> <div classname="c-cb"> <input id="todo-0" type="checkbox" defaultchecked={true} /> <label classname="todo-label" htmlfor="todo-0"> eat </label> </div> <div classname="btn-group"> <button type="button" classname="btn"> edit <span classname="visually-hidden">eat</span> </button> <button type="button" classname="btn btn__danger"> delete <span classname="visually-hidden">eat</span> </button> </div> </li> <li classname="todo stack-small"> <div classname="c-cb"> <input id="todo-1" type="checkbox" /> <...
...And 9 more matches
Creating our first Vue component - Learn web development
<template> <div> <input type="checkbox" id="todo-item" checked="false" /> <label for="todo-item">my todo item</label> </div> </template> using todoitem inside our app this is all fine, but we haven’t added the component to our app yet, so there’s no way to test it and see if everything is working.
...listing props as an object allows you to specify default values, mark props as required, perform basic object typing (specifically around javascript primitive types), and perform simple prop validation.
... the second property we'll add is a type property.
...And 9 more matches
IME handling guide
for example, if a user types "watasinonamaehanakanodesu", it's converted to hiragana characters, "わたしのなまえはなかのです", automatically (in the following screenshots, the composition string has a wavy underline and the only one clause is called "raw input clause").
...in native code, you can access it with either nsiselectioncontroller or mozilla::selectiontype (the latter is recommended because of type safer).
... and editor sets these ime selections from mozilla::textrangetype which are sent by mozilla::widgetcompositionevent as mozilla::textrangearray.
...And 9 more matches
JNI.jsm
the jni.jsm javascript code module abstracts all of the js-ctypes required for writing jni code.
... jni.jsm contains all the js-ctypes needed to communicate with the jni libraries.
... the js-ctypes is abstracted away while all the underlying data is all ctype data.
...And 9 more matches
PerfMeasurement.jsm
variable type description cpu_cycles uint64 the number of cpu cycles elapsed.
... event types measured constant the eventsmeasured constant provides a mask indicating which event types were recorded.
... variable type description eventsmeasured eventmask a bit mask of the event types recorded; this can differ from the events requested if the platform doesn't support all of the event types you specified when creating the perfmeasurement object.
...And 9 more matches
Python binding for NSS
slchannelinfo.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 sslciphersuiteinfo.symmetric_cipher sslciphersuiteinfo.symmetric_cipher_name sslciphersuiteinfo.symmetric_key_bits sslciphersuiteinfo.symmetric_key_space sslciphersuiteinfo.effective_key_bits sslciphersuiteinfo.mac_algorithm sslciphersuiteinfo.mac_algorithm_name sslciphersuiteinfo.mac_bits sslci...
... the following classes were added: certattribute the following class methods were added: certattribute.format_lines certattribute.format nss.secitem.get_integer the following class properties were added: certificaterequest.attributes certattribute.type_oid certattribute.type_tag certattribute.type_str certattribute.values the following module functions were added: base64_to_binary the following files were added: test_cert_request release 0.14.1 release date 2013-10-28 scm tag pynss_release_0_14_1 so...
...support has also been added for the various key usage and cert type entities which feature prominently during cert validation.
...And 9 more matches
Scripting Java
being able to view the parameters and return type of java methods is particularly useful in exploratory programming where we might be investigating a method and are unsure of the parameter or return types.
... js> f.name test.txt js> f.directory false calling overloaded methods the process of choosing a method to call based upon the types of the arguments is called overload resolution.
...this difference is inevitable given javascript's use of dynamic typing as was discussed in chapter 2: since the type of a variable is not known until runtime, only then can overload resolution occur.
...And 9 more matches
GC Rooting Guide
the main types of gc thing pointer are: js::value jsobject* jsstring* jsscript* jsid note that js::value and jsid can contain pointers internally even though they are not a normal pointer type, hence their inclusion in this list.
... if you use these types directly, or create classes, structs or arrays that contain them, you must follow the rules set out in this guide.
... this is a template class where the template parameter is the type of the gc thing it contains.
...And 9 more matches
SpiderMonkey 1.8.7
spidermonkey 1.8.7 includes type inference, which boosts the speed of the jägermonkey jit by about 30% over version 1.8.5.
... type inference largely obviates tracemonkey, so the tracemonkey jit has been removed.
...many jsapi types, functions, and callback signatures have changed, though most of them still have the same names and do the same things.
...And 9 more matches
Detailed XPCOM hashtable guide
any type: almost any datatype can be used as key, including strings, integers, xpcom interface pointers, iids, and almost anything else.
...client writes their own entry class which can include complex key and data types.
... nsdatahashtable/nsinterfacehashtable/nsclasshashtable - high-level c++ wrappers around pldhash; simplifies the common usage pattern mapping a simple keytype to a simple datatype; client does not need to declare or manage an entry class; nsdatahashtable datatype is a scalar such as pruint32; nsinterfacehashtable datatype is an interface; nsclasshashtable datatype is a class pointer owned by the hashtable.
...And 9 more matches
nsIIOService
(in string ascheme); nsichannel newchannel(in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); obsolete since gecko 48 nsichannel newchannel2(in autf8string aspec, in string aorigincharset, in nsiuri abaseuri, in nsidomnode aloadingnode, in nsiprincipal aloadingprincipal, in nsiprincipal atriggeringprincipal, in uint32_t asecurityflags, in uint32_t acontentpolicytype); nsichannel newchannelfromuri(in nsiuri auri); obsolete since gecko 48 nsichannel newchannelfromuri2(in nsiuri auri, in nsidomnode aloadingnode, in nsiprincipal aloadingprincipal, in nsiprincipal atriggeringprincipal, in unsigned long asecurityflags, in unsigned long acontentpolicytype); nsichannel newchannelfromuriwithloadinfo(in nsiuri auri, in nsiloadinfo aloadinfo...
...); nsichannel newchannelfromuriwithproxyflags2(in nsiuri auri, in nsiuri aproxyuri, in uint32_t aproxyflags,in nsidomnode aloadingnode, in nsiprincipal aloadingprincipal, in nsiprincipal atriggeringprincipal, in uint32_t asecurityflags, in uint32_t acontentpolicytype); nsiuri newfileuri(in nsifile afile); nsiuri newuri(in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); attributes attribute type description offline boolean returns true if networking is in "offline" mode.
... nsichannel newchannel2( in autf8string aspec, in string aorigincharset, in nsiuri abaseuri, in nsidomnode aloadingnode, in nsiprincipal aloadingprincipal, in nsiprincipal atriggeringprincipal, in uint32_t asecurityflags, in uint32_t acontentpolicytype, ); parameters aspec the spec for the desired uri.
...And 9 more matches
nsIMsgProtocolInfo
the nsimsgprotocolinfo interface describes the capabilities of an account type.
... inherits from: nsisupports implemented by: @mozilla.org/messenger/protocol/info;1?type=acct, where acct is the account type that are you are interested in.
... method overview long getdefaultserverport(in boolean issecure); attributes attribute type description candelete boolean true if an account of this type may be deleted.
...And 9 more matches
nsINavBookmarksService
etitemdateadded(in long long aitemid); astring getitemguid(in long long aitemid); obsolete since gecko 14.0 long long getitemidforguid(in astring aguid); obsolete since gecko 14.0 long getitemindex(in long long aitemid); prtime getitemlastmodified(in long long aitemid); autf8string getitemtitle(in long long aitemid); unsigned short getitemtype(in long long aitemid); astring getkeywordforbookmark(in long long aitemid); obsolete since gecko 40.0 astring getkeywordforuri(in nsiuri auri); obsolete since gecko 40.0 nsitransaction getremovefoldertransaction(in long long aitemid); nsiuri geturiforkeyword(in astring keyword); obsolete since gecko 40.0 void importbookmarkshtml(in nsiuri url); obsol...
...astmodified(in long long aitemid, in prtime alastmodified); void setitemtitle(in long long aitemid, in autf8string atitle); void setkeywordforbookmark(in long long aitemid, in astring akeyword); obsolete since gecko 40.0 void setkeywordforuri(in nsiuri uri, in astring keyword); obsolete since gecko 1.9 obsolete since gecko 40.0 attributes attribute type description bookmarksmenufolder long long the item id of the bookmarks menu folder.
... type_bookmark 1 this is an index for type "bookmark".
...And 9 more matches
Component; nsIPrefBranch
ef(in string aprefname,requires gecko 54 [optional] in string adefaultvalue); requires gecko 58 utf8tring getstringpref(in string aprefname, [optional] in utf8string adefaultvalue); void getchildlist(in string astartingat, [optional] out unsigned long acount, [array, size_is(acount), retval] out string achildarray); void getcomplexvalue(in string aprefname, in nsiidref atype, [iid_is(atype), retval] out nsqiresult avalue); long getintpref(in string aprefname,requires gecko 54 [optional] in long adefaultvalue); long getpreftype(in string aprefname); void lockpref(in string aprefname); boolean prefhasuservalue(in string aprefname); boolean prefislocked(in string aprefname); void removeobserver(in string adomain, in ...
...nsiobserver aobserver); void resetbranch(in string astartingat); void setboolpref(in string aprefname, in long avalue); void setcharpref(in string aprefname, in string avalue); requires gecko 58 void setstringpref(in string aprefname, in utf8string avalue); void setcomplexvalue(in string aprefname, in nsiidref atype, in nsisupports avalue); void setintpref(in string aprefname, in long avalue); void unlockpref(in string aprefname); attributes attribute type description root string called to get the root on which this branch is based, such as "browser.startup." read only.
... constants constant value description pref_invalid 0 long pref_string 32 long data type.
...And 9 more matches
nsIWebNavigationInfo
introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) implemented by: @mozilla.org/webnavigation-info;1 as a service: var webnavigationinfo = components.classes["@mozilla.org/webnavigation-info;1"] .getservice(components.interfaces.nsiwebnavigationinfo); method overview unsigned long istypesupported(in acstring atype, in nsiwebnavigation awebnav); constants support type constants constant value description unsupported 0 returned by istypesupported() to indicate lack of support for a type.
... note: this is guaranteed not to change, so that boolean tests can be done on the return value if istypesupported to detect whether a type is supported at all.
... image 1 returned by istypesupported() to indicate that a type is supported as an image.
...And 9 more matches
Address Book examples
my value = card.getproperty("random1"); note: local (mork) address books are currently the only built-in type of address book that supports saving of non-built-in properties.
...ndow.opendialog("chrome://messenger/content/addressbook/abeditlistdialog.xul", "", "chrome,resizable=no,titlebar,modal,centerscreen", {abcard:abcard, listuri:listuri}); new address book dialog unlike the edit address book dialog, the new address book dialog does not currently have the facility to get the chrome uri based on the address book type.
... as of thunderbird 7.0, implementing your own address book type can be done with either javascript or with a binary component.
...And 9 more matches
ABI
general details this article describes the calling conventions with respect to js-ctypes while programming x86 and x86-64/x64/amd64 architectures.
... http://en.wikipedia.org/wiki/application_binary_interface os specific windows https://msdn.microsoft.com/en-us/library/k2b2ssfy.aspx https://msdn.microsoft.com/en-us/library/9b372w95.aspx details with respect to js-ctypes this explains how to use it in the js-ctypes scope.
... three different abis exist: ctypes.default_abi, ctypes.stdcall_abi, and ctypes.winapi_abi.
...And 9 more matches
Drawing and Event Handling - Plugins
this type of plug-in determines when it draws itself.
... //the npwindow structure typedef enum { npwindowtypewindow = 1, npwindowtypedrawable } npwindowtype; typedef struct _npwindow { void* window; /* platform-specific handle */ uint32 x; /* position of top-left corner */ uint32 y; /* relative to a netscape page */ uint32 width; /* maximum window size */ uint32 height; nprect cliprect; /* clipping rectangle in port coordinates */ ...
...#ifdef xp_unix void * ws_info; /* platform-dependent additional data */ #endif /* xp_unix */ npwindowtype type; /* whether this is a window or a drawable */ } npwindow; the window parameter is a platform-specific handle to a native window element in the browser window hierarchy on windows and unix.
...And 9 more matches
Using the Frame Timing API - Web APIs
an application can register a performanceobserver for "frame" performance entry types and the observer will have data about the duration of each frame event.
... frame observers the performance observer interfaces allow an application to register an observer for specific performance event types.
... when one of those event types is added to the browser's performance timeline, the application is notified of the event via the observer's callback function that was specified when the observer was created.
...And 9 more matches
MediaConfiguration - Web APIs
properties a valid configuration includes a valid encoding configuration type or decoding configuration type and a valid audio configuration or video configuration.
... if you plan on querying encoding information, set the media type to record or transmission.
... for decoding, set the type to file or media-source.
...And 9 more matches
PointerEvent.PointerEvent() - Web APIs
syntax event = new pointerevent(type, pointereventinit); arguments type is a domstring representing the name of the event (see pointerevent event types).
... pointereventinitoptional is a pointereventinit dictionary, having the following fields: pointerid — optional and defaulting to 0, of type long, that sets the value of the instance's pointerevent.pointerid.
... width — optional and defaulting to 1, of type double, that sets the value of the instance's pointerevent.width.
...And 9 more matches
Touch() - Web APIs
WebAPITouchTouch
syntax touch = new touch(touchinit); arguments touchinit is a touchinit dictionary, having the following fields: "identifier", required, of type long, that is the identification number for the touch point.
... "target", required, of type eventtarget, the item at which the touch point started when it was first placed on the surface.
... "clientx", optional and defaulting to 0, of type double, that is the horizontal position of the touch on the client window of user's screen, excluding any scroll offset.
...And 9 more matches
Movement, orientation, and motion: A WebXR example - Web APIs
the code looks like this: const xrotationdegreespersecond = 25; const yrotationdegreespersecond = 15; const zrotationdegreespersecond = 35; const enablerotation = true; const allowmouserotation = true; const allowkeyboardmotion = true; const enableforcepolyfill = false; //const session_type = "immersive-vr"; const session_type = "inline"; const mouse_speed = 0.003; xrotationdegreespersecond the number of degrees of rotation to apply around the x axis per second.
... session_type the type of xr session to create: inline for an inline session presented in the context of the document and immersive-vr to present the scene to an immersive vr headset.
... handling the startup and shutdown ui then we call the setupxrbutton() function, which handles configuring the "enter/exit webxr" button to enable or disable it as necessary depending on the availability of webxr support for the session type specified in the session_type constant.
...And 9 more matches
Advanced techniques: Creating and sequencing audio - Web APIs
we can allow the user to control these using range inputs on the interface: <label for="attack">attack</label> <input name="attack" id="attack" type="range" min="0" max="1" value="0.2" step="0.1" /> <label for="release">release</label> <input name="release" id="release" type="range" min="0" max="1" value="0.5" step="0.1" /> now we can create some variables over in javascript and have them change when the input values are updated: let attacktime = 0.2; const attackcontrol = document.queryselector('#attack'); attackcontrol.addeventlistener('...
...the gain node has one property: gain, which is of type audioparam.
... initial oscillator we'll set up our first oscillatornode the same way as our sweep sound, except we won't use a wavetable to set a bespoke wave — we'll just use the default sine wave: let osc = audioctx.createoscillator(); osc.type = 'sine'; osc.frequency.value = 880; now we're going to create a gainnode, as it's the gain value that we will oscillate with our second, low frequency oscillator: let amp = audioctx.creategain(); amp.gain.setvalueattime(1, audioctx.currenttime); creating the second, low frequency, oscillator we'll now create a second — square — wave (or pulse) oscillator, to alter the amplification of ou...
...And 9 more matches
Meta programming - JavaScript
if you violate the invariants of a handler, a typeerror will be thrown.
... handler / trap interceptions invariants handler.getprototypeof() object.getprototypeof() reflect.getprototypeof() __proto__ object.prototype.isprototypeof() instanceof getprototypeof method must return an object or null.
... if target is not extensible, object.getprototypeof(proxy) method must return the same value as object.getprototypeof(target).
...And 9 more matches
BigInt - JavaScript
= bigint("0x1fffffffffffff") // ↪ 9007199254740991n const hugebin = bigint("0b11111111111111111111111111111111111111111111111111111") // ↪ 9007199254740991n bigint is similar to number in some ways, but also differs in a few key matters — it cannot be used with methods in the built-in math object and cannot be mixed with instances of number in operations; they must be coerced to the same type.
... type information when tested against typeof, a bigint will give "bigint": typeof 1n === 'bigint' // true typeof bigint('1') === 'bigint' // true when wrapped in an object, a bigint will be considered as a normal "object" type: typeof object(1n) === 'object' // true operators the following operators may be used with bigints (or object-wrapped bigints): +, *, -, **, %.
...d as usual: 1n < 2 // ↪ true 2n > 1 // ↪ true 2 > 2 // ↪ false 2n > 2 // ↪ false 2n >= 2 // ↪ true they may be mixed in arrays and sorted: const mixed = [4n, 6, -12n, 10, 4, 0, 0n] // ↪ [4n, 6, -12n, 10, 4, 0, 0n] mixed.sort() // default sorting behavior // ↪ [ -12n, 0, 0n, 10, 4n, 4, 6 ] mixed.sort((a, b) => a - b) // won't work since subtraction will not work with mixed types // typeerror: can't convert bigint to number // sort with an appropriate numeric comparator mixed.sort((a, b) => (a < b) ?
...And 9 more matches
Set - JavaScript
the set object lets you store unique values of any type, whether primitive values or object references.
... instance properties set.prototype.size returns the number of values in the set object.
... instance methods set.prototype.add(value) appends value to the set object.
...And 9 more matches
Uint16Array() constructor - JavaScript
the uint16array() typed array constructor creates an array of 16-bit unsigned integers in the platform byte order.
... syntax new uint16array(); // new in es2017 new uint16array(length); new uint16array(typedarray); new uint16array(object); new uint16array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... typedarray when called with a typedarray argument, which can be an object of any of the typed array types (such as int32array), the typedarray gets copied into a new typed array.
...And 9 more matches
page-mod - Archive of obsolete content
the content script receives the getelements message, retrieves all elements of that type, and for each element sends a gotelement message containing the element's innerhtml.
... parameters options : object required options: name: include type: string, regexp, or array of (string or regexp) a match pattern string or an array of match pattern strings.
... optional options: name: contentscriptfile type: string,array this option specifies one or more content scripts to attach to targeted documents.
...And 8 more matches
event/target - Archive of obsolete content
this module provides an exemplar eventtarget object, that implements an interface for adding and removing event listeners of a specific type.
... 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 variable is an event `target` unless // intentionally overridden via `.bind()`.
... console.log(message); }); sometimes event listener may care only about very first event of specific type.
...And 8 more matches
places/bookmarks - Archive of obsolete content
usage this module exports: three constructors: bookmark, group, and separator, corresponding to the types of objects, referred to as bookmark items, in the bookmarks database in firefox two additional functions, save() to create, update, and remove bookmark items, and search() to retrieve the bookmark items that match a particular set of criteria.
... parameters options : object required options: name type title string the title for the bookmark.
... optional options: name type group group the parent group that the bookmark lives under.
...And 8 more matches
ui/sidebar - Archive of obsolete content
<!doctype html> <html> <head> <link href="stuff.css" type="text/css" rel="stylesheet"> </head> <body> <script type="text/javascript" src="stuff.js"></script> </body> </html> you can update the sidebar's content by setting the sidebar's url property.
... here's a simple but complete add-on that shows how to set up communication between main.js and a script in a sidebar, in the case where the sidebar script initiates communication: the html file includes just a script, "sidebar.js": <!doctype html> <html> <body> content for my sidebar <script type="text/javascript" src="sidebar.js"></script> </body> </html> the "sidebar.js" file sends a ping message to main.js using port.emit() as soon as it loads, and adds a listener to the pong message.
... here's a simple but complete add-on that shows how to set up communication between main.js and a script in a sidebar, in the case where the main.js script initiates communication: the html file includes just a script, "sidebar.js": <!doctype html> <html> <body> content for my sidebar <script type="text/javascript" src="sidebar.js"></script> </body> </html> the "sidebar.js" file listens to the ping message from main.js, and responds with a pong message.
...And 8 more matches
Rosetta - Archive of obsolete content
nevertheless, the increasing computational power of modern browsers together with the introduction of typed arrays in ecmascript allow us, in theory, to build full virtual machines in pure ecmascript.
...it relies on the fact that unrecognized mime types will be simply ignored: this allows us to manually parse them.
...|*| http://www.gnu.org/licenses/gpl-3.0.html |*| |*| syntax: |*| |*| rosetta.appendcompiler([ "text/x-csrc", "text/x-c" ], yourcompiler); |*| \*/ var rosetta = new (function () { function createscript (oscript, oxhr200) { var smimetype = oscript.getattribute("type").tolowercase(), obaton = document.createcomment(" the previous code has been automatically translated from \"" + smimetype + "\" to \"text/ecmascript\".
...And 8 more matches
The Essentials of an Extension - Archive of obsolete content
<em:type>2</em:type> this specifies that the add-on being installed is an extension.
... you can read about different possible types in the install.rdf specification.
...open a new firefox tab, type chrome://mozapps/content/downloads/downloads.xul on your location bar and press enter.
...And 8 more matches
CSS3 - Archive of obsolete content
new pseudo-classes: :target, :enabled and :disabled, :checked, :indeterminate, :root, :nth-child and :nth-last-child, :nth-of-type and :nth-last-of-type, :last-child, :first-of-type and :last-of-type, :only-child and :only-of-type,:empty, and :not.
... media queries recommendation since june 19th, 2012 extends the former media type ( print, screen, … ) to a full language allowing queries on the device media capabilities like only screen and (color) .
... the choice of glyphs with specific opentype features via the css font-feature-settings property.
...And 8 more matches
MenuButtons - Archive of obsolete content
both the button and the toolbar button elements support two special types used for creating menu buttons.
... a button or toolbarbutton with a type attribute set to 'menu' creates a button that will open a menu when pressed.
... a button or toolbarbutton with a type attribute set to 'menu-button' creates a button that can be pressed normally.
...And 8 more matches
Numeric Controls - Archive of obsolete content
number fields a textbox may be used for entering numbers by setting the value of the type attribute to the value number.
... this type of textbox may only be used to enter numbers.
... other characters are not allowed and are just ignored if typed.
...And 8 more matches
Skinning XUL Files by Hand - Archive of obsolete content
the ability to apply styles to elements of a type, to specifically identified elements, and to classes of elements creates the potential for redundancies or conflicts in the style information.
...the following table shows the basic format for these two common types of style definitions: class id element.class { attribute: value; } element#id { attribute: value; } menu.baseline { border: 0px; font-size: 9pt; } menu#edit { color: red; } other style subgroups contextualsubgroups -- elements appearing within other elements, such as italicized text anywhere within a <p> element or a <div> ...
...in general, these are the types of styles that should be defined only in the global skin of an application, since these are the styles that give an application a certain overall look, or skin.
...And 8 more matches
CSS - Archive of obsolete content
ArchiveWebCSS
content-zoom-limit-max css property is a microsoft extension that specifies the selected elements' maximum zoom factor.-ms-content-zoom-limit-minthe -ms-content-zoom-limit-min css property is a microsoft extension that specifies the minimum zoom factor.-ms-content-zoom-snapthe -ms-content-zoom-snap css shorthand property is a microsoft extension that specifies values for the -ms-content-zoom-snap-type and -ms-content-zoom-snap-points properties.-ms-content-zoom-snap-pointsthe -ms-content-zoom-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 pr...
...nts-x css property is a microsoft extension that specifies where snap-points will be located along the x-axis.-ms-scroll-snap-points-ythe -ms-scroll-snap-points-y css property is a microsoft extension that specifies where snap-points will be located along the y-axis.-ms-scroll-snap-xthe -ms-scroll-snap-x css shorthand property is a microsoft extension that specifies values for the -ms-scroll-snap-type and -ms-scroll-snap-points-x properties.-ms-scroll-snap-ythe -ms-scroll-snap-x css shorthand property is a microsoft extension that specifies values for the -ms-scroll-snap-type and -ms-scroll-snap-points-y properties.-ms-scroll-translationthe -ms-scroll-translation css property is a microsoft extension that specifies whether vertical-to-horizontal scroll wheel translation occurs on the specified...
...however, those elements' ancestors have this pseudo-class applied to them.:-moz-system-metric()this page was auto-generated because a user created a sub-page to this page.::-ms-browsethe ::-ms-browse css pseudo-element is a microsoft extension that represents the button that opens the file picker of <input type="file">.::-ms-checkthe ::-ms-check css pseudo-element is a microsoft extension that represents checkboxes and radio button groups created by <input type="checkbox"> and <input type="radio">.::-ms-clearthe ::-ms-clear css pseudo-element creates a clear button at the edge of an <input type="text"> text control that clears the current value.
...And 8 more matches
Old Proxy API - Archive of obsolete content
warning: the spidermonkey proxy implementation is a prototype and the proxy api and semantics specifications are unstable.
...there are two kinds of proxies: object proxies var proxy = proxy.create(handler, proto); and function proxies : var proxy = proxy.createfunction(handler, calltrap, constructtrap); where: proto is an optional object representing the proxy’s prototype (defaults to null if none is provided).
...if no constructtrap is provided, performing new proxy(...args) calls the proxy’s calltrap with this bound to a new object delegating to the proxy's prototype.
...And 8 more matches
Signature (functions) - MDN Web Docs Glossary: Definitions of Web-related terms
a function signature (or type signature, or method signature) defines input and output of functions or methods.
... a signature can include: parameters and their types a return value and type exceptions that might be thrown or passed back information about the availability of the method in an object-oriented program (such as the keywords public, static, or prototype).
... in depth signatures in javascript javascript is a loosely typed or a dynamic language.
...And 8 more matches
Mobile accessibility - Learn web development
hold your finger down on the virtual keyboard until you get the character you want, and then release your finger to type it.
...double-tap to type it.
... control mechanisms in our css and javascript accessibility article, we looked at the idea of events that are specific to a certain type of control mechanism (see mouse-specific events).
...And 8 more matches
Other form controls - Learn web development
previous overview: forms next we now look at the functionality of non-<input> form elements in detail, from other control types such as drop-down lists and multi-line text fields, to other useful form features such as the <output> element (which we saw in action in the previous article), and progress bars.
... note: you can find examples of all the drop-down box types on github at drop-down-content.html (see it live also).
...a text or email input type) using the list attribute, the value of which is the id of the data list to bind.
...And 8 more matches
Your first form - Learn web development
the input field for the e-mail is an input of type email: a single-line text field that accepts only e-mail addresses.
... in terms of html code we need something like the following to implement these form widgets: <form action="/my-handling-form-page" method="post"> <ul> <li> <label for="name">name:</label> <input type="text" id="name" name="user_name"> </li> <li> <label for="mail">e-mail:</label> <input type="email" id="mail" name="user_email"> </li> <li> <label for="msg">message:</label> <textarea id="msg" name="user_message"></textarea> </li> </ul> </form> update your form code to look like the above.
... on the <input> element, the most important attribute is the type attribute.
...And 8 more matches
Getting started with HTML - Learn web development
</textarea> <div class="controls"> <input id="reset" type="button" value="reset" /> <input id="solution" type="button" value="show solution" /> </div> html { font-family: 'open sans light',helvetica,arial,sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document...
... note: the terms block and inline, as used in this article, should not be confused with the types of css boxes that have the same names.
... while the names correlate by default, changing the css display type doesn't change the category of the element, and doesn't affect which elements it can contain and which elements it can be contained in.
...And 8 more matches
React interactivity: Events and state - Learn web development
for example: const btn = document.queryselector('button'); btn.addeventlistener('click', () => { alert("hi!"); }); in react, we write event handlers directly on the elements in our jsx, like this: <button type="button" onclick={() => alert("hi!")} > say hi!
... <input type="text" id="new-todo-input" classname="input input__lg" name="text" autocomplete="off" value={name} /> change "use hooks!" to an empty string once you're done; this is what we want for our initial state.
... const [name, setname] = usestate(''); reading user input before we can change the value of name, we need to capture a user's input as they type.
...And 8 more matches
React interactivity: Editing, filtering, conditional rendering - Learn web development
we'll use array.prototype.map() instead of array.prototype.filter() because we want to return a new array with some changes, instead of deleting something from the array.
... copy this block of code into the todo() function, beneath your usestate() hook but above the return statement: const editingtemplate = ( <form classname="stack-small"> <div classname="form-group"> <label classname="todo-label" htmlfor={props.id}> new name for {props.name} </label> <input id={props.id} classname="todo-text" type="text" /> </div> <div classname="btn-group"> <button type="button" classname="btn todo-cancel"> cancel <span classname="visually-hidden">renaming {props.name}</span> </button> <button type="submit" classname="btn btn__primary todo-edit"> save <span classname="visually-hidden">new name for {props.name}</span> </button> </div> </...
...form> ); const viewtemplate = ( <div classname="stack-small"> <div classname="c-cb"> <input id={props.id} type="checkbox" defaultchecked={props.completed} onchange={() => props.toggletaskcompleted(props.id)} /> <label classname="todo-label" htmlfor={props.id}> {props.name} </label> </div> <div classname="btn-group"> <button type="button" classname="btn"> edit <span classname="visually-hidden">{props.name}</span> </button> <button type="button" classname="btn btn__danger" onclick={() => props.deletetask(props.id)} > delete <span classname="visually-hidden">{props.name}</span> </button> </div> </div> ...
...And 8 more matches
Client-side tooling overview - Learn web development
objective: to understand what types of client-side tooling there are, and how to find tools and get help with them.
...if you jump on your favourite search engine and look for "front-end developer tools" you're going to hit a huge spectrum of results ranging from text editors, to browsers, to the type of pens you can use to take notes.
... a few very common safety net tool types you will find being used by developers are as follows.
...And 8 more matches
Error codes returned by Mozilla APIs
ns_error_file_unknown_type (0x80520004) an call was made to nsifile.create() with an invalid type.
... only normal_file_type and directory_type are allowed.
... ns_error_dom_invalid_modification_err (0x8053000d) an attempt was made to modify the type of the attribute.
...And 8 more matches
How to implement a custom autocomplete search component
the xul textbox element supports an autocomplete mechanism that is used to create a textbox with a popup containing a list of possible completions for what the user has started to type.
... to use autocomplete with a xul textbox, all you need to do is set some attributes: <textbox type="autocomplete" autocompletesearch="history"/> the type="autocomplete" turns on the autocomplete mechanism and the autocompletesearch="history" sets the source for the autocomplete.
...rray.<string>|null=} comments */ function providerautocompleteresult(searchstring, searchresult, defaultindex, errordescription, results, comments) { this._searchstring = searchstring; this._searchresult = searchresult; this._defaultindex = defaultindex; this._errordescription = errordescription; this._results = results; this._comments = comments; } providerautocompleteresult.prototype = { _searchstring: "", _searchresult: 0, _defaultindex: 0, _errordescription: "", _results: [], _comments: [], /** * @return {string} the original search string */ get searchstring() { return this._searchstring; }, /** * @return {number} the result code of this result object, either: * result_ignored (invalid searchstring) * result_failure (failure...
...And 8 more matches
SourceMap.jsm
sourcemapconsumer.prototype.originalpositionfor(generatedposition) returns the original source, line, and column information for the generated source's line and column positions provided.
... 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.
... sourcemapgenerator.prototype.tostring() renders the source map being generated to a string.
...And 8 more matches
Encrypt Decrypt_MAC_Using Token
"-----begin mackey ckaid-----" #define mackey_trailer "-----end mackey ckaid-----" #define iv_header "-----begin iv-----" #define iv_trailer "-----end iv-----" #define mac_header "-----begin mac-----" #define mac_trailer "-----end mac-----" #define pad_header "-----begin pad-----" #define pad_trailer "-----end pad-----" typedef enum { encrypt, decrypt, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4 } headertype; /* * print usage message and exit.
... */ secstatus gathercka_id(pk11symkey* key, secitem* buf) { secstatus rv = pk11_readrawattribute(pk11_typesymkey, key, cka_id, buf); if (rv != secsuccess) { pr_fprintf(pr_stderr, "pk11_readrawattribute returned (%d)\n", rv); pr_fprintf(pr_stderr, "could not read symkey cka_id attribute\n"); return rv; } return rv; } /* * generate a symmetric key.
... */ pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mechanism_type mechanism, int keysize, secitem *keyid, secupwdata *pwdata) { secstatus rv; pk11symkey *key; if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); return null; } } /* generate the symmetric key.
...And 8 more matches
JSAPI Cookbook
basics working with values the basic, undifferentiated value type in the jsapi is js::value.
... to query whether a value has a particular type, use a correspondingly named member testing function: // javascript var v = computesomevalue(); var isstring = typeof v === "string"; var isnumber = typeof v === "number"; var isnull = v === null; var isboolean = typeof v === "boolean"; var isobject = typeof v === "object" && v !== null; /* jsapi */ js::rootedvalue v(cx, computesomevalue()); bool isstring = v.isstring(); bool isnumber = v.isnumber(); bool isint32 = v.isint32(); // note: internal representation, not numeric value bool isnull = v.isnull(); bool isboolean = v.isboolean(); bool isobject = v.isobject(); // note: not broken like typeof === "object" is :-) to set a value use a correspondingly named member mutator function, or assign the result of the correspondingly named standalo...
... */ js::rootedvalue r(cx); if (!js_callfunctionname(cx, js_getglobalobject(cx), "foo", 0, null, &r)) return false; calling a js function via a local variable // javascript var r = f(); // where f is a local variable /* jsapi * * suppose f is a local c variable of type js::value.
...And 8 more matches
SpiderMonkey 1.8.8
it continues to improve performance over previous spidermonkey releases, with ongoing jit compilation work and with the introduction of type inference to enable faster jitted code.
...many jsapi types, functions, and callback signatures have changed, though most of them still have the same names and do the same things.
... a significant number of typedefs of built-in types, or of types which are now standardized, have been removed.
...And 8 more matches
SpiderMonkey 17
it continues to improve performance over previous spidermonkey releases, with ongoing jit compilation work and with the introduction of type inference to enable faster jitted code.
...many jsapi types, functions, and callback signatures have changed, though most of them still have the same names and do the same things.
... a significant number of typedefs of built-in types, or of types which are now standardized, have been removed.
...And 8 more matches
Places Developer Guide
types in the bookmark system there are the four types of items in the bookmarks system, and their identifiers in the idl: bookmark: nsinavbookmarksservice.type_bookmark folder: nsinavbookmarksservice.type_folder separator: nsinavbookmarksservice.type_separator dynamic container: nsinavbookmarksservice.type_dynamic_container identifying items in the bookmark system items in the bookmarks coll...
... accessing bookmarks and related items accessing item properties for all items: string getitemtitle(aitemid) - returns an item's title int64 getitemindex(aitemid) - returns an item's position in it's parent folder prtime getitemtype(aitemid) - returns the type of an item (bookmark, folder, separator) prtime getitemdateadded(aitemid) - returns the time in microseconds that an item was added prtime getitemlastmodified(aitemid) - returns the time in microseconds that an item was last modified int64 getfolderidforitem(aitemid) - returns the id of the folder containing the given item.
... var title = childnode.title; var id = childnode.itemid; var type = childnode.type; // some type-specific actions.
...And 8 more matches
How to build an XPCOM component in JavaScript
if an interface exists that meets your needs, then you do not need to write an idl, or compile a typelib, and may skip to the next section.
... compiling the typelib your interface definition must be compiled into a binary format (xpt) in order to be registered and used within mozilla applications.
... execute this command to compile the typelib.
...And 8 more matches
Creating the Component Code
this is the object that contains the business logic, that implements functionality such as starting a network download, implementing interfaces that listen to the download progress, or providing a new content type handler.
...the key to this interface is that the return type of getclassobject does not have to be an nsifactory.
...the includes and definitions at the top of an xpcom source file can give you an idea about some of the data types and techniques we'll be discussing more in the upcoming chapters.
...And 8 more matches
nsIAccessibleRetrieval
nsiaccessible getattachedaccessiblefor(in nsidomnode anode); nsiaccessible getcachedaccessible(in nsidomnode anode, in nsiweakreference ashell); obsolete since gecko 2.0 nsiaccessnode getcachedaccessnode(in nsidomnode anode, in nsiweakreference ashell); obsolete since gecko 2.0 nsidomnode getrelevantcontentnodefor(in nsidomnode anode); astring getstringeventtype(in unsigned long aeventtype); astring getstringrelationtype(in unsigned long arelationtype); astring getstringrole(in unsigned long arole); nsidomdomstringlist getstringstates(in unsigned long astates, in unsigned long aextrastates); methods getaccessiblefor() return an nsiaccessible for a dom node in pres shell 0.
... create a new accessible of the appropriate type if necessary, or use one from the accessibility cache if it already exists.
...create a new accessible of the appropriate type if necessary, or use one from the accessibility cache if it already exists.
...And 8 more matches
nsIFile
void create(in unsigned long type, in unsigned long permissions); void createunique(in unsigned long type, in unsigned long permissions); boolean equals(in nsifile infile); boolean exists(); acstring getrelativedescriptor(in nsifile fromfile); void initwithfile(in nsifile afile); void initwithnativepath(in acstring filepath); void initwithpath(in astring filepath); ...
... void normalize(); file openansifiledesc(in string mode); prfiledescstar opennsprfiledesc(in long flags, in long mode); void renameto(in nsifile newparentdir, in astring newname); void remove(in boolean recursive); void reveal(); void setrelativedescriptor(in nsifile fromfile, in acstring relativedesc); attributes attribute type description directoryentries nsisimpleenumerator returns an enumeration of the elements in a directory.
... constants constant value description normal_file_type 0 a normal file.
...And 8 more matches
nsINetworkLinkService
o 1.8 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) implemented by: @mozilla.org/network/network-link-service;1 as a service: var networklinkservice = components.classes["@mozilla.org/network/network-link-service;1"] .getservice(components.interfaces.nsinetworklinkservice); attributes attribute type description islinkup boolean this is set to true when the system is believed to have a usable network connection.
... linktype unsigned long the type of network connection, one of the link_type_* constants.
... note: as of gecko 8.0, all operating systems currently return link_type_unknown.
...And 8 more matches
nsIStreamConverter
netwerk/streamconv/public/nsistreamconverter.idlscriptable provides an interface to implement when you have code that converts data from one type to another.
...you can supply the service with a stream of type x and it will convert it to your desired output type and return a converted (blocking) stream to you.
...it will then convert that data from type x to your desired output type and return converted data to you via the nsistreamlistener you passed in by calling its nsistreamlistener.ondataavailable() method.
...And 8 more matches
Getting Started Guide
they reference it only through a pointer to an `interface', i.e., the static type of the pointer is a pointer to an abstract base class, the actual object pointed to is a class derived from that abstract base class.
... nscomptr<nsifoo> foo; nsresult rv = bar->queryinterface(ns_get_iid(nsifoo), getter_addrefs(foo)); // or, if you're a savvy xpcom programmer, // you use the type-safe version...
...this facility is type-safe, and it enables an nscomptr to be directly constructed from the result of queryinterface.
...And 8 more matches
Xray vision
for example, if content code creates a new date object, it will usually be created as a property of a dom object, and then it will be filtered out by the dom xray: // content code // redefine date.getfullyear() date.prototype.getfullyear = function() {return 1000}; var date = new date(); // chrome code // contentwindow is an xray, and date is an expando on contentwindow // so date is filtered out gbrowser.contentwindow.date.getfullyear() // -> typeerror: gbrowser.contentwindow.date is undefined the chrome code will only even see date if it waives xrays, and then, because waiving is transitive, it should expect to b...
...for example: the detail property of a customevent fired by content could be a javascript object or date as well as a string or a primitive the return value of evalinsandbox() and any properties attached to the sandbox object may be pure javascript objects also, the webidl specifications are starting to use javascript types such as date and promise: since webidl definition is the basis of dom xrays, not having xrays for these javascript types starts to seem arbitrary.
... like dom objects, most javascript built-in objects have an underlying c++ state that is separate from their javascript representation, so the xray implementation can go straight to the c++ state and guarantee that the object will behave as its specification defines: // chrome code var sandboxscript = 'date.prototype.getfullyear = function() {return 1000};' + 'var date = new date(); '; var sandbox = components.utils.sandbox("https://example.org/"); components.utils.evalinsandbox(sandboxscript, sandbox); // date objects are xrayed console.log(sandbox.date.getfullyear()); // -> 2014 // but you can waive xray vision console.log(components.utils.waivexrays(sandbox.date).getfullyear()); // -...
...And 8 more matches
CData
method overview methods available on all cdata objects cdata address() string tosource() string tostring() properties properties of all cdata objects property type description constructor ctype the data type of the cdata object, as a ctype.
... note: this is never ctypes.void_t or an array type with an unspecified length.
...this will throw a typeerror exception if the value can't be converted.
...And 8 more matches
Library
the library object represents a native library loaded by the ctypes open() method.
... method overview close(); cdata declare(name, [abi, ], returntype[, argtype1, ...]); methods close() closes the library.
... cdata declare( name[, abi, returntype argtype1, ...] ); parameters name the name of the symbol exported by the native library that is to be declared as usable from javascript abi the abi used by the exported function; this will be ctypes.default_abi for most libraries, except for windows libraries, which will be ctypes.winapi_abi or ctypes.stdcall_abi.
...And 8 more matches
Examples of web and XML development using the DOM - Web APIs
example 1: height and width the following example shows the use of the height and width properties alongside images of varying dimensions: <!doctype html> <html lang="en"> <head> <title>width/height example</title> <script> function init() { var arrimages = new array(3); arrimages[0] = document.getelementbyid("image1"); arrimages[1] = document.getelementbyid("image2"); arrimages[2] = document.getelementbyid("image3"); var objoutput = document.getelementbyid("output"); var strhtml = "<ul>"; for (var i = 0; i < arrimages.length; i++) { strhtml += "<li>image" + ...
...image2" src="https://udn.realityripple.com/samples/d2/8ba7141ed1.gif" height="50" width="500"> </p> <p>image 3: no height, width, but style="height: 50px; width: 500px;" <img id="image3" src="https://udn.realityripple.com/samples/d2/8ba7141ed1.gif" style="height: 50px; width: 500px;"> </p> <div id="output"> </div> </body> </html> example 2: image attributes <!doctype html> <html lang="en"> <head> <title>modifying an image border</title> <script> function setborderwidth(width) { document.getelementbyid("img1").style.borderwidth = width + "px"; } </script> </head> <body> <p> <img id="img1" src="image1.gif" style="border: 5px solid green;" width="100" height="100" alt="border test"> </p> <form name="formname"> <input type="button" v...
...alue="make border 20px-wide" onclick="setborderwidth(20);" /> <input type="button" value="make border 5px-wide" onclick="setborderwidth(5);" /> </form> </body> </html> example 3: manipulating styles in this simple example, some basic style properties of an html paragraph element are accessed using the style object on the element and that object's css style properties, which can be retrieved and set from the dom.
...And 8 more matches
Element.classList - Web APIs
WebAPIElementclassList
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.
...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}).prototype = new error; var wsre = /[\11\12\14\15\40]/, wsindex = 0, checkifvalidclasslistentry = function(o, v) { if (v === "") throw new domexception( "failed to execute '" + o + "' on 'domtokenlist': the token provided must not be empty." ); if((wsindex=v.search(wsre))!==-1) throw new domexception("failed to execute '"+o+"' on 'domtokenlist': " + "the token provided ('"+v[wsindex]+"') contains html space characters, which are not valid in tokens."); } // 2.
...And 8 more matches
Dragging and Dropping Multiple Items - Web APIs
these are methods that mirror the types property as well as the getdata(), setdata() and cleardata() methods, however, they take an additional argument that specifies the index of the item to retrieve, modify or remove.
...mozsetdataat("text/plain", "url2", 1); dt.mozsetdataat("text/uri-list", "url3", 2); dt.mozsetdataat("text/plain", "url3", 2); // [item1] data=url1, index=0 // [item2] data=url2, index=1 // [item3] data=url3, index=2 after you added three items in two different formats, dt.mozcleardataat("text/uri-list", 1); dt.mozcleardataat("text/plain", 1); you've removed the second item clearing all types, then the old third item becomes new second item, and its index decreases.
... function ondrop(event) { var files = []; var dt = event.datatransfer; for (var i = 0; i < dt.mozitemcount; i++) files.push(dt.mozgetdataat("application/x-moz-file", i)); } you may also wish to check if the desired format exists using the moztypesat method.
...And 8 more matches
MediaDevices.getUserMedia() - Web APIs
the mediadevices.getusermedia() method prompts the user for permission to use a media input which produces a mediastream with tracks containing the requested types of media.
... that stream can include, for example, a video track (produced by either a hardware or virtual video source such as a camera, video recording device, screen sharing service, and so forth), an audio track (similarly, produced by a physical or virtual audio source like a microphone, a/d converter, or the like), and possibly other track types.
... syntax var promise = navigator.mediadevices.getusermedia(constraints); parameters constraints a mediastreamconstraints object specifying the types of media to request, along with any requirements for each type.
...And 8 more matches
Microdata DOM API - Web APIs
the document.getitems(typenames) method provides access to the top-level microdata items.
... it returns a nodelist containing the items with the specified types, or all types if no argument is specified.
...the type(s) of items can be obtained using the element.itemtype idl attribute on the element with the itemscope attribute.
...And 8 more matches
PerformanceObserver.observe() - Web APIs
the observe() method of the performanceobserver interface is used to specify the set of performance entry types to observe.
... the performance entry types are specified as an array of domstring objects, each naming one entry type; the type names are documented in performance entry type names in performanceentry.entrytype.
... syntax observer.observe(options); parameters options a performanceobserverinit dictionary with the following possible members: entrytypes: an array of domstring objects, each specifying one performance entry type to observe.
...And 8 more matches
SVGFETurbulenceElement - Web APIs
t" target="_top"><rect x="261" y="65" width="220" height="50" fill="#f4f7f8" stroke="#d4dde4" 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">svgfeturbulenceelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants turbulence types name value description svg_turbulence_type_unknown 0 the type is not one of predefined types.
... 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_turbulence_type_fractalnoise 1 corresponds to the fractalnoise value.
...And 8 more matches
SVGTransform - Web APIs
erview also implement none methods void setmatrix(in svgmatrix matrix) void settranslate(in float tx, in float ty) void setscale(in float sx, in float sy) void setrotate(in float angle, in float cx, in float cy) void setskewx(in float angle) void setskewy(in float angle) properties readonly unsigned short type readonly float angle readonly svgmatrix matrix constants svg_transform_unknown = 0 svg_transform_matrix = 1 svg_transform_translate = 2 svg_transform_scale = 3 svg_transform_rotate = 4 svg_transform_skewx = 5 svg_transform_skewy = 6 normative document svg 1.1 (2nd edition) constants name ...
... value description svg_transform_unknown 0 the unit type is not one of predefined unit types.
... it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
...And 8 more matches
WebGL2RenderingContext.texSubImage3D() - Web APIs
syntax void gl.texsubimage3d(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, arraybufferview?
... srcdata, optional srcoffset); void gl.texsubimage3d(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, imagebitmap?
... pixels); void gl.texsubimage3d(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, imagedata?
...And 8 more matches
WebGLRenderingContext.texSubImage2D() - Web APIs
syntax // webgl 1: void gl.texsubimage2d(target, level, xoffset, yoffset, width, height, format, type, arraybufferview?
... pixels); void gl.texsubimage2d(target, level, xoffset, yoffset, format, type, imagedata?
... pixels); void gl.texsubimage2d(target, level, xoffset, yoffset, format, type, htmlimageelement?
...And 8 more matches
A basic 2D WebGL animation example - Web APIs
<script id="vertex-shader" type="x-shader/x-vertex"> attribute vec2 avertexposition; uniform vec2 uscalingfactor; uniform vec2 urotationvector; void main() { vec2 rotatedposition = vec2( avertexposition.x * urotationvector.y + avertexposition.y * urotationvector.x, avertexposition.y * urotationvector.y - avertexposition.x * urotationvector.x ); gl_position = vec4(rotate...
...since we're drawing a solid, untextured object with no lighting applied, this is exceptionally simple: <script id="fragment-shader" type="x-shader/x-fragment"> #ifdef gl_es precision highp float; #endif uniform vec4 uglobalcolor; void main() { gl_fragcolor = uglobalcolor; } </script> this starts by specifying the precision of the float type, as required.
...or; let urotationvector; let avertexposition; // animation timing let previoustime = 0.0; let degreespersecond = 90.0; initializing the program is handled through a load event handler called startup(): window.addeventlistener("load", startup, false); function startup() { glcanvas = document.getelementbyid("glcanvas"); gl = glcanvas.getcontext("webgl"); const shaderset = [ { type: gl.vertex_shader, id: "vertex-shader" }, { type: gl.fragment_shader, id: "fragment-shader" } ]; shaderprogram = buildshaderprogram(shaderset); aspectratio = glcanvas.width/glcanvas.height; currentrotation = [0, 1]; currentscale = [1.0, aspectratio]; vertexarray = new float32array([ -0.5, 0.5, 0.5, 0.5, 0.5, -0.5, -0.5, 0.5, 0.5, -0.5, -0.5...
...And 8 more matches
WebRTC API - Web APIs
media streams can consist of any number of tracks of media information; tracks, which are represented by objects based on the mediastreamtrack interface, may contain one of a number of types of media data, including audio, video, and text (such as subtitles or even chapter names).
... connection setup and management these interfaces, dictionaries, and types are used to set up, open, and manage webrtc connections.
...each rtcsessiondescription consists of a description type indicating which part of the offer/answer negotiation process it describes and of the sdp descriptor of the session.
...And 8 more matches
Web APIs
WebAPI
below is a list of all the apis and interfaces (object types) that you may be able to use while developing your web app or site.
...vents push api rresize observer apiresource timing apisserver sent eventsservice workers apistoragestorage access apistreams ttouch eventsuurl apivvibration apivisual viewport wweb animationsweb audio apiweb authentication apiweb crypto apiweb notificationsweb storage apiweb workers apiwebglwebrtcwebvttwebxr device apiwebsockets api interfaces this is a list of all the interfaces (that is, types of objects) that are available.
...ransferitem datatransferitemlist dedicatedworkerglobalscope delaynode deprecationreportbody devicelightevent devicemotionevent devicemotioneventacceleration devicemotioneventrotationrate deviceorientationevent deviceproximityevent directoryentrysync directoryreadersync displaymediastreamconstraints document documentfragment documentorshadowroot documenttimeline documenttouch documenttype doublerange dragevent dynamicscompressornode e ext_blend_minmax ext_color_buffer_float ext_color_buffer_half_float ext_disjoint_timer_query ext_float_blend ext_frag_depth ext_srgb ext_shader_texture_lod ext_texture_compression_bptc ext_texture_compression_rgtc ext_texture_filter_anisotropic eckeygenparams eckeyimportparams ecdhkeyderiveparams ecdsaparams effecttiming element elementcssinlinest...
...And 8 more matches
Block and inline layout in normal flow - CSS: Cascading Style Sheets
the display type of an element defines the outer display type; this dictates how the box displays alongside other elements in the same formatting context.
... it also defines the inner display type, which dictates how boxes inside this element behave.
...this is the outer display type of block.
...And 8 more matches
Value definition syntax - CSS: Cascading Style Sheets
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.
...typically, the slash is used in shorthand properties; to separate component that are of the same type, but belong to different properties.
...And 8 more matches
display - CSS: Cascading Style Sheets
WebCSSdisplay
formally, the display property sets an element's inner and outer display types.
... the outer type sets an element's participation in flow layout; the inner type sets the layout of children.
...keyword values are grouped into six value categories: .container { display: [ <display-outside> || <display-inside> ] | <display-listitem> | <display-internal> | <display-box> | <display-legacy> ; } outside <display-outside> these keywords specify the element’s outer display type, which is essentially its role in flow layout.
...And 8 more matches
HTML attribute: multiple - HTML: Hypertext Markup Language
valid for the email and file input types and the <select>, the manner by which the user opts for multiple values depends on the form control.
... depending on the type, the form control may have a different appearance if the multiple attribute is set.
... for the file input type, the native messaging the browser provides differs.
...And 8 more matches
<video>: The Video Embed element - HTML: Hypertext Markup Language
WebHTMLElementvideo
<video controls> <source src="myvideo.mp4" type="video/mp4"> <source src="myvideo.webm" type="video/webm"> <p>your browser doesn't support html5 video.
... here is a <a href="myvideo.mp4">link to the video</a> instead.</p> </video> we offer a substantive and thorough guide to media file types and the guide to the codecs supported for video.
...instead, they're sent to the track list object within the <video> element's htmlmediaelement that corresponds to the type of track that was added to the element: htmlmediaelement.audiotracks an audiotracklist containing all of the media element's audio tracks.
...And 8 more matches
Microdata - HTML: Hypertext Markup Language
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.
...And 8 more matches
Quirks Mode and Standards Mode - HTML: Hypertext Markup Language
for html documents, browsers use a doctype in the beginning of the document to decide whether to handle it in quirks mode or standards mode.
... to ensure that your page uses full standards mode, make sure that your page has a doctype like in this example: <!doctype html> <html lang="en"> <head> <meta charset=utf-8> <title>hello world!</title> </head> <body> </body> </html> the doctype shown in the example, <!doctype html>, is the simplest possible, and the one recommended by html5.
... earlier versions of the html standard recommended other variants, but all existing browsers today will use full standards mode for this doctype, even the dated internet explorer 6.
...And 8 more matches
Object.defineProperty() - JavaScript
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.
...in order to ensure these defaults are preserved, you might freeze the object.prototype upfront, specify all options explicitly, or point to null with object.create(null).
...object.defineproperty(obj, 'key', withvalue('static')); // if freeze is available, prevents adding or // removing the object prototype properties // (value, get, set, enumerable, writable, configurable) (object.freeze || object)(object.prototype); examples if you want to see how to use the object.defineproperty method with a binary-flags-like syntax, see additional examples.
...And 8 more matches
Object.freeze() - JavaScript
in addition, freezing an object also prevents its prototype from being changed.
...any attempt to do so will fail, either silently or by throwing a typeerror exception (most commonly, but not exclusively, when in strict mode).
... in es5, if the argument to this method is not an object (a primitive), then it will cause a typeerror.
...And 8 more matches
function declaration - JavaScript
typeof foo is ${typeof foo}`); if (false) { function foo(){ return 1; } } // in chrome: // 'foo' name is hoisted.
... typeof foo is undefined // // in firefox: // 'foo' name is hoisted.
... typeof foo is undefined // // in edge: // 'foo' name is not hoisted.
...And 8 more matches
Web video codec guide - Web media technologies
for each codec, the containers (file types) that can support them are also listed.
...generally speaking, any configuration option that is intended to reduce the output size of the video will probably have a negative impact on the overall quality of the video, or will introduce certain types of artifacts into the video.
... color edging color edging is a type of visual artifact that presents as spurious colors introduced along the edges of colored objects within the scene.
...And 8 more matches
Codecs used by WebRTC - Web media technologies
media type recommended bit rate range narrow-band speech (nb) 8 to 12 kbps wide-band speech (wb) 16 to 20 kbps full-band speech (fb) 28 to 40 kbps full-band monaural music (fb mono) 48 to 64 kbps full-band stereo music (fb stereo) 64 to 128 kbps the bit rate may be adjusted at any time.
...the most efficient way is to use the static method rtcrtpsender.getcapabilities() (or the equivalent rtcrtpreceiver.getcapabilities() for a receiver), specifying the type of media as the input parameter.
...of special importance in these objects: the payloadtype property, which is a one-byte value which uniquely identifies the described configuration.
...And 8 more matches
<pattern> - SVG: Scalable Vector Graphics
WebSVGElementpattern
value type: <length>|<percentage>; default value: 0; animatable: yes href this attribute reference a template pattern that provides default values for the <pattern> attributes.
... value type: <url>; default value: none; animatable: yes patterncontentunits this attribute defines the coordinate system for the contents of the <pattern>.
... value type: userspaceonuse|objectboundingbox; default value: userspaceonuse; animatable: yes note: this attribute has no effect if a viewbox attribute is specified on the <pattern> element.
...And 8 more matches
widget - Archive of obsolete content
parameters options : object required options: name type label string a string description of the widget used for accessibility, title bars, and error reporting.
... optional options: name type content string an optional string value containing the displayed content of the widget.
... on(type, listener) registers an event listener with the widget.
...And 7 more matches
Install Manifests - Archive of obsolete content
type an integer value representing the type of add-on.
... 2 extensions 4 themes 8 locale 32 multiple item package 64 spell check dictionary 128 telemetry experiment 256 webextension experiment examples <em:type>2</em:type> this property was added for firefox 1.5, and is only required for add-on types other than extensions and themes.
...at the moment this only works for add-ons with em:type="2".
...And 7 more matches
Promises - Archive of obsolete content
let resp = yield new promise((resolve, reject) => { let xhr = new xmlhttprequest; xhr.onload = resolve; xhr.onerror = reject; xhr.open("get", dataurl); xhr.responsetype = "json"; xhr.send(); }); let data = resp.target.response; // use the response to construct form data object for the // second request.
... let xhr = yield request(dataurl, { responsetype: "json" }); let data = xhr.response; // use the response to construct form data object for the // second request.
...rn new promise((accept, reject) => { return addon.getdatadirectory((directory, error) => { if (error) reject(error); else accept(directory); }); }); }, }; }, getinstallforurl: function getinstallforurl(url, mimetype, hash, name, iconurl, version, loadgroup) { return new promise(accept => this.addonmanager.getinstallforurl(url, accept, mimetype, hash, iconurl, version, loadgroup)); }, getinstallforfile: function getinstallforfile(url, mimetype) { return new promise(accept => ...
...And 7 more matches
Install script template - Archive of obsolete content
var plid = "@myplugin.com/myplugin,version=5.3"; var version = "5.3.0.0"; var mimetype = "application/x-my-plugin"; var suffix = "my"; var suffix_description = "my plugin files"; var company_name = "mypluginco"; var plugin_description = "my exemplary plugin mine all mine"; // registry constant paths // these will be used when the win32 registry keys are written var hkey_local_machine = "hkey_local_machine"; var hkey_current_user = "hkey_current_user"; var reg_moz_path = "softwar...
...condaryfolderxpt = secondaryfolder + component_file; // write plid keys (mozilla.org/projects/plugins/first-install-problem.html) // write plid keys to hklm var hklm_status = registerplid(hkey_local_machine, reg_moz_path, plid, qualifiedsecondaryfolderdll, qualifiedsecondaryfolderxpt, plugin_description, company_name, software_name, version, mimetype, suffix, suffix_description); logcomment("moz first install installation: registerplid("+hkey_local_machine+") returned, status "+hklm_status); if (hklm_status == false) { // write plid keys (mozilla.org/projects/plugins/first-install-problem.html) // write plid keys to hkcu var hkcu_status = registerplid(hkey_current_user, reg_moz_path, plid, qualifiedsecondaryfold...
...erdll, qualifiedsecondaryfolderxpt, plugin_description, company_name, software_name, version, mimetype, suffix, suffix_description); logcomment("first install installation: registerplid("+hkey_current_user+") returned, status "+hklm_status); if (hkcu_status != 0) { logcomment("could not write to the registry.
...And 7 more matches
Introduction - Archive of obsolete content
several types of datasources are supported by default, rdf, xml and sqlite databases, however, processors may be written to support other types of datasources.
...the type of datasource is specified with the querytype attribute.
... the type affects how the datasource is used as well as the syntax for specifying queries.
...And 7 more matches
Content Panels - Archive of obsolete content
browsers there is a second type of content panel, using the browser tag.
...both types of browser offer similar control over pages that are displayed.
...the type may be specified using the type attribute.
...And 7 more matches
caption - Archive of obsolete content
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.
... crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute.
...for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } image type: uri the uri of the image to appear on the element.
...And 7 more matches
description - Archive of obsolete content
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.
...ill not word wrap <description value="this is a long section of text that will not word wrap"> </description> this is a long section of dynamically controlled text that will word wrap <description id="desc" style="width: 300px"></description> document.getelementbyid('desc').textcontent = "this is a long section of dynamic message text that will word wrap"; attributes crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute.
...for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not.
...And 7 more matches
toolbox - Archive of obsolete content
it is a type of box but defaults to vertical orientation.
... properties accessible, customtoolbarcount, externaltoolbars, palette, toolbarset methods appendcustomtoolbar, collapsetoolbar, expandtoolbar examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="yourwindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="toolbox example" width="300"> <toolbox> <toolbar> <toolbarbutton label="back"/> <toolbarbutton label="forward"/> <toolbarbutton label="home"/> </toolbar> <toolbar> <toolbarbutton label="stop"/> <toolbarbutton label="reload"/> </toolbar> ...
... from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessible type: nsiaccessible returns the accessibility object for the element.
...And 7 more matches
NPEvent - Archive of obsolete content
syntax microsoft windows typedef struct _npevent { uint16 event; uint32 wparam; uint32 lparam; } npevent; mac os typedef eventrecord npevent; type eventrecord = record { what: integer; message: longint; when: longint; where: point; modifiers: integer; end; xwindows typedef xevent npevent; fields npevent on microsoft windows the data structure has the following fields: event one of the following event types: wm_paint wm_lbuttondown wm_lbuttonup wm_lbuttondblclk wm_rbuttondown wm_rbuttonup wm_rbuttondblclk wm_mbuttondown wm_mbuttonup wm_mbuttondblclk wm_mousemove ...
...wparam 32 bit field for the windows event parameter; parameter value depends upon event type.
... lparam 32 bit field for the windows event parameter; parameter value depends upon event type.
...And 7 more matches
Web fonts - Learn web development
for example, most modern browsers support woff/woff2 (web open font format versions 1 and 2), the most efficient format around, but older versions of ie only support eot (embedded open type) fonts, and you might need to include an svg version of the font to support older versions of iphone and android browsers.
...in the web-font-start.css file, you'll find some minimal css to deal with the basic layout and typesetting of the example.
...there are generally three types of sites where you can obtain fonts: a free font distributor: this is a site that makes free fonts available for download (there may still be some license conditions, such as crediting the font creator).
...And 7 more matches
CSS property compatibility table for form controls - Learn web development
the property has no meaning for this type of widget.
... text fields see the text, search, and password input types.
... buttons see the button, submit, and reset input types and the <button> element.
...And 7 more matches
From object to iframe — other embedding technologies - Learn web development
at this point we'd like to take somewhat of a sideways step, looking at some elements that allow you to embed a wide variety of content types into your webpages: the <iframe>, <embed> and <object> elements.
... playable code <h2>live output</h2> <div class="output" style="min-height: 250px;"> </div> <h2>editable code</h2> <p class="a11y-label">press esc to move focus away from the code area (tab inserts a tab character).</p> <textarea id="code" class="input" style="width: 95%;min-height: 100px;"> </textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solu...
... the <embed> and <object> elements the <embed> and <object> elements serve a different function to <iframe> — these elements are general purpose embedding tools for embedding multiple types of external content, which include plugin technologies like java applets and flash, pdf (which can be shown in a browser with a pdf plugin), and even content like videos, svg and images!
...And 7 more matches
Graceful asynchronous programming with Promises - Learn web development
we can write a function that does this; add the following inside your <script> element: function fetchanddecode(url, type) { return fetch(url).then(response => { if(!response.ok) { throw new error(`http error!
... status: ${response.status}`); } else { if(type === 'blob') { return response.blob(); } else if(type === 'text') { return response.text(); } } }) .catch(e => { console.log(`there has been a problem with your fetch operation for resource "${url}": ` + e.message); }); } this looks a bit complex, so let's run through it step by step: first of all, we define the function, passing it a url and a string representing the type of resource it is fetching.
... however, two things are different here: first of all, the second promise we return is different depending on what the type value is.
...And 7 more matches
Looping code - Learn web development
let's say we wanted to draw 100 random circles on a <canvas> element (press the update button to run the example again and again to see different random sets): hidden code <!doctype html> <html> <head> <meta charset="utf-8"> <title>random canvas circles</title> <style> html { width: 100%; height: inherit; background: #ddd; } canvas { display: block; } body { margin: 0; } button { position: absolute; top: 5px; left: 5px; } </style> </head> <...
... const cats = ['bill', 'jeff', 'pete', 'biggles', 'jasmin']; let info = 'my cats are called '; const para = document.queryselector('p'); for (let i = 0; i < cats.length; i++) { info += cats[i] + ', '; } para.textcontent = info; this gives us the following output: hidden code 2 <!doctype html> <html> <head> <meta charset="utf-8"> <title>basic for loop example</title> <style> </style> </head> <body> <p></p> <script> const cats = ['bill', 'jeff', 'pete', 'biggles', 'jasmin']; let info = 'my cats are called '; const para = document.queryselector('p'); for (let i = 0; i < cats.length; i++) { info += cats[i] + ', '; } par...
...first, some simple html — a text <input> allowing us to enter a name to search for, a <button> element to submit a search, and a <p> element to display the results in: <label for="search">search by contact name: </label> <input id="search" type="text"> <button>search</button> <p></p> now on to the javascript: const contacts = ['chris:2232322', 'sarah:3453456', 'bill:7654322', 'mary:9998769', 'dianne:9384975']; const para = document.queryselector('p'); const input = document.queryselector('input'); const btn = document.queryselector('button'); btn.addeventlistener('click', function() { let searchname = input.value.tolowercase(); ...
...And 7 more matches
A first splash into JavaScript - Learn web development
example — guess the number game in this article we'll show you how to build up the simple game you can see below: top hidden code <!doctype html> <html> <head> <meta charset="utf-8"> <title>number guessing game</title> <style> html { font-family: sans-serif; } body { width: 50%; max-width: 800px; min-width: 480px; margin: 0 auto; } .lastresult { color: white; padding: 3px; } </style> <...
...we'll tell you if your guess was too high or too low.</p> <div class="form"> <label for="guessfield">enter a guess: </label><input type="text" id="guessfield" class="guessfield"> <input type="submit" value="submit guess" class="guesssubmit"> </div> <div class="resultparas"> <p class="guesses"></p> <p class="lastresult"></p> <p class="loworhi"></p> </div> <script> // your javascript goes here let randomnumber = math.floor(math.random() * 100) + 1; const guesses = document.queryselector('.guesses'); const lastresult = document.queryselector('.lastresult'); const loworhi = document.querysel...
... let's imagine your boss has given you the following brief for creating this game: i want you to create a simple guess the number type game.
...And 7 more matches
Server-side web frameworks - Learn web development
for example, the httprequest object that django passes to every view function contains methods and properties for accessing the target url, the type of request (e.g.
...this makes it easier and safer to check that data is stored in the correct type of database field, has the correct format (e.g.
...the model specifies the field types to be stored, which may provide field-level validation on what information can be stored (e.g.
...And 7 more matches
Starting our Svelte Todo list app - Learn web development
</label> </h2> <input type="text" id="todo-0" autocomplete="off" class="input input__lg" /> <button type="submit" disabled="" class="btn btn__primary btn__lg"> add </button> </form> <!-- filter --> <div class="filters btn-group stack-exception"> <button class="btn toggle-btn" aria-pressed="true"> <span class="visually-hidden">show</span> <span>all</span> <span class="visuall...
... todos --> <ul role="list" class="todo-list stack-large" aria-labelledby="list-heading"> <!-- todo-1 (editing mode) --> <li class="todo"> <div class="stack-small"> <form class="stack-small"> <div class="form-group"> <label for="todo-1" class="todo-label"> new name for 'create a svelte starter app' </label> <input type="text" id="todo-1" autocomplete="off" class="todo-text" /> </div> <div class="btn-group"> <button class="btn todo-cancel" type="button"> cancel <span class="visually-hidden">renaming create a svelte starter app</span> </button> <button class="btn btn__primary todo-edit" type="submit"> save ...
... <span class="visually-hidden">new name for create a svelte starter app</span> </button> </div> </form> </div> </li> <!-- todo-2 --> <li class="todo"> <div class="stack-small"> <div class="c-cb"> <input type="checkbox" id="todo-2" checked/> <label for="todo-2" class="todo-label"> create your first component </label> </div> <div class="btn-group"> <button type="button" class="btn"> edit <span class="visually-hidden">create your first component</span> </button> <button type="button" class="btn btn__danger"> delete <span class="visually-hidden">create your first component</span> </button>...
...And 7 more matches
Eclipse CDT
although eclipse doesn't do fuzzy matching when you type a file name, it does allow you to use wildcards.
... note that the search, call hierarchy, and other tabs have a "pin" button that allows you to open multiple tabs of these type.
... to get a list of autocomplete options in an editor tab, start typing the name of an identifier and then type ctrl-space.
...And 7 more matches
Mozilla Web Developer FAQ
the mode is picked based on the doctype declaration (or the lack thereof) at the beginning of an html document.
... the easiest way to make sure that the standards mode is activated for html, is to use this doctype declaration: <!doctype html> the easiest way to make sure that the almost standards mode is activated for html, is to use this doctype declaration: <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> the easiest way to activate the quirks mode for html is to omit the doctype declaration.
...in earlier versions the doctype declarations that now activate the almost standards mode activated the standards mode.
...And 7 more matches
Encrypt Decrypt MAC Keys As Session Objects
"-----begin mackey ckaid-----" #define mackey_trailer "-----end mackey ckaid-----" #define iv_header "-----begin iv-----" #define iv_trailer "-----end iv-----" #define mac_header "-----begin mac-----" #define mac_trailer "-----end mac-----" #define pad_header "-----begin pad-----" #define pad_trailer "-----end pad-----" typedef enum { encrypt, decrypt, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4 } headertype; /* * print usage message and exit */ static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -c -d [-z ] " "[-p | -f ] -i -o \n\n", progname); fprintf(stderr, "%-20s specify '...
...nd .header as intermediate output files.\n\n", ""); fprintf(stderr, "%-7s for decrypt, it takes .enc and .header\n", ""); fprintf(stderr, "%-7s as input files and produces as a final output file.\n\n", ""); exit(-1); } /* * gather a cka_id */ secstatus gathercka_id(pk11symkey* key, secitem* buf) { secstatus rv = pk11_readrawattribute(pk11_typesymkey, key, cka_id, buf); if (rv != secsuccess) { pr_fprintf(pr_stderr, "pk11_readrawattribute returned (%d)\n", rv); pr_fprintf(pr_stderr, "could not read symkey cka_id attribute\n"); return rv; } return rv; } /* * generate a symmetric key */ pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mechanism_type mechanism, int keysize, secitem *k...
... unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = macinit(ctxmac); if (rv != secsuccess) return rv; rv = macupdate(ctxmac, ptext, ptextlen); if (rv != secsuccess) return rv; rv = macfinal(ctxmac, mac, maclen, maxlen); return rv; } /* * writetoheaderfile */ secstatus writetoheaderfile(const char *buf, unsigned int len, headertype type, prfiledesc *outfile) { secstatus rv; char header[40]; char trailer[40]; char *outstring = null; switch (type) { case symkey: strcpy(header, enckey_header); strcpy(trailer, enckey_trailer); break; case mackey: strcpy(header, mackey_header); strcpy(trailer, mackey_trailer);...
...And 7 more matches
Encrypt and decrypt MAC using token
"-----begin mackey ckaid-----" #define mackey_trailer "-----end mackey ckaid-----" #define iv_header "-----begin iv-----" #define iv_trailer "-----end iv-----" #define mac_header "-----begin mac-----" #define mac_trailer "-----end mac-----" #define pad_header "-----begin pad-----" #define pad_trailer "-----end pad-----" typedef enum { encrypt, decrypt, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4 } headertype; /* * print usage message and exit */ static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -c -d [-z ] " "[-p | -f ] -i -o \n\n", progname); fprintf(stderr, "%-20s specify '...
...nd .header as intermediate output files.\n\n", ""); fprintf(stderr, "%-7s for decrypt, it takes .enc and .header\n", ""); fprintf(stderr, "%-7s as input files and produces as a final output file.\n\n", ""); exit(-1); } /* * gather a cka_id */ secstatus gathercka_id(pk11symkey* key, secitem* buf) { secstatus rv = pk11_readrawattribute(pk11_typesymkey, key, cka_id, buf); if (rv != secsuccess) { pr_fprintf(pr_stderr, "pk11_readrawattribute returned (%d)\n", rv); pr_fprintf(pr_stderr, "could not read symkey cka_id attribute\n"); return rv; } return rv; } /* * generate a symmetric key */ pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mechanism_type mechanism, int keysize, secitem *k...
... unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = macinit(ctxmac); if (rv != secsuccess) return rv; rv = macupdate(ctxmac, ptext, ptextlen); if (rv != secsuccess) return rv; rv = macfinal(ctxmac, mac, maclen, maxlen); return rv; } /* * writetoheaderfile */ secstatus writetoheaderfile(const char *buf, unsigned int len, headertype type, prfiledesc *outfile) { secstatus rv; char header[40]; char trailer[40]; char *outstring = null; switch (type) { case symkey: strcpy(header, enckey_header); strcpy(trailer, enckey_trailer); break; case mackey: strcpy(header, mackey_header); strcpy(trailer, mackey_trailer);...
...And 7 more matches
EncDecMAC using token object - sample 3
--" #define enckey_trailer "-----end aeskey ckaid-----" #define mackey_header "-----begin mackey ckaid-----" #define mackey_trailer "-----end mackey ckaid-----" #define iv_header "-----begin iv-----" #define iv_trailer "-----end iv-----" #define mac_header "-----begin mac-----" #define mac_trailer "-----end mac-----" #define pad_header "-----begin pad-----" #define pad_trailer "-----end pad-----" typedef enum { encrypt, decrypt, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4 } headertype; /* * print usage message and exit */ static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -c -d [-z ] " "[-p | -f ] -i -o \n\n", progname); fprintf(stderr, "%-20s specify 'a' for encrypt operation\n\n", "-c "); fprintf(stderr, "%-20s specify 'b' for de...
...le and produces\n", "note :"); fprintf(stderr, "%-7s .enc and .header as intermediate output files.\n\n", ""); fprintf(stderr, "%-7s for decrypt, it takes .enc and .header\n", ""); fprintf(stderr, "%-7s as input files and produces as a final output file.\n\n", ""); exit(-1); } /* * gather a cka_id */ secstatus gathercka_id(pk11symkey* key, secitem* buf) { secstatus rv = pk11_readrawattribute(pk11_typesymkey, key, cka_id, buf); if (rv != secsuccess) { pr_fprintf(pr_stderr, "pk11_readrawattribute returned (%d)\n", rv); pr_fprintf(pr_stderr, "could not read symkey cka_id attribute\n"); return rv; } return rv; } /* * generate a symmetric key */ pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mechanism_type mechanism, int keysize, secitem *keyid, secupwdata *pwdata) { secstatus rv; pk11symkey *k...
...nsigned char *ptext, unsigned int ptextlen, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = macinit(ctxmac); if (rv != secsuccess) return rv; rv = macupdate(ctxmac, ptext, ptextlen); if (rv != secsuccess) return rv; rv = macfinal(ctxmac, mac, maclen, maxlen); return rv; } /* * writetoheaderfile */ secstatus writetoheaderfile(const char *buf, unsigned int len, headertype type, prfiledesc *outfile) { secstatus rv; char header[40]; char trailer[40]; char *outstring = null; switch (type) { case symkey: strcpy(header, enckey_header); strcpy(trailer, enckey_trailer); break; case mackey: strcpy(header, mackey_header); strcpy(trailer, mackey_trailer); break; case iv: strcpy(header, iv_header); strcpy(trailer, iv_trailer); break; case mac: strcpy(header, mac_header); str...
...And 7 more matches
sslfnc.html
syntax #include "ssl.h" secstatus ssl_configsecureserver( prfiledesc *fd, certcertificate *cert, seckeyprivatekey *key, sslkeatype keatype); parameters this function has the following parameters: fd a pointer to the file descriptor for the ssl listen socket.
... keatype key exchange type for use with specified certificate and key.
...to find out what key-exchange algorithm a particular certificate supports, pass the certificate structure to nss_findcertkeatype.
...And 7 more matches
NSS Tools modutil
syntax to run the security module database tool, type the command modutil option [arguments] where option and arguments are combinations of the options and arguments listed in the following section.
...type 'q <enter>' to abort, or <enter> to continue: after you press enter, the tool displays the following: creating "c:\databases\key3.db"...done.creating "c:\databases\cert8.db"...done.creating "c:\databases\secmod.db"...done.
...--------name: netscape internal pkcs #11 modulelibrary file: **internal only module**manufacturer: netscape communications corp description: communicator internal crypto svcpkcs #11 version 2.0library version: 4.0cipher enable flags: nonedefault mechanism flags: rsa:dsa:rc2:rc4:des:sha1:md5:md2slot: communicator internal cryptographic services version 4.0manufacturer: netscape communications corp type: softwareversion number: 4.1firmware version: 0.0status: enabledtoken name: communicator generic crypto svcstoken manufacturer: netscape communications corp token model: libsec 4.0 token serial number: 0000000000000000token version: 4.0token firmware version: 0.0access: write protectedlogin type: public (no login required)user pin: not initializedslot: communicator user private key and certificat...
...And 7 more matches
JS::PersistentRooted
this article covers features introduced in spidermonkey 31 a copyable, assignable global gc root type with arbitrary lifetime, an infallible constructor, and automatic unrooting on destruction.
... syntax js::persistentrooted<t> var; // added in spidermonkey 38 js::persistentrooted<t> var(cx); js::persistentrooted<t> var(cx, initial); js::persistentrooted<t> var(rt); js::persistentrooted<t> var(rt, initial); name type description cx jscontext * the context to get the runtime in which to add the root rt jsruntime * the runtime in which to add the root.
... methods here, ptr represents the private member of js::persistentrooted<t>, typed with t.
...And 7 more matches
WebReplayRoadmap
doing this well will require some experimentation, but in many cases the buggy recording should hit different locations in the source or exhibit different types from the normal recording.
... aggregate call graph and data flow (not yet implemented) when developing a complex web app it is often hard to find where a function is called, the callees at a call site, where some data in an object came from or where it is used, or what type a value has.
... static type integration (not yet implemented) static type systems like flow and typescript are great and really useful for managing an app's codebase, but they are unsound by design, and it is pretty easy to satisfy the type system and yet have different types in practice.
...And 7 more matches
Using the Places history service
nsibrowserhistory: adds functions used by the basic browser like marking pages as typed in the url bar, and removing pages as from the history interface.
...this entry contained the url, title, visit count, last visit date, first visit date, host name, last referrer, flags for typed, hidden, and gecko flags (gecko flags is trunk only).
...the main url table stores the information about the page: url, host name, title, visit count, hidden, and typed.
...And 7 more matches
mozIStorageValueArray
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview long gettypeofindex(in unsigned long aindex); long getint32(in unsigned long aindex); long long getint64(in unsigned long aindex); double getdouble(in unsigned long aindex); autf8string getutf8string(in unsigned long aindex); astring getstring(in unsigned long aindex); void getblob(in unsigned long aindex, out unsigned long adatasize, [array,size_is(adatas...
...ize)] out octet adata); boolean getisnull(in unsigned long aindex); attributes attribute type description numentries unsigned long the number of entries in the array.
... constants constant value description value_type_null 0 null data type.
...And 7 more matches
nsIBrowserHistory
it adds functions used by the basic browser like, marking pages as typed in the url bar, and removing pages as from the history interface.
...wserhistory = components.classes["@mozilla.org/browser/nav-history-service;1"] .getservice(components.interfaces.nsibrowserhistory); method overview void addpagewithdetails(in nsiuri auri, in wstring atitle, in long long alastvisited); obsolete since gecko 15.0 void markpageasfollowedlink(in nsiuri auri); obsolete since gecko 22.0 void markpageastyped(in nsiuri auri); obsolete since gecko 22.0 void registeropenpage(in nsiuri auri); obsolete since gecko 9.0 void removeallpages(); void removepage(in nsiuri auri); void removepages([array, size_is(alength)] in nsiuri auris, in unsigned long alength, in boolean adobatchnotify); void removepagesbytimeframe(in long long abegintime, in long long aendtime...
...); void removepagesfromhost(in autf8string ahost, in boolean aentiredomain); void removevisitsbytimeframe(in long long abegintime, in long long aendtime); void unregisteropenpage(in nsiuri auri); obsolete since gecko 9.0 note: the markpageasfollowedlink and markpageastyped methods were moved to nsinavhistoryservice in gecko 22.0 so that all markpageas* methods can be found in one interface.
...And 7 more matches
nsIChannel
method overview void asyncopen(in nsistreamlistener alistener, in nsisupports acontext); nsiinputstream open(); attributes attribute type description contentcharset acstring the character set of the channel's content if available and if applicable.
...the behavior is similar to contenttype.
... contenttype acstring the mime type of the channel's content if available.
...And 7 more matches
nsIFaviconService
to use this service, use: var faviconservice = components.classes["@mozilla.org/browser/favicon-service;1"] .getservice(components.interfaces.nsifaviconservice); method overview void addfailedfavicon(in nsiuri afaviconuri); void expireallfavicons(); void getfavicondata(in nsiuri afaviconuri, out autf8string amimetype, [optional] out unsigned long adatalen, [array,retval,size_is(adatalen)] out octet adata); obsolete since gecko 22.0 astring getfavicondataasdataurl(in nsiuri afaviconuri); obsolete since gecko 22.0 nsiuri getfaviconforpage(in nsiuri apageuri); obsolete since gecko 22.0 nsiuri getfaviconimageforpage(in nsiuri apageuri); obsolete since gecko 22.0 nsiuri getfavi...
...conlinkforicon(in nsiuri afaviconuri); boolean isfailedfavicon(in nsiuri afaviconuri); void removefailedfavicon(in nsiuri afaviconuri); void setandloadfaviconforpage(in nsiuri apageuri, in nsiuri afaviconuri, in boolean aforcereload, in unsigned long afaviconloadtype, [optional] in nsifavicondatacallback acallback); obsolete since gecko 22.0 void setfavicondata(in nsiuri afaviconuri, [const,array,size_is(adatalen)] in octet adata, in unsigned long adatalen, in autf8string amimetype, in prtime aexpiration); obsolete since gecko 22.0 void setfavicondatafromdataurl(in nsiuri afaviconuri, in astring adataurl, in prtime aexpiration); obsolete since gecko 22.0 void setfaviconurlforpage(in nsiuri apageuri, in nsiuri afaviconuri); obsolete since g...
...ecko 22.0 attributes attribute type description defaultfavicon nsiuri the default favicon uri.
...And 7 more matches
nsIPropertyBag2
note: accessing a property of a different type may attempt conversion to this type.
...note: accessing a property of a different type may attempt conversion to this type.
...note: accessing a property of a different type may attempt conversion to this type.
...And 7 more matches
nsISearchEngine
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void addparam(in astring name, in astring value, in astring responsetype); nsisearchsubmission getsubmission(in astring data, [optional] in astring responsetype, [optional] in astring purpose); boolean supportsresponsetype(in astring responsetype); attributes attribute type description alias astring an optional shortcut alias for the engine.
... type long the search engine type.
... constants search engine type constants constant value description type_mozsearch 1 type_sherlock 2 type_opensearch 3 search engine data type constants constant value description data_xml 1 data type is xml data_text 2 data type is text.
...And 7 more matches
UInt64
as javascript doesn't currently include standard support for 64-bit integer values, js-ctypes offers the int64 and uint64 objects to let you work with c functions and data that need (or may need) to use data represented using a 64-bit data type.
... exceptions thrown typeerror the specified value cannot be converted into a 64-bit integer.
... exceptions thrown typeerror one or both of the specified values is not a 64-bit integer (either signed or unsigned).
...And 7 more matches
Debugger.Frame - Firefox Developer Tools
even though the debuggee and debugger share the same javascript stack, frames pushed for spidermonkey’s calls to handler methods to report events in the debuggee are never considered visible frames.) invocation functions and “debugger” frames aninvocation function is any function in this interface that allows the debugger to invoke code in the debuggee: debugger.object.prototype.call, debugger.frame.prototype.eval, and so on.
...for example, debugger.frame.prototype.eval pushes an "eval" frame for code it runs, whereas debugger.object.prototype.call pushes a "call" frame.
... accessor properties of the debugger.frame prototype object a debugger.frame instance inherits the following accessor properties from its prototype: type a string describing what sort of frame this is: "call": a frame running a function call.
...And 7 more matches
File - Web APIs
WebAPIFile
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.
...And 7 more matches
HTMLButtonElement - Web APIs
htmlbuttonelement.formenctype is a domstring reflecting the type of content that is used to submit the form to the server.
... if specified, this attribute overrides the enctype attribute of the <form> element that owns this element.
... htmlbuttonelement.menu is a htmlmenuelement representing the menu element to be displayed if the button is clicked and is of type="menu".
...And 7 more matches
The HTML DOM API - Web APIs
the html dom api is made up of the interfaces that define the functionality of each of the elements in html, as well as any supporting types and interfaces they rely upon.
...for example, the <canvas> element is represented by an object of type htmlcanvaselement.
... htmlcanvaselement augments the htmlelement type by adding properties such as height and methods like getcontext() to provide canvas-specific features.
...And 7 more matches
Basic concepts - Web APIs
for the reference documentation on the indexeddb api, refer back to the main indexeddb api article and its subpages, which document the types of objects used by indexeddb.
... big concepts if you have assumptions from working with other types of databases, you might get thrown off when working with indexeddb.
...you get notified by a dom event when the operation finishes, and the type of event you get lets you know if the operation succeeded or failed.
...And 7 more matches
MediaSessionActionDetails - Web APIs
the media session api's mediasessionactiondetails dictionary is the type used by the sole input parameter into the callback which is executed when a media session action occurs.
... it specifies the type of action which needs to be performed as well as the data needed to perform the action.
... properties action a media session action type string taken from the mediasessionaction enumerated type, indicating which type of action needs to be performed.
...And 7 more matches
Using the Media Capabilities API - Web APIs
in short, this api replaces—and improves upon—the mediasource method istypesupported() or the htmlmediaelement method canplaytype().
...the configuration requires the type of media being tested — e.g.
... a plain file or mediasource — and a videoconfiguration including values for the contenttype, width, height, bitrate, and framerate: the contenttype must be a string specifying a valid video mime type.
...And 7 more matches
Pointer events - Web APIs
however, since many devices support other types of pointing input devices, such as pen/stylus and touch surfaces, extensions to the existing pointing device event models are needed.
...however, for scenarios when device-specific handling is desired, pointer events defines a pointertype property to inspect the device type which produced the event.
...consequently, pointer event types are intentionally similar to mouse event types.
...And 7 more matches
SVGTextPathElement - Web APIs
helement" target="_top"><rect x="-169" y="65" width="180" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="-79" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgtextpathelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants method types name value description textpath_methodtype_unknown 0 the type is not one of predefined types.
... it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
... textpath_methodtype_align 1 corresponds to the value align.
...And 7 more matches
WebGLRenderingContext.vertexAttribPointer() - Web APIs
syntax void gl.vertexattribpointer(index, size, type, normalized, stride, offset); parameters index a gluint specifying the index of the vertex attribute that is to be modified.
... type a glenum specifying the data type of each component in the array.
... for types gl.byte and gl.short, normalizes the values to [-1, 1] if true.
...And 7 more matches
WebRTC Statistics API - Web APIs
try { mypeerconnection = new rtcpeerconnection(pcoptions); statsinterval = window.setinterval(getconnectionstats, 1000); /* add event handlers, etc */ } catch(err) { console.error("error creating rtcpeerconnection: " + err); } function getconnectionstats() { mypeerconnection.getstats(null).then(stats => { var statsoutput = ""; stats.foreach(report => { if (report.type === "inbound-rtp" && report.kind === "video") { object.keys(report).foreach(statname => { statsoutput += `<strong>${statname}:</strong> ${report[statname]}<br>\n`; }); } }); document.queryselector(".stats-box").innerhtml = statsoutput; }); } when the promise returned by getstats() is fulfilled, the resolution handler receives as input an rtcstatsreport ...
...this object contains a map of named dictionaries based on rtcstats and its affiliated types.
... this example specifically looks for the report whose type is inbound-rtp and whose kind is video.
...And 7 more matches
Inputs and input sources - Web APIs
by combining these two types of input with the changing of viewing position and/or orientation through the headset or other mechanisms, you can create an interactive simulated environment.
... input device types webxr supports a variety of different types of devices to handle targeting and action inputs.
... { "profileid": "generic-trigger-squeeze-touchpad", "fallbackprofileids": [], "layouts" : { "left-right-none" : { "selectcomponentid": "xr-standard-trigger", "components": { "xr-standard-trigger": { "type": "trigger" }, "xr-standard-squeeze": { "type": "squeeze" }, "xr-standard-touchpad": { "type": "touchpad" } }, "gamepad": { "mapping": "xr-standard", "buttons": [ "xr-standard-trigger", "xr-standard-squeeze", "xr-standard-touchpad" ], ...
...And 7 more matches
Migrating from webkitAudioContext - Web APIs
the example below shows old code which downloads an audio file over the network, and then decoded it using createbuffer(): var xhr = new xmlhttprequest(); xhr.open("get", "/path/to/audio.ogg", true); xhr.responsetype = "arraybuffer"; xhr.send(); xhr.onload = function() { var decodedbuffer = context.createbuffer(xhr.response, false); if (decodedbuffer) { // decoding was successful, do something useful with the audio buffer } else { alert("decoding the audio buffer failed"); } }; converting this code to use decodeaudiodata() is relatively simple, as can be seen below: var xhr = new xmlhttpreq...
...uest(); xhr.open("get", "/path/to/audio.ogg", true); xhr.responsetype = "arraybuffer"; xhr.send(); xhr.onload = function() { context.decodeaudiodata(xhr.response, function onsuccess(decodedbuffer) { // decoding was successful, do something useful with the audio buffer }, function onfailure() { alert("decoding the audio buffer failed"); }); }; note that the decodeaudiodata() method is asynchronous, which means that it will return immediately, and then when the decoding finishes, one of the success or failure callback functions will get called depending on whether the audio decoding was successful.
... those values have since been changed to use the web idl based enumerated values, which should be familiar because they are similar to things like the the htmlinputelement property type.
...And 7 more matches
XRReferenceSpace - Web APIs
the tracking behavior is defined by the selected reference space type.
... all reference spaces—with the sole exception being bounded reference spaces—are described using the xrreferencespace type.
... getoffsetreferencespace() creates and returns a new reference space object as the same type as the one on which you call the method (so, either xrreferencespace or xrboundedreferencespace).
...And 7 more matches
font-variant-alternates - CSS: Cascading Style Sheets
annotation(user-defined-ident); font-variant-alternates: swash(ident1) annotation(ident2); /* global values */ font-variant-alternates: initial; font-variant-alternates: inherit; font-variant-alternates: unset; the @font-feature-values at-rule can define names for alternative glyph functions (stylistic, styleset, character-variant, swash, ornament or annotation), associating the name with opentype parameters.
...it corresponds to the opentype value hist.
...it corresponds to the opentype value salt, like salt 2.
...And 7 more matches
font-variant-numeric - CSS: Cascading Style Sheets
it corresponds to the opentype values ordn.
...it corresponds to the opentype values zero.
...it corresponds to the opentype values lnum.
...And 7 more matches
<form> - HTML: Hypertext Markup Language
WebHTMLElementform
accept comma-separated content types the server accepts.
...instead, use the accept attribute on <input type=file> elements.
...this value can be overridden by a formaction attribute on a <button>, <input type="submit">, or <input type="image"> element.
...And 7 more matches
Preloading content with rel="preload" - HTML: Hypertext Markup Language
the type of resource in the as attribute.
...using as to specify the type of content to be preloaded allows the browser to: prioritize resource loading more accurately.
... what types of content can be preloaded?
...And 7 more matches
Float32Array() constructor - JavaScript
the float32array() typed array constructor creates a new float32array object, which is, an array of 32-bit floating point numbers (corresponding to the c float data type) in the platform byte order.
... syntax new float32array(); // new in es2017 new float32array(length); new float32array(typedarray); new float32array(object); new float32array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... typedarray when called with a typedarray argument, which can be an object of any of the typed array types (such as int32array), the typedarray gets copied into a new typed array.
...And 7 more matches
Float64Array() constructor - JavaScript
the float64array() typed array constructor creates a new float64array object, which is, an array of 64-bit floating point numbers (corresponding to the c double data type) in the platform byte order.
... syntax new float64array(); // new in es2017 new float64array(length); new float64array(typedarray); new float64array(object); new float64array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... typedarray when called with a typedarray argument, which can be an object of any of the typed array types (such as int32array), the typedarray gets copied into a new typed array.
...And 7 more matches
Int16Array() constructor - JavaScript
the int16array() typed array constructor creates an array of twos-complement 16-bit signed integers in the platform byte order.
... syntax new int16array(); // new in es2017 new int16array(length); new int16array(typedarray); new int16array(object); new int16array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... typedarray when called with a typedarray argument, which can be an object of any of the typed array types (such as int32array), the typedarray gets copied into a new typed array.
...And 7 more matches
Int32Array() constructor - JavaScript
the int32array() typed array constructor creates an array of twos-complement 32-bit signed integers in the platform byte order.
... syntax new int32array(); // new in es2017 new int32array(length); new int32array(typedarray); new int32array(object); new int32array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... typedarray when called with a typedarray argument, which can be an object of any of the typed array types (such as int32array), the typedarray gets copied into a new typed array.
...And 7 more matches
Int8Array() constructor - JavaScript
the int8array() constructor creates a typed array of twos-complement 8-bit signed integers.
... syntax new int8array(); // new in es2017 new int8array(length); new int8array(typedarray); new int8array(object); new int8array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... typedarray when called with a typedarray argument, which can be an object of any of the typed array types (such as int32array), the typedarray gets copied into a new typed array.
...And 7 more matches
Uint32Array() constructor - JavaScript
the uint32array() typed array constructor creates an array of 32-bit unsigned integers in the platform byte order.
... syntax new uint32array(); // new in es2017 new uint32array(length); new uint32array(typedarray); new uint32array(object); new uint32array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... typedarray when called with a typedarray argument, which can be an object of any of the typed array types (such as int32array), the typedarray gets copied into a new typed array.
...And 7 more matches
Uint8Array() constructor - JavaScript
the uint8array() constructor creates a typed array of 8-bit unsigned integers.
... syntax new uint8array(); // new in es2017 new uint8array(length); new uint8array(typedarray); new uint8array(object); new uint8array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... typedarray when called with a typedarray argument, which can be an object of any of the typed array types (such as int32array), the typedarray gets copied into a new typed array.
...And 7 more matches
Uint8ClampedArray() constructor - JavaScript
the uint8clampedarray() constructor creates a typed array of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the range of [0,255], 0 or 255 will be set instead; if you specify a non-integer, the nearest integer will be set.
... syntax new uint8clampedarray(); // new in es2017 new uint8clampedarray(length); new uint8clampedarray(typedarray); new uint8clampedarray(object); new uint8clampedarray(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... typedarray when called with a typedarray argument, which can be an object of any of the typed array types (such as int32array), the typedarray gets copied into a new typed array.
...And 7 more matches
WebAssembly.RuntimeError - JavaScript
the webassembly.runtimeerror object is the error type that is thrown whenever webassembly specifies a trap.
... instance properties webassembly.runtimeerror.prototype.message error message.
... although ecma-262 specifies that urierror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
...And 7 more matches
instanceof - JavaScript
the instanceof operator tests to see if the prototype property of a constructor appears anywhere in the prototype chain of an object.
... constructor function to test against description the instanceof operator tests the presence of constructor.prototype in object's prototype chain.
... // defining constructors function c() {} function d() {} let o = new c() // true, because: object.getprototypeof(o) === c.prototype o instanceof c // false, because d.prototype is nowhere in o's prototype chain o instanceof d o instanceof object // true, because: c.prototype instanceof object // true c.prototype = {} let o2 = new c() o2 instanceof c // true // false, because c.prototype is nowhere in // o's prototype chain anymore o instanceof c d.prototype = new c() // add c to [[prototype]] linkage of d let o3 = new d() o3 instanceof d // true o3 instanceof c // true since c.prototype is now in o3's prototype chain note that the value of an instanceof test can change based on changes to the prototype property of constructors.
...And 7 more matches
<radialGradient> - SVG: Scalable Vector Graphics
value type: <length> ; default value: 50%; animatable: yes cy this attribute defines the y coordinate of the end circle of the radial gradient.
... value type: <length> ; default value: 50%; animatable: yes fr this attribute defines the radius of the start circle of the radial gradient.
... value type: <length> ; default value: 50%; animatable: yes fx this attribute defines the x coordinate of the start circle of the radial gradient.
...And 7 more matches
<svg> - SVG: Scalable Vector Graphics
WebSVGElementsvg
value type: <string> ; default value: none; animatable: no contentscripttype deprecated since svg 2 the default scripting language used by the svg fragment.
... value type: <string> ; default value: application/ecmascript; animatable: no contentstyletype deprecated since svg 2 the default style sheet language used by the svg fragment.
... value type: <string> ; default value: text/css; animatable: no height the displayed height of the rectangular viewport.
...And 7 more matches
panel - Archive of obsolete content
self.port.on("show", function onshow() { textarea.focus(); }); finally, the "text-entry.html" file defines the <textarea> element: <html> <head> <style type="text/css" media="all"> textarea { margin: 10px; } body { background-color: gray; } </style> </head> <body> <textarea rows="13" cols="33" id="edit-box"></textarea> </body> </html> finally, save these three icon files to the "data" directory: icon-16.png icon-32.png icon-64.png to learn much more ab...
...addon.port.on("show", function onshow() { textarea.focus(); }); finally, the html file now references "get-text.js" inside a <script> tag: <html> <head> <style type="text/css" media="all"> textarea { margin: 10px; } body { background-color: gray; } </style> </head> <body> <textarea rows="13" cols="33" id="edit-box"></textarea> <script src="get-text.js"></script> </body> </html> styling panel content the panel's default style is different for each operating system: this helps to ensure that the pan...
... if the panel's content is packaged along with your add-on and specified using an html file in your data directory, you can style it by embedding css directly in the html file or by referencing a css file stored under data: <!doctype html> <html> <head> <link href="panel-style.css" type="text/css" rel="stylesheet"> </head> <body> my panel content </body> </html> from firefox 31 onwards, you can style panel content using the contentstyle or contentstylefile options.
...And 6 more matches
test/assert - Archive of obsolete content
other pairs that do not both pass typeof value == "object", equivalence is determined by ==.
... for all other object pairs, including array objects, equivalence is determined by having the same number of owned properties (as verified with object.prototype.hasownproperty.call), the same set of keys (although not necessarily the same order), equivalent values for every corresponding key, and an identical "prototype" property.
... notdeepequal(actual, expected, message) tests that two objects do not have a deep equality relation, using the negation of the test for deep equality: assert.notdeepequal({ a: "foo" }, object.create({ a: "foo" }), "object's inherit from different prototypes"); parameters actual : object the actual result.
...And 6 more matches
Dialogs and Prompts - Archive of obsolete content
<?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="..." title="..." buttons="accept,cancel" ondialogaccept="return onaccept();" ondialogcancel="return oncancel();"> <script src="chrome://..."/> <!-- content --> </dialog> you need to implement onaccept and oncancel functions in your script.
... buttons in <dialog> predefined there are six button types you can use in the buttons attribute of dialog.
...your dialog, use the following code: <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="..." buttons="accept,cancel,extra1" ondialogaccept="onaccept();" ondialogextra1="onapply();" buttonlabelextra1="apply" buttonaccesskeyextra1="a"> <!-- content --> </dialog> you can even get the element object for any of predefined buttons with gdialog.getbutton(dlgtype);, where gdialog is the <dialog> element and dlgtype is one of the six button types listed above.
...And 6 more matches
Inline options - Archive of obsolete content
here is an example of an options.xul file: <?xml version="1.0"?> <!doctype mydialog system "chrome://myaddon/locale/mydialog.dtd"> <vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <setting type="bool" pref="extensions.myaddon.bool" title="boolean" desc="stored as a boolean preference" /> </vbox> note that it's limited to <setting> tags.
... setting types there are several types of <setting>s, each with a different type attribute: type attribute displayed as preference stored as bool checkbox boolean boolint checkbox integer (use the attributes on and off to specify what values to store) integer textbox integer string textbox string color colorpicker string (in the #123456 format) file browse button and label string directory browse button and label string menulist menulist dependent on the menu item values radio radio buttons dependen...
... some examples: <!-- boolean examples --> <setting pref="extensions.myaddon.bool1" type="bool" title="boolean 1"/> <setting pref="extensions.myaddon.bool2" type="bool" title="boolean 2"> description of boolean 2 </setting> <!-- boolean stored as an integer --> <setting pref="extensions.myaddon.boolint" type="boolint" title="boolean 3" on="1" off="2"/> <!-- integer example --> <setting pref="extensions.myaddon.int" type="integer" title="integer"/> <!-- string examples --> <setti...
...And 6 more matches
Appendix D: Loading Scripts - Archive of obsolete content
<?xml version="1.0" encoding="utf-8"?> <!doctype overlay> <overlay id="script-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript;version=1.8" src="overlay.js"/> </overlay> evalinsandbox the components.utils.evalinsandbox method may be used to load arbitrary code into components.utils.sandbox objects.
...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.
...some known issues include: e4x xml objects cannot be wrapped for passage between compartments: bug 613142 there are a number of type detection issues, including: string.replace does not recognize regexp objects from foreign compartments: bug 633830 debugging: support for sandbox evaluation in development tools is uneven.
...And 6 more matches
XPCOM Objects - Archive of obsolete content
in general, you can rely on javascript's ability to transform values to the correct type, but it's usually best to pass the right type in the first place.
...this is done for certain value types that are not valid as return values in idl, such as typed arrays.
... some commonly used xpcom methods require other xpcom types as parameters.
...And 6 more matches
Layout System Overview - Archive of obsolete content
the decision about when to apply css-specified formatting and when to apply legacy formatting is controlled by the document's doctype specification.
...(doctype and modes are explained in more detail in article mozilla's doctype sniffing.
...layout creates frames for content based on either the specific html rules for an element or based on the css display type of the element.
...And 6 more matches
MenuItems - Archive of obsolete content
this type of menuitem can be created by using the type attribute and setting it to the value "checkbox".
... <menu label="view" accesskey="v"> <menupopup> <menuitem label="show toolbar" accesskey="t" type="checkbox" checked="true"/> <menuitem label="show status bar" accesskey="s" type="checkbox"/> </menupopup> </menu> both menuitems are of the checkbox type.
...<menuitem label="show toolbar" accesskey="t" type="checkbox" oncommand="changetoolbarstate();"/> in this example, we show the toolbar when the menuitem is checked and hide the toolbar otherwise.
...And 6 more matches
Popup Menus - Archive of obsolete content
creating a popup menu xul has three different types of popups, described below.
...this type of popup is usually used to provide a description of a button in more detail than can be provided on the button itself.
... all three types of popups differ in the way that the user invokes them.
...And 6 more matches
JavaArray - Archive of obsolete content
summary core object a wrapped java array accessed from within javascript code is a member of the type javaarray.
...in addition, you can create a javaarray with an arbitrary data type using the newinstance method of the array class: public static object newinstance(class componenttype, int length) throws negativearraysizeexception description the javaarray object is an instance of a java array that is created in or passed to javascript.
... in javascript 1.4 and later, the componenttype parameter is either a javaclass object representing the type of the array or class object, such as one returned by java.lang.class.forname.
...And 6 more matches
Examples - Archive of obsolete content
--> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-us" xml:lang="en-us"> <head> <title>problem 1 - &lt; in xhtml</title> <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" /> <script type="text/javascript"> var i = 0; while (++i > 10) { // ...
... </p> </body> </html> back to the article problem 2 <!-- this file should have a .xhtml extension --> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-us" xml:lang="en-us"> <head> <title>problem 2 - comments in xhtml</title> <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" /> <style type="text/css"> <!-- body {background-color: blue; color: yellow; } --> </style> <script type="text/javascript"> <!-- var i = 0; var sum = 0; for (i = 0; i < 10; ++i) { sum += i; }...
...--> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-us" xml:lang="en-us"> <head> <title>problem 3 - comments in xml</title> <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" /> <script type="text/javascript"> var i; var sum = 0; for (i = 10; i > 0; -...
...And 6 more matches
2D maze game with device orientation - Game development
you can create this yourself if you want to follow along: <!doctype html> <html> <head> <meta charset="utf-8" /> <title>cyber orb demo</title> <style> body { margin: 0; background: #333; } </style> <script src="src/phaser-arcade-physics.2.2.2.min.js"></script> <script src="src/boot.js"></script> <script src="src/preloader.js"></script> <script src="src/mainmenu.js"></script> <script src="src/howto.js"></script> <script src="src...
... var ball = { _width: 320, _height: 480 }; ball.boot = function(game) {}; ball.boot.prototype = { preload: function() { this.load.image('preloaderbg', 'img/loading-bg.png'); this.load.image('preloaderbar', 'img/loading-bar.png'); }, create: function() { this.game.scale.scalemode = phaser.scalemanager.show_all; this.game.scale.pagealignhorizontally = true; this.game.scale.pagealignvertically = true; this.game.state.start('preloade...
... preloader.js the preloader state takes care of loading all the assets: ball.preloader = function(game) {}; ball.preloader.prototype = { preload: function() { this.preloadbg = this.add.sprite((ball._width-297)*0.5, (ball._height-145)*0.5, 'preloaderbg'); this.preloadbar = this.add.sprite((ball._width-158)*0.5, (ball._height-50)*0.5, 'preloaderbar'); this.load.setpreloadsprite(this.preloadbar); this.load.image('ball', 'img/ball.png'); // ...
...And 6 more matches
XInclude - MDN Web Docs Glossary: Definitions of Web-related terms
); return false; } var j; var xincludeparent = xinclude.parentnode; try { netscape.security.privilegemanager.enableprivilege('universalxpconnect universalbrowserread'); // necessary with file:///-located files trying to reach external sites if (href !== null) { var response, responsetype; var request = new xmlhttprequest(); request.open('get', href, false); request.setrequestheader('if-modified-since', 'thu, 1 jan 1970 00:00:00 gmt'); request.setrequestheader('cache-control', 'no-cache'); if (accept) { request.setrequestheader('accept', accept); ...
... } if (acceptlanguage) { request.setrequestheader('accept-language', acceptlanguage); } switch (parse) { case 'text': // priority should be on media type: var contenttype = request.getresponseheader('content-type'); //text/xml; charset="utf-8" // send to get headers first?
... // fix: we test for file extensions as well in case file:// doesn't return content type (as seems to be the case); can some other tool be uesd in ff (or ie) to detect encoding of local file?
...And 6 more matches
Pseudo-classes and pseudo-elements - Learn web development
they are the first element of their type, or they are being hovered over by the mouse pointer.
... :first-of-type matches an element which is first of a certain type among its siblings.
... :last-of-type matches an element of a certain type that is last among its siblings.
...And 6 more matches
Beginner's guide to media queries - Learn web development
media query basics the simplest media query syntax looks like this: @media media-type and (media-feature-rule) { /* css rules go here */ } it consists of: a media type, which tells the browser what kind of media this code is for (e.g.
... a set of css rules that will be applied if the test passes and the media type is correct.
... media types the possible types of media you can specify are: all print screen speech the following media query will only set the body to 12pt if the page is printed.
...And 6 more matches
Positioning - Learn web development
there are a number of different types of positioning that you can put into effect on html elements.
... to make a specific type of positioning active on an element, we use the position property.
... relative positioning relative positioning is the first position type we'll take a look at.
...And 6 more matches
CSS FAQ - Learn web development
LearnCSSHowtoCSS FAQ
browsers use the doctype declaration to choose whether to show the document using a mode that is more compatible with web standards or with old browser bugs.
... using a correct and modern doctype declaration at the start of your html will improve browser standards compliance.
...documents with an incomplete, incorrect, or missing doctype declaration or a known doctype declaration in common use before 2001 will be rendered in quirks mode.
...And 6 more matches
Introduction to events - Learn web development
there are many different types of events that can occur.
...the btn constant points to a <button> element, and this type of object has a number of events that can fire on it, and therefore, event handlers available.
...btn.textcontent, or btn.style), but it is a special type — when you set it to be equal to some code, that code is run when the event fires on the button.
...And 6 more matches
Client-side storage - Learn web development
this can be used for things from complete sets of customer records to even complex data types like audio or video files.
...now type these lines into your javascript console: let myname = localstorage.getitem('name'); myname upon typing in the second line, you should see that the myname variable now contains the value of the name data item.
...type the following lines into your javascript console: localstorage.removeitem('name'); let myname = localstorage.getitem('name'); myname the third line should now return null — the name item no longer exists in the web storage.
...And 6 more matches
Third-party APIs - Learn web development
this typically involves first linking to a javascript library available on the server via a <script> element, as seen in our mapquest example: <script src="https://api.mqcdn.com/sdk/mapquest-js/v1.3.2/mapquest.js"></script> <link type="text/css" rel="stylesheet" href="https://api.mqcdn.com/sdk/mapquest-js/v1.3.2/mapquest.css"/> you can then start using the objects available in that library.
...in this case we specify the coordinates of the center of the map, a map layer of type map to show (created using the mapquest.tilelayer() method), and the default zoom level.
... changing the type of map there are a number of different types of map that can be shown with the mapquest api.
...And 6 more matches
What went wrong? Troubleshooting JavaScript - Learn web development
types of error generally speaking, when you do something wrong in code, there are two main types of error that you'll come across: syntax errors: these are spelling errors in your code that actually cause the program not to run at all, or stop working part way through — you will usually be provided with some error messages too.
...we'll look at both of these types going forward.
... fixing syntax errors earlier on in the course we got you to type some simple javascript commands into the developer tools javascript console (if you can't remember how to open this in your browser, follow the previous link to find out how).
...And 6 more matches
Deployment and next steps - Learn web development
previous overview: client-side javascript frameworks in the previous article we learning about svelte's typescript support, and how to use it to make your application more robust.
... note that our application is fully functional and porting it to typescript is completely optional.
... there are different opinions about it, and in this chapter we will talk briefly about the pros and cons of using typescript.
...And 6 more matches
NSS_3.12_release_notes.html
cspenabledhardfailurepolicy (see cert.h) cert_getclassicocspenabledsoftfailurepolicy (see cert.h) cert_getpkixverifynistrevocationpolicy (see cert.h) cert_getusepkixforvalidation (see cert.h) cert_getvaliddnspatternsfromcert (see cert.h) cert_newtempcertificate (see cert.h) cert_setocsptimeout (see certhigh/ocsp.h) cert_setusepkixforvalidation (see cert.h) cert_pkixverifycert (see cert.h) hash_gettype (see sechash.h) nss_initwithmerge (see nss.h) pk11_createmergelog (see pk11pub.h) pk11_creategenericobject (see pk11pub.h) pk11_createpbev2algorithmid (see pk11pub.h) pk11_destroymergelog (see pk11pub.h) pk11_generatekeypairwithopflags (see pk11pub.h) pk11_getpbecryptomechanism (see pk11pub.h) pk11_isremovable (see pk11pub.h) pk11_mergetokens (see pk11pub.h) pk11_writerawattribute (see pk11pub.h)...
...l ckm_camellia_cbc_pad ckm_camellia_ecb_encrypt_data ckm_camellia_cbc_encrypt_data ckg: mfgs ckg_mgf1_sha224 new error codes (see secerr.h): sec_error_not_initialized sec_error_token_not_logged_in sec_error_ocsp_responder_cert_invalid sec_error_ocsp_bad_signature sec_error_out_of_search_limits sec_error_invalid_policy_mapping sec_error_policy_validation_failed sec_error_unknown_aia_location_type sec_error_bad_http_response sec_error_bad_ldap_response sec_error_failed_to_encode_data sec_error_bad_info_access_location sec_error_libpkix_internal new mechanism flags (see secmod.h) public_mech_aes_flag public_mech_sha256_flag public_mech_sha512_flag public_mech_camellia_flag new oids (see secoidt.h) new ec signature oids sec_oid_ansix962_ecdsa_signature_recommended_digest sec_oid_ansix...
...bug 402114: fix the incorrect function prototypes of ssl handshake callbacks bug 402308: fix miscellaneous compiler warnings in nss/cmd bug 402777: lib/util can't be built stand-alone.
...And 6 more matches
NSS 3.24 release notes
ssl_configservercert automatically determines the certificate type from the certificate and private key.
... the caller is no longer required to use sslkeatype explicitly to select a "slot" into which the certificate is configured (which incorrectly identifies a key agreement type rather than a certificate).
... new elements this section lists and briefly describes the new functions, types, and macros in nss 3.24.
...And 6 more matches
NSS tools : modutil
options running modutil always requires one (and only one) option to specify the type of module operation.
... modutil supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new sqlite databases (cert9.db, key4.db, and pkcs11.txt).
...ary file: **internal only module** manufacturer: mozilla foundation description: nss internal crypto services pkcs #11 version 2.20 library version: 3.11 cipher enable flags: none default mechanism flags: rsa:rc2:rc4:des:dh:sha1:md5:md2:ssl:tls:aes slot: nss internal cryptographic services slot mechanism flags: rsa:rc2:rc4:des:dh:sha1:md5:md2:ssl:tls:aes manufacturer: mozilla foundation type: software version number: 3.11 firmware version: 0.0 status: enabled token name: nss generic crypto services token manufacturer: mozilla foundation token model: nss 3 token serial number: 0000000000000000 token version: 4.0 token firmware version: 0.0 access: write protected login type: public (no login required) user pin: not initialized slot: nss user private key and certificate se...
...And 6 more matches
sslcrt.html
upgraded documentation may be found in the current nss reference certificate functions chapter 5 certificate functions this chapter describes the functions and related types used to work with a certificate database such as the cert7.db database provided with communicator.
... returns the function returns an enumerator of type seccerttimevalidity: typedef enum { seccerttimevalid, seccerttimeexpired, seccerttimenotvalidyet } seccerttimevalidity; nss_cmpcertchainwcanames determines whether any of the signers in the certificate chain for a specified certificate are on a specified list of ca names.
... returns if successful, the function returns a pointer to a certificate object of type certcertificate.
...And 6 more matches
sslerr.html
ssl_error_unsupported_certificate_type -12280 "unsupported certificate type." the operation encountered a certificate that was not one of the well known certificate types handled by the certificate library.
...d." ssl_error_rx_unexpected_application_data -12234 "ssl received an unexpected application data record." received record/message with unknown discriminant: all the error codes in the following block indicate that the local socket received an ssl3 record or handshake message from the remote peer that it was unable to interpret because the byte that identifies the type of record or message contained an unrecognized value.
... ssl_error_rx_unknown_record_type -12233 "ssl received a record with an unknown content type." ssl_error_rx_unknown_handshake -12232 "ssl received a handshake message with an unknown message type." ssl_error_rx_unknown_alert -12231 "ssl received an alert record with an unknown alert description." received an alert report: all the error codes in the following block indicate that the local socket received an ssl3 or tls alert record from the remote peer, reporting some issue that it had with an ssl record or handshake message it received.
...And 6 more matches
NSS tools : modutil
MozillaProjectsNSStoolsmodutil
options running modutil always requires one (and only one) option to specify the type of module operation.
... modutil supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new sqlite databases (cert9.db, key4.db, and pkcs11.txt).
... **internal only module** manufacturer: mozilla foundation description: nss internal crypto services pkcs #11 version 2.20 library version: 3.11 cipher enable flags: none default mechanism flags: rsa:rc2:rc4:des:dh:sha1:md5:md2:ssl:tls:aes slot: nss internal cryptographic services slot mechanism flags: rsa:rc2:rc4:des:dh:sha1:md5:md2:ssl:tls:aes manufacturer: mozilla foundation type: software version number: 3.11 firmware version: 0.0 status: enabled token name: nss generic crypto services token manufacturer: mozilla foundation token model: nss 3 token serial number: 0000000000000000 token version: 4.0 token firmware version: 0.0 access: write protected login type: public (no login required) user pin: not initialized slot: nss user pri...
...And 6 more matches
Rhino scopes and contexts
in general, variables are looked up by starting at the current variable object (which is different depending on what code is being executed in the program), traversing its prototype chain, and then traversing the parent chain.
... order of lookups in a two-deep scope chain with prototypes.
... to do this we set an object's prototype.
...And 6 more matches
JS::Value
js::value is the type of javascript values in the jsapi.
... a c++ variable of type js::value represents a value in javascript: a string, number, object (including arrays and functions), boolean, symbol, null, or undefined.
... the data in a js::value can be accessed using these member functions: js type js::value type tests constructor accessors mutators null val.isnull() js::nullvalue() n/a val.setnull() undefined val.isundefined() js::undefinedvalue() n/a val.setundefined() boolean val.isboolean(), val.istrue(), val.isfalse() js::booleanvalue(bool), js::truevalue(), js::falsevalue() val.toboolean() val.setboolean(bool) number val.isint32(), val.isdouble(), val.isnumber() js::numbervalue(any number type), js::int32value(int32_t), js::doublevalue(dou...
...And 6 more matches
JSConvertOp
jsconvertop is the type of jsclass.convert.
... syntax typedef bool (* jsconvertop)(jscontext *cx, js::handleobject obj, jstype type, js::mutablehandlevalue vp); name type description cx jscontext * the context in which the convert is taking place.
... hint jstype the hint to pass to the [[defaultvalue]] hook when converting the object.
...And 6 more matches
JS_ConvertArguments
converts a series of js values, passed in an argument array, to their corresponding js types.
... syntax bool js_convertarguments(jscontext *cx, const js::callargs &args, const char *format, ...); // added in spidermonkey 31 bool js_convertarguments(jscontext *cx, unsigned argc, jsval *argv, const char *format, ...); // obsolete since jsapi 30 name type description cx jscontext * the context in which to perform any necessary conversions.
...(the purpose is to ensure gc safety.) format const char * null-terminated string describing the types of the out parameters and how to convert the values in argv.
...And 6 more matches
SpiderMonkey 24
many jsapi types, functions, and callback signatures have changed, though most of them still have the same names and do the same things.
... many of the garbage collector changes require type signature changes to jsapi methods: specifically introducing js::rooted, js::handle, and js::mutablehandle types.
... these types, with the appropriate parametrizations, can roughly be substituted for plain types of gc things (values, string/object pointers, etc.).
...And 6 more matches
IAccessibleValue
the exact return type is implementation dependent.
... typical types are long and double.
...the type of the returned value is implementation dependent.
...And 6 more matches
nsIDragService
nsidragsession getcurrentsession( ) ; void invokedragsession( in nsidomnode adomnode, in nsisupportsarray atransferables, in nsiscriptableregion aregion, in unsigned long aactiontype ); void invokedragsessionwithimage(in nsidomnode adomnode, in nsisupportsarray atransferablearray, in nsiscriptableregion aregion, in unsigned long aactiontype, in nsidomnode aimage, in long aimagex, in long aimagey, in nsidomdragevent adragevent, in nsidomdatatransfer adatatransfer); void invokedragsessionwithselection(in nsiselection aselection, in nsisupportsarray atransfera...
...blearray, in unsigned long aactiontype, in nsidomdragevent adragevent, in nsidomdatatransfer adatatransfer); void startdragsession( ) ; void suppress(); void unsuppress(); constants constant value description dragdrop_action_none 0 no action.
... invokedragsession() starts a modal drag session with an array of transferables void invokedragsession( in nsidomnode adomnode, in nsisupportsarray atransferables, in nsiscriptableregion aregion, in unsigned long aactiontype ); parameters adomnode the source node on which the drag gesture was started.
...And 6 more matches
nsIHttpServer
(not supported) * @param function callback optional callback */ listen: function(port, opt, callback) { if (arguments.length == 2 && "function" == typeof opt) { callback = opt; } if (callback) { this.registerprefixhandler("/", callback); } let host = "localhost"; if (typeof port === "string" && port.indexof(':') != -1){ [host, port] = port.split(':'); port = parseint(port); server.identity.add('http', host, ...
...* another directory); if null, any current mapping for the given path is * removed * @throws ns_error_invalid_arg * if dir is non-null and does not exist or is not a directory, or if path * does not begin with and end with a forward slash */ void registerdirectory(in string path, in nsifile dir); /** * associates files with the given extension with the given content-type when * served by this server, in the absence of any file-specific information * about the desired content-type.
... if type is empty, removes any extant * mapping, if one is present.
...And 6 more matches
nsILocalFileMac
void inittoappwithcreatorcode(in ostype aappcreator); native code only!
...obsolete since gecko 1.9.2 boolean ispackage(); void launchwithdoc(in nsilocalfile adoctoload, in boolean alaunchinbackground); void opendocwithapp(in nsilocalfile aapptoopenwith, in boolean alaunchinbackground); void setfiletypeandcreatorfromextension(in string aextension); obsolete since gecko 1.9.2 void setfiletypeandcreatorfrommimetype(in string amimetype); obsolete since gecko 1.9.2 attributes attribute type description bundledisplayname astring returns the display name of the application bundle (usually the human readable name of the application) read only.
... filecreator ostype native code only!
...And 6 more matches
nsISelectionController
rward, in boolean extend); boolean checkvisibility(in nsidomnode node, in short startoffset, in short endoffset); void completemove(in boolean forward, in boolean extend); void completescroll(in boolean forward); boolean getcaretenabled(); short getdisplayselection(); nsiselection getselection(in short type); void intralinemove(in boolean forward, in boolean extend); void linemove(in boolean forward, in boolean extend); void pagemove(in boolean forward, in boolean extend); void repaintselection(in short type); void scrollhorizontal(in boolean left); void scrollline(in boolean forward); voi...
...d scrollpage(in boolean forward); void scrollselectionintoview(in short type, in short region, in short flags); void selectall(); void setcaretenabled(in boolean enabled); void setcaretreadonly(in boolean readonly); void setcaretvisibilityduringselection(in boolean visibility); void setcaretwidth(in short pixels); obsolete since gecko 1.8 void setdisplayselection(in short toggle); void wordextendfordelete(in boolean forward); native code only!
... void wordmove(in boolean forward, in boolean extend); attributes attribute type description caretvisible boolean this is true if the caret is enabled, visible, and currently blinking.
...And 6 more matches
nsIStyleSheetService
to create an instance, use: var stylesheetservice = components.classes["@mozilla.org/content/style-sheet-service;1"] .getservice(components.interfaces.nsistylesheetservice); method overview void loadandregistersheet(in nsiuri sheeturi, in unsigned long type); boolean sheetregistered(in nsiuri sheeturi, in unsigned long type); void unregistersheet(in nsiuri sheeturi, in unsigned long type); constants constant value description agent_sheet 0 user_sheet 1 author_sheet 2 methods loadandreg...
...void loadandregistersheet( in nsiuri sheeturi, in unsigned long type ); parameters sheeturi uri of the stylesheet to load and register.
... type one of the type constants.
...And 6 more matches
Using C struct and pointers
in this example, we show how to use c structs and pointers with js-ctypes.
... declaring a js-ctypes struct matching a c struct if we have a c structure like this: struct st_t { void *self; char *str; size_t buff_size; int i; float f; char c; }; we can use it in javascript by writing something like this: var st_t = new ctypes.structtype("st_t", [ { "self": ctypes.pointertype(ctypes.void_t) }, { "str": ctypes.pointertype(ctypes.char) }, { "buff_size": ctypes.size_t }, { "i": ctypes.int }, { "f": ctypes.float }, { "c": ctypes.char } ]); here we are using the structtype() factory method of the ctypes object to create a ctype object that represents the c struct named st_t.
... the first parameter of this method is the name of the type, which corresponds to the name of the c struct.
...And 6 more matches
Mozilla
continuous integration when you push a commit to mozilla-central or a related repository, it initiates a large chain of builds and tests across multiple types of infrastructure.
... how mozilla determines mime types all data handling in mozilla is based on the mime type of the content.
... this means that every time an uri is loaded, mozilla must find out its mime type.
...And 6 more matches
Debugger - Firefox Developer Tools
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.
... assigning anything other than a callable value or null to this property throws a typeerror exception.
...any value assigned to a debugging handler must be either a function or undefined; otherwise a typeerror is thrown.
...And 6 more matches
Examine and edit CSS - Firefox Developer Tools
filtering rules there's a box at the top of the rules view labeled "filter styles": as you type: any rules which don't contain the typed string at all are hidden any declarations which contain the typed string are highlighted click the "x" at the end of the search box to remove the filter.
...once you've typed in a filter, you can press esc to remove it again.
...autocompletions based on existing classes are suggested as you type.
...And 6 more matches
HTML Drag and Drop API - Web APIs
for web sites, extensions, and xul applications, you can customize which elements can become draggable, the type of feedback the draggable elements produce, and the droppable elements.
... during drag operations, several event types are fired, and some events might fire many times, such as the drag and dragover events.
... each drag event type has an associated global event handler: event on event handler fires when… drag ondrag …a dragged item (element or text selection) is dragged.
...And 6 more matches
MediaSession.setActionHandler() - Web APIs
syntax navigator.mediasession.setactionhandler(type, callback) parameters type a domstring representing an action type to listen for.
...further details on the action types can be found below under media session actions.
... callback a function to call when the specified action type is invoked.
...And 6 more matches
PerformanceEntry - Web APIs
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.
...And 6 more matches
PerformanceObserverEntryList.getEntries() - Web APIs
the list's members are determined by the set of entry types specified in the call to the observe() method.
... syntax general syntax: entries = list.getentries(); entries = list.getentries(performanceentryfilteroptions); specific usage: entries = list.getentries({name: "entry_name", entrytype: "mark"}); parameters performanceentryfilteroptionsoptional is a performanceentryfilteroptions dictionary, having the following fields: "name", the name of a performance entry.
... "entrytype", the entry type.
...And 6 more matches
PerformanceObserverEntryList.getEntriesByName() - Web APIs
the getentriesbyname() method of the performanceobserverentrylist interface returns a list of explicitly observed performance entry objects for a given name and entry type.
... the list's members are determined by the set of entry types specified in the call to the observe() method.
... syntax entries = list.getentriesbyname(name, type); parameters name a domstring representing the name of the entry to retrieve.
...And 6 more matches
Performance API - Web APIs
as such, the performance api defines a domhighrestimestamp type rather than using the date.now() interface.
... domhighrestimestamp the domhighrestimestamp type, as its name implies, represents a high resolution point in time.
... this type is a double and is used by the performance interfaces.
...And 6 more matches
Using Performance Timeline - Web APIs
the following example show the usage of these methods getentries(), getentriesbyname() and getentriesbytype().
... function log(s) { var o = document.getelementsbytagname("output")[0]; o.innerhtml += s + " <br>"; } function do_work (n) { for (var i=0 ; i < n; i++) { var m = math.random(); } } function print_perf_entry(pe) { log("..name: " + pe.name + "; entrytype: " + pe.entrytype + "; starttime: " + pe.starttime + "; duration: " + pe.duration); } function print_performanceentries() { if (performance.mark === undefined) { log("...
...ies via the mark() and measure() methods performance.mark("begin"); do_work(50000); performance.mark("end"); do_work(50000); performance.measure("measure1", "begin", "end"); // use getentries() to iterate all entries var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("all entry[" + i + "]"); print_perf_entry(p[i]); } // use getentries(name, entrytype) to get specific entries p = performance.getentries({name : "measure1", entrytype: "measure"}); for (var i=0; i < p.length; i++) { log("begin and measure [" + i + "]"); print_perf_entry(p[i]); } // use getentriesbytype() to get all "mark" entries p = performance.getentriesbytype("mark"); for (var i=0; i < p.length; i++) { log ("mark only [" + i + "]"); print_perf_entr...
...And 6 more matches
Performance Timeline - Web APIs
the methods are: getentries() returns all recorded performance entries or, optionally, the entries based on the specified name, performance type and/or the initiatortype (such as an html element).
... getentriesbyname() returns the recorded performance entries based on the specified name and optionally the performance type.
... getentriesbytype() returns the recorded performance entries based on the specified performance type.
...And 6 more matches
RTCStatsReport - Web APIs
properties common to all statistic categories all webrtc statistics objects are fundamentally based on the rtcstats dictionary, which provides the most fundamental information: the timestamp, the statistic type string, and an id uniquely identifying the source of the data: id a domstring which uniquely identifies the object which was inspected to produce this object based on rtcstats.
... type a domstring indicating the type of statistics the object contains, taken from the enum type rtcstatstype.
... the statistic categories the type gives the name of the statistic category represented by the object, and is how you locate the specific type of data you need.
...And 6 more matches
SVGComponentTransferFunctionElement - Web APIs
f8" stroke="#d4dde4" stroke-width="2px" /><text x="306" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgcomponenttransferfunctionelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_fecomponenttransfer_type_unknown 0 the type is not one of predefined types.
... 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_fecomponenttransfer_type_identity 1 corresponds to the value identity.
...And 6 more matches
SVGMarkerElement - Web APIs
void setorienttoangle(in svgangle angle) void setorienttoauto() properties svganimatedlength refx svganimatedlength refy svganimatedenumeration markerunits svganimatedlength markerwidth svganimatedlength markerheight svganimatedenumeration orienttype svganimatedangle orientangle constants svg_marker_orient_unknown = 0 svg_marker_orient_auto = 1 svg_marker_orient_angle = 2 svg_markerunits_unknown = 0 svg_markerunits_userspaceonuse = 1 svg_markerunits_strokewidth ...
...= 2 normative document svg 1.1 (2nd edition) constants orientation name value description svg_marker_orient_unknown 0 the marker orientation is not one of predefined types.
... it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
...And 6 more matches
Sending and Receiving Binary Data - Web APIs
receiving binary data using javascript typed arrays the responsetype property of the xmlhttprequest object can be set to change the expected response type from the server.
...the response property will contain the entity body according to responsetype, as an arraybuffer, blob, document, json, or string.
... var oreq = new xmlhttprequest(); oreq.open("get", "/myfile.png", true); oreq.responsetype = "arraybuffer"; oreq.onload = function (oevent) { var arraybuffer = oreq.response; // note: not oreq.responsetext if (arraybuffer) { var bytearray = new uint8array(arraybuffer); for (var i = 0; i < bytearray.bytelength; i++) { // do something with each byte in the array } } }; oreq.send(null); you can also read a binary file as a blob by setting the string "blob" to the responsetype property.
...And 6 more matches
XMLHttpRequest.response - Web APIs
the xmlhttprequest response property returns the response's body content as an arraybuffer, blob, document, javascript object, or domstring, depending on the value of the request's responsetype property.
... syntax var body = xmlhttprequest.response; value an appropriate object based on the value of responsetype.
... you may attempt to request the data be provided in a specific format by setting the value of responsetype after calling open() to initialize the request but before calling send() to send the request to the server.
...And 6 more matches
XRSession - Web APIs
WebAPIXRSession
visibilitystate read only a domstring whose value is one of those found in the xrvisibilitystate enumerated type, indicating whether or not the session's imagery is visible to the user, and if so, if it's being visible but not currently the target for user events.
... 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.
...And 6 more matches
Border-image generator - CSS: Cascading Style Sheets
-stateid="border5"/> <img class="image" src="https://udn.realityripple.com/samples/fb/c0b285d3da.svg" data-stateid="border6"/> </div> </div> <div id="load-actions" class="group section"> <div id="toggle-gallery" data-action="hide"> </div> <div id="load-image" class="button"> upload image </div> <input id="remote-url" type="text" placeholder="load an image from url"/> <div id="load-remote" class="button"> </div> </div> <div id="general-controls" class="group section"> <div class="name"> control box </div> <div class="separator"></div> <div class="property"> <div class="name">scale</div> <div class="ui-input-slider" data...
...t; } #output .css-property .value { width: 65%; padding: 0 2.5%; word-break: break-all; float: left; } javascript content 'use strict'; /** * ui-slidersmanager */ var inputslidermanager = (function inputslidermanager() { var subscribers = {}; var sliders = []; var inputcomponent = function inputcomponent(obj) { var input = document.createelement('input'); input.setattribute('type', 'text'); input.style.width = 50 + obj.precision * 10 + 'px'; input.addeventlistener('click', function(e) { this.select(); }); input.addeventlistener('change', function(e) { var value = parsefloat(e.target.value); if (isnan(value) === true) setvalue(obj.topic, obj.value); else setvalue(obj.topic, value); }); return input; }; var slidercomponent = function s...
..._right.classname = 'ui-input-slider-right'; if (name) { var info = document.createelement('span'); info.classname = 'ui-input-slider-info'; info.textcontent = name; node.appendchild(info); } node.appendchild(slider_left); node.appendchild(input); node.appendchild(slider_right); this.input = input; sliders[topic] = this; setvalue(topic, value); }; inputslider.prototype.setinputvalue = function setinputvalue() { this.input.value = this.value.tofixed(this.precision) + this.unit; }; var setvalue = function setvalue(topic, value, send_notify) { var slider = sliders[topic]; if (slider === undefined) return; value = parsefloat(value.tofixed(slider.precision)); if (value > slider.max) value = slider.max; if (value < slider.min) value = slider.min; ...
...And 6 more matches
Border-radius generator - CSS: Cascading Style Sheets
lect: text; -webkit-user-select: text; -ms-user-select: text; user-select: text; float: right; } javascript content 'use strict'; /** * ui-inputslidermanager */ var inputslidermanager = (function inputslidermanager() { var subscribers = {}; var sliders = []; var inputcomponent = function inputcomponent(obj) { var input = document.createelement('input'); input.setattribute('type', 'text'); input.addeventlistener('click', function(e) { this.select(); }); input.addeventlistener('change', function(e) { var value = parseint(e.target.value); if (isnan(value) === true) setvalue(obj.topic, obj.value); else setvalue(obj.topic, value); }); subscribe(obj.topic, function(value) { input.value = value + obj.unit; }); return input; } var sl...
...) { var topic = node.getattribute('data-topic'); var state = node.getattribute('data-state'); var name = node.getattribute('data-label'); var align = node.getattribute('data-text-on'); state = (state === "true"); var checkbox = document.createelement("input"); var label = document.createelement("label"); var id = 'checkbox-' + topic; checkbox.id = id; checkbox.setattribute('type', 'checkbox'); checkbox.checked = state; label.setattribute('for', id); if (name) { label.classname = 'text'; if (align) label.classname += ' ' + align; label.textcontent = name; } node.appendchild(checkbox); node.appendchild(label); this.node = node; this.topic = topic; this.checkbox = checkbox; checkbox.addeventlistener('change', function(e) { notify.call...
...{ this.container = document.createelement("div"); this.select = document.createelement("select"); for (var i in units) { var option = document.createelement("option"); option.value = i; option.textcontent = units[i]; this.select.appendchild(option); } this.container.classname = 'dropdown ' + 'unit-' + topic; this.container.appendchild(this.select); } unitselector.prototype.setvalue = function setvalue(value) { this.salect.value = value; } var radiuscontainer = function radiuscontainer(node) { var radius = document.createelement('div'); var handle = document.createelement('div'); var x = node.getattribute('data-x'); var y = node.getattribute('data-y'); var active = false; this.id = node.id; this.node = node; this.radius = radius; this.handle...
...And 6 more matches
CSS reference - CSS: Cascading Style Sheets
WebCSSReference
use this css reference to browse an alphabetical index of all of the standard css properties, pseudo-classes, pseudo-elements, data types, and at-rules.
... you can also browse key css concepts and a list of selectors organized by type.
...the syntax for each specified value depends on the data type defined for each specified property.
...And 6 more matches
Visual formatting model - CSS: Cascading Style Sheets
the layout of these boxes is governed by: box dimensions and type.
...generated boxes are of different types, which affect their visual formatting.
... the type of the box generated depends on the value of the css display property.
...And 6 more matches
font - CSS: Cascading Style Sheets
WebCSSfont
d:font-style: as specifiedfont-variant: as specifiedfont-weight: the keyword or the numerical value as specified, with bolder and lighter transformed to the real valuefont-stretch: as specifiedfont-size: as specified, but with relative lengths converted into absolute lengthsline-height: for percentage and length values, the absolute length, otherwise as specifiedfont-family: as specifiedanimation typeas each of the properties of the shorthand:font-style: discretefont-variant: discretefont-weight: a font weightfont-stretch: a font stretchfont-size: a lengthline-height: either number or lengthfont-family: discrete formal syntax [ [ <'font-style'> | <font-variant-css21> | <'font-weight'> | <'font-stretch'> ]?
...</p> <form action="createshorthand()"> <div class="cf"> <div class="setpropcont"> font-style<br/> <input type="radio" id="font-style-none" name="font_style" checked="" value="" onchange="setcss()"> <label for="font-style-none">none</label><br/> <input type="radio" id="font-style-normal" name="font_style" value="normal" onchange="setcss()"> <label for="font-style-normal">normal</label><br/> <input type="radio" id="font-style-italic" name="font_style" value="italic" onchange="setcss...
...()"> <label for="font-style-italic">italic</label><br/> <input type="radio" id="font-style-oblique" name="font_style" value="oblique" onchange="setcss()"> <label for="font-style-oblique">oblique</label> </div> <div class="setpropcont"> font-variant<br> <input type="radio" id="font-variant-none" name="font_variant" checked="" value=" " onchange="setcss()"> <label for="font-variant-none">none</label><br/> <input type="radio" id="font-variant-normal" name="font_variant" value="normal" onchange="setcss()"> <label for="font-variant-normal">normal</label><br/> <input type="radio" id="font-variant-small-caps" name="font_variant" value="small-caps" onchange="setcss()"> <label for="font-variant-small-caps">small-caps</label> ...
...And 6 more matches
Setting up adaptive streaming media sources - Developer guides
the mpd file tells the browser where the various pieces of media are located, it also includes meta data such as mimetype and codecs and there are other details such as byte-ranges in there too - it is an xml document and in many cases will be generated for you.
... <?xml version="1.0" encoding="utf-8"?> <mpd xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xsi:schemalocation="urn:mpeg:dash:schema:mpd:2011 dash-mpd.xsd" type="static" mediapresentationduration="pt654s" minbuffertime="pt2s" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011"> <baseurl>http://example.com/ondemand/</baseurl> <period> <!-- english audio --> <adaptationset mimetype="audio/mp4" codecs="mp4a.40.5" lang="en" subsegmentalignment="true" subsegmentstartswithsap="1"> <representation id="1" bandwidth="64000"> <ba...
...seurl>elephantsdream_aac48k_064.mp4.dash</baseurl> </representation> </adaptationset> <!-- video --> <adaptationset mimetype="video/mp4" codecs="avc1.42401e" subsegmentalignment="true" subsegmentstartswithsap="1"> <representation id="2" bandwidth="100000" width="480" height="360"> <baseurl>elephantsdream_h264bpl30_0100.264.dash</baseurl> </representation> <representation id="3" bandwidth="175000" width="480" height="360"> <baseurl>elephantsdream_h264bpl30_0175.264.dash</baseurl> </representation> <representation id="4" bandwidth="250000" width="480" height="360"> <baseurl>elephantsdream_h264bpl30_0250.264.dash</baseurl> </representation> <representation id="5" bandwidth="500000" width="480" height="360"> ...
...And 6 more matches
HTML attribute: step - HTML: Hypertext Markup Language
WebHTMLAttributesstep
valid for the numeric input types, including the date, month, week, time, datetime-local, number and range types, the step attribute is a number that specifies the granularity that the value must adhere to or the keyword any.
... the step sets the stepping interval when clicking up and down spinner buttons, moving a slider left and right on a range, and validating the different date types.
... if not explicitly included, step defaults to 1 for number and range, and 1 unit type (minute, week, month, day) for the date/time input types.
...And 6 more matches
<button>: The Button element - HTML: Hypertext Markup Language
WebHTMLElementbutton
formenctype html5 if the button is a submit button (it's inside/associated with a <form> and doesn't have type="button"), specifies how to encode the form data that is submitted.
... multipart/form-data: use to submit <input> elements with their type attributes set to file.
... if this attribute is specified, it overrides the enctype attribute of the button's form owner.
...And 6 more matches
<menuitem> - HTML: Hypertext Markup Language
WebHTMLElementmenuitem
(menu items for indirect commands gain checkboxes or radio buttons when defined against elements <input type="checkbox"> and <input type="radio">.) content categories none.
...(if specified, the type attribute of the <menu> element must be popup; if missing, the parent element of the <menu> must itself be a <menu> in the popup menu state.) permitted aria roles none dom interface htmlmenuitemelement attributes this element includes the global attributes; in particular title can be used to describe the command, or provide usage hints.
...may only be used when the type attribute is checkbox or radio.
...And 6 more matches
<tr>: The Table Row element - HTML: Hypertext Markup Language
WebHTMLElementtr
this alignment type was never widely supported.
... let's apply a basic style to the table to adjust the typeface being used, and add a background color to the header row.
... table { border: 1px solid black; font: 16px "open sans", helvetica, arial, sans-serif; } thead > tr { background-color: rgb(228, 240, 245); } th, td { border: 1px solid black; padding:4px 6px; } while we add a font property to the <table> element here to set a more visually-appealing typeface (or an an abominable sans-serif typeface, depending on your personal opinion), the interesting part is the second style here, where we style <tr> elements located within the <thead> so they have a light blue background color.
...And 6 more matches
Array.from() - JavaScript
this is especially important for certain array subclasses, like typed arrays, since the intermediate array would necessarily have values truncated to fit into the appropriate type.
... polyfill notes: this algorithm is exactly as specified in ecma-262 6th edition (assuming object and typeerror have their original values and that callback.call() evaluates to the original value of function.prototype.call()).
...symbol.iterator : 'symbol(symbol.iterator)'; } catch { symboliterator = 'symbol(symbol.iterator)'; } var tostr = object.prototype.tostring; var iscallable = function (fn) { return ( typeof fn === 'function' || tostr.call(fn) === '[object function]' ); }; var tointeger = function (value) { var number = number(value); if (isnan(number)) return 0; if (number === 0 || !isfinite(number)) return number; ...
...And 6 more matches
BigInt64Array() constructor - JavaScript
the bigint64array() typed array constructor creates a new bigint64array object, which is, an array of 64-bit signed integers in the platform byte order.
... syntax new bigint64array(); new bigint64array(length); new bigint64array(typedarray); new bigint64array(object); new bigint64array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... typedarray when called with a typedarray argument, which can be an object of any of the typed array types (such as int32array), the typedarray gets copied into a new typed array.
...And 6 more matches
BigUint64Array() constructor - JavaScript
the biguint64array() typed array constructor creates a new biguint64array object, which is, an array of 64-bit unsigned integers in the platform byte order.
... syntax new biguint64array(); new biguint64array(length); new biguint64array(typedarray); new biguint64array(object); new biguint64array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... typedarray when called with a typedarray argument, which can be an object of any of the typed array types (such as int32array), the typedarray gets copied into a new typed array.
...And 6 more matches
WebAssembly.CompileError - JavaScript
instance properties webassembly.compileerror.prototype.message error message.
... although ecma-262 specifies that urierror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
... webassembly.compileerror.prototype.name error name.
...And 6 more matches
WebAssembly.LinkError - JavaScript
instance properties webassembly.linkerror.prototype.message error message.
... although ecma-262 specifies that urierror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
... webassembly.linkerror.prototype.name error name.
...And 6 more matches
Strict mode - JavaScript
assignments, which would accidentally create global variables, instead throw an error in strict mode: 'use strict'; // assuming no global variable mistypedvariable exists mistypevariable = 17; // this line throws a referenceerror due to the // misspelling of variable second, strict mode makes assignments which would otherwise silently fail to throw an exception.
...any assignment that silently fails in normal code (assignment to a non-writable global or property, assignment to a getter-only property, assignment to a new property on a non-extensible object) will throw in strict mode: 'use strict'; // assignment to a non-writable global var undefined = 5; // throws a typeerror var infinity = 5; // throws a typeerror // assignment to a non-writable property var obj1 = {}; object.defineproperty(obj1, 'x', { value: 42, writable: false }); obj1.x = 9; // throws a typeerror // assignment to a getter-only property var obj2 = { get x() { return 17; } }; obj2.x = 5; // throws a typeerror // assignment to a new property on a non-extensible object var fixed = {}; object.
...preventextensions(fixed); fixed.newprop = 'ohai'; // throws a typeerror third, strict mode makes attempts to delete undeletable properties throw (where before the attempt would simply have no effect): 'use strict'; delete object.prototype; // throws a typeerror fourth, strict mode prior to gecko 34 requires that all properties named in an object literal be unique.
...And 6 more matches
Media - Progressive web apps (PWAs)
css has the capacity to present content according to the media type.
... to specify rules that are specific to a type of media, use @media followed by the media type, followed by curly braces that enclose the rules.
...this css (below) removes the navigation area when printing the document: @media print { #nav-area {display: none;} } some common media types are: screen color device display print printed paged media projection projected display all all media (the default) more details there are other ways to specify the media type for a set of rules.
...And 6 more matches
<a> - SVG: Scalable Vector Graphics
WebSVGElementa
value type: <string> ; default value: none; animatable: no href the url or url fragment the hyperlink points to.
... value type: <url> ; default value: none; animatable: yes hreflang the human language of the url or url fragment that the hyperlink points to.
... value type: <string> ; default value: none; animatable: yes ping a space-separated list of urls to which, when the hyperlink is followed, post requests with the body ping will be sent by the browser (in the background).
...And 6 more matches
<altGlyph> - SVG: Scalable Vector Graphics
WebSVGElementaltGlyph
value type: <list-of-coordinates> ; default value: absolute x-coordinate of ancestor <text> or <tspan>; animatable: yes y this attribute defines the corresponding absolute y-coordinates for rendering the element.
... value type: <list-of-coordinates> ; default value: absolute y-coordinate of ancestor <text> or <tspan>; animatable: yes dx this attribute indicates a shift along the x-axis on the position of the element.
... value type: <list-of-coordinates> ; default value: relative x-coordinate of ancestor <text> or <tspan>; animatable: yes dy this attribute indicates a shift along the x-axis on the position of the element.
...And 6 more matches
<linearGradient> - SVG: Scalable Vector Graphics
argradient id="mygradient" gradienttransform="rotate(90)"> <stop offset="5%" stop-color="gold" /> <stop offset="95%" stop-color="red" /> </lineargradient> </defs> <!-- using my linear gradient --> <circle cx="5" cy="5" r="4" fill="url('#mygradient')" /> </svg> attributes gradientunits this attribute defines the coordinate system for attributes x1, x2, y1, y2 value type: userspaceonuse|objectboundingbox ; default value: objectboundingbox; animatable: yes gradienttransform this attribute provides additional transformation to the gradient coordinate system.
... value type: <transform-list> ; default value: identity transform; animatable: yes href this attribute defines a reference to another <lineargradient> element that will be used as a template.
... value type: <url> ; default value: none; animatable: yes spreadmethod this attribute indicates how the gradient behaves if it starts or ends inside the bounds of the shape containing the gradient.
...And 6 more matches
Interacting with page scripts - Archive of obsolete content
in this example a page script adds a string variable foo to the window: <!doctype html"> <html> <head> <script> window.foo = "hello from page script" </script> </head> </html> the content script can see this object if it uses unsafewindow.foo instead of window.foo: // main.js var tabs = require("sdk/tabs"); var mod = require("sdk/page-mod"); var self = require("sdk/self"); var pageurl = self.data.url("page.html") var pagemod = mod.pagemod({ include: page...
...dow.clonedcontentscriptobject = cloneinto(contentscriptobject, unsafewindow); unsafewindow.assignedcontentscriptobject = contentscriptobject; the "page.html" file adds two buttons and assigns an event listener to each: one listener displays a property of the cloned object, and the other listener displays a property of the assigned object: <html> <head> </head> <body> <input id="works" type="button" value="i will work"/> <input id="fails" type="button" value="i will not work"/> <script> var works = document.getelementbyid("works"); works.addeventlistener("click", function() { alert(clonedcontentscriptobject.greeting); }, false); var fails = document.getelementbyid("fails"); fails.addeventlistener("click", function() { alert(ass...
...e function's closure will be exported, too: // content-script.js var salutation = "hello, "; function greetme(user) { return salutation + user; } exportfunction(greetme, unsafewindow, {defineas: "greetme"}); finally, the "page.html" file adds a button and a page script that calls the exported function when the user pushes the button: <html> <head> </head> <body> <input id="test" type="button" value="click me"/> <script> var test = document.getelementbyid("test"); test.addeventlistener("click", function() { alert(window.greetme("page script")); }, false); </script> </body> </html> exportfunction() works by structured cloning the arguments and return value of the function from one scope to the other.
...And 5 more matches
Working with Events - Archive of obsolete content
adding listeners you can add a listener to an event emitter by calling its on(type, listener) method.
... it takes two parameters: type: the type of event we are interested in, identified by a string.
... many event emitters may emit more than one type of event: for example, a browser window might emit both open and close events.
...And 5 more matches
request - Archive of obsolete content
parameters options : object optional options: name type url string,url this is the url to which the request will be made.
... contenttype string the type of content to send to the server.
... this explicitly sets the content-type header.
...And 5 more matches
Adding menus and submenus - Archive of obsolete content
="&xulschoolhello.greet.long.label;" oncommand="xulschoolchrome.greetingdialog.greetinglong(event);" /> <menuseparator /> <menuitem label="&xulschoolhello.greet.custom.label;" oncommand="xulschoolchrome.greetingdialog.greetingcustom(event);" /> </menupopup> </menu> </menubar> </toolbox> this code displays a simple menu with options for 3 different types of greetings, a menuseparator, and finally an option to show a custom greeting.
... the separator is usually displayed as a horizontal line that creates a logical division between different types of menuitem elements, keeping everything more organized.
...--> </menupopup> </menu> </menupopup> now let's look at some specialized types of menu items.
...And 5 more matches
New Security Model for Web Services - Archive of obsolete content
<!element webscriptaccess (delegate?|allow*)> <!element delegate empty> <!element allow empty> <!attlist allow type|from cdata #implied>.
... allowing web script access to permit scripts to access the resources of this server, use the following command: <wsa:allow type="<request-type>" from ="<uri-prefix>"/> the type of request, if specified, will be checked against the type of request being requested by the script, such as "soap", "soapv", or "load".
... types must not contain spaces.
...And 5 more matches
Proxy UI - Archive of obsolete content
for the purposes of this document, "proxy mode" means both: whatever was selected in the ui (as opposed to the value of the network.proxy.type.
... the currently available modes are based on "network.proxy.type".
... for example, firefox 3: [ ] no proxy [ ] auto-detect proxy settings for this network [ ] manual proxy configuration: [ ] automatic proxy configuration url: behavior default value: "no proxy" is selected all other "type" radio buttons are enabled, but not selected.
...And 5 more matches
appendNotification - Archive of obsolete content
« xul reference home appendnotification( label , value , image , priority , buttons, eventcallback ) return type: element create a new notification and display it.
...the type property must also be set to "menu", or "menu-button".
... type - a string.
...And 5 more matches
SQLite Templates - Archive of obsolete content
to do this, set the querytype attribute on the root node of the template to the value storage.
...the datasources attribute may be set to one of two possible types of values.
... <listbox datasources="profile:userdata.sqlite" ref="*" querytype="storage"> <template> <query> select name from myfriends </query> <action> <listitem uri="?" label="?name"/> </action> </template> </listbox> the query returns the list of values from the 'name' column in the table 'myfriends'.
...And 5 more matches
Box Objects - Archive of obsolete content
a xul element, for example, will have a xulelement type of content node.
...unless you change the style for an element, most xul elements will usually use the box layout object or one of its subtypes.
... recall that all xul elements are types of boxes, that is the box is the base of all displayed xul elements.
...And 5 more matches
key - Archive of obsolete content
ArchiveMozillaXULkey
attributes command, disabled, key, keycode, keytext, modifiers, oncommand, phase examples (example needed) attributes command type: id set to the id of a command element that is being observed by the element.
... disabled type: boolean indicates whether the element is disabled or not.
... key type: character the character that must be pressed.
...And 5 more matches
progressmeter - Archive of obsolete content
attributes max, mode, value properties accessibletype, max, mode, value examples <progressmeter mode="determined" value="82"/> <progressmeter mode="undetermined"/> <!-- switching modes while the mouse is over a button --> <progressmeter mode="determined" id="myprogress"/> <button label="example" onmouseover="setloading(true)" onmouseout="setloading(false)"/> function setloading(state){ document.getelementbyid('myprog...
...'undetermined' : 'determined'; } attributes max type: integer the maximum value that progressmeter may have.
... mode type: one of the values below a determinedprogressmeter is used in cases where you know how long an operation will take.
...And 5 more matches
Introduction to Public-Key Cryptography - Archive of obsolete content
in general, before issuing a certificate, the ca must use its published verification procedures for that type of certificate to ensure that an entity requesting a certificate is in fact who it claims to be.
...for example, a server might require a user to type a name and password before granting access to the server.
... the server maintains a list of names and passwords; if a particular name is on the list, and if the user types the correct password, the server grants access.
...And 5 more matches
Browser Feature Detection - Archive of obsolete content
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.
.../ 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.createtextnode() true true true document.createcomment() true true true document.
...cument.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.createtextnode() true true true document.createcomment() true true true document.
...And 5 more matches
Array.observe() - Archive of obsolete content
it's equivalent to object.observe() invoked with the accept type list ["add", "update", "delete", "splice"].
... type: a string indicating the type of change taking place.
... oldvalue: only for "update" and "delete" types.
...And 5 more matches
Properly Using CSS and JavaScript in XHTML Documents - Archive of obsolete content
this misunderstanding is compounded by the fact that, prior to version 9, microsoft® internet explorer only supports xhtml if it is served with mime media type text/html rather than the recommended application/xhtml+xml.
... when an xhtml page is served with mime type text/html it is treated by all browsers as if it were nothing more than html.
... however when an xhtml page is served with mime type text/xml or application/xhtml+xml, then it should be treated as an xml document which must conform to the strict rules for authoring and displaying xml.
...And 5 more matches
XForms Output Element - Archive of obsolete content
attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control accesskey - used to specify the keyboard shortcut for focusing this control single-node binding special value - xpath expression whose evaluation result is used as the output's value.
... type restrictions the output element can be bound to a node containing simple content of any data type.
... representations the xforms output element can be represented by the following widgets for the specified data types (or types derived from these data types): text - default representation for instance data of most types, especially static text (xhtml/xul).
...And 5 more matches
Getting started with CSS - Learn web development
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>getting started with css</title> </head> <body> <h1>i am a level one heading</h1> <p>this is a paragraph of text.
...if that doesn't happen, carefully check that you've typed everything correctly.
...it has list bullets, and if i decide i don't want those bullets i can remove them like so: li { list-style-type: none; } try adding this to your css now.
...And 5 more matches
Storing the information you need — Variables - Learn web development
tools you need throughout this article, you'll be asked to type in lines of code to test your understanding of the content.
... if you are using a desktop browser, the best place to type your sample code is your browser's javascript console (see what are browser developer tools for more information on how to access this tool).
...to do this, we type the keyword var or let followed by the name you want to call your variable: let myname; let myage; here we're creating two variables called myname and myage.
...And 5 more matches
Ember interactivity: Events, classes and state - Learn web development
creating todos for our card-header / todo input, we'll want to be able to submit our typed in todo task when we press the enter key and have it appear in the todos list.
... we want to be able to capture the text typed into the input.
... we do this so that our javascript code knows what we typed in, and we can save our todo and pass that text along to the todo list component to display.
...And 5 more matches
Framework main features - Learn web development
angular apps often make heavy use of typescript.
... typescript is not concerned with the writing of user interfaces, but it is a domain-specific language, and has significant differences to vanilla javascript.
... given this handlebars template: <header> <h1>hello, {{subject}}!</h1> </header> and this data: { subject: "world" } handlebars will build html like this: <header> <h1>hello, world!</h1> </header> typescript typescript is a superset of javascript, meaning it extends javascript — all javascript code is valid typescript, but not the other way around.
...And 5 more matches
Componentizing our React app - Learn web development
go back to src/app.js, copy the first <li> from inside the unordered list, and paste it into todo.js so that it reads like this: export default function todo() { return ( <li classname="todo stack-small"> <div classname="c-cb"> <input id="todo-0" type="checkbox" defaultchecked={true} /> <label classname="todo-label" htmlfor="todo-0"> eat </label> </div> <div classname="btn-group"> <button type="button" classname="btn"> edit <span classname="visually-hidden">eat</span> </button> <button type="button" classname="btn btn__danger"> delete <span classname="visually-hi...
... putting all that together, your todo() function should read like this: export default function todo(props) { return ( <li classname="todo stack-small"> <div classname="c-cb"> <input id="todo-0" type="checkbox" defaultchecked={true} /> <label classname="todo-label" htmlfor="todo-0"> {props.name} </label> </div> <div classname="btn-group"> <button type="button" classname="btn"> edit <span classname="visually-hidden">{props.name}</span> </button> <button type="button" classname="btn btn__danger"> delete <span clas...
...once you’re done, the todo component's <input /> element will read like this: <input id="todo-0" type="checkbox" defaultchecked={props.completed} /> and your browser should update to show only eat being checked: if you change each <todo /> component’s completed prop, your browser will check or uncheck the equivalent rendered checkboxes accordingly.
...And 5 more matches
Overview of Mozilla embedding APIs
nscomptr<interface-type> these are templatized smart pointers which transparently deal with xpcom reference counting issues.
... do_queryinterface this is a helper class which works in conjunction with nscomptr to perform a simplified call to nsisupports::queryinterface(...) with a typesafe assignment.
... nscomtypeinfo<interface-type>::getiid() this template helper class allows easy access to an interface's nsiid.
...And 5 more matches
Downloads.jsm
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 aproperties); 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.
... properties attribute type description error read only constructor constructor for a downloaderror object.
... getlist() retrieves the specified type of downloadlist object.
...And 5 more matches
Localizing with Koala
ting (put your locale's code) version: 3.6 location: choose the folder where you want to keep the localized files or leave empty for now check "mercurial" if you wish to use mercurial to keep the revision history of your files (very recommended) existing localizations: url: if you're editing an existing localization or you already have a repository set up (either on hg.mozilla.org or bitbucket), type the url of the remote repository, e.g.
...new localizations: url: if you already have a repository set up by l10n-drivers (on bitbucket), type the url of the remote repository, e.g.
...just type a single dot (".") in the url field to enable mercurial support in koala.
...And 5 more matches
Basics
f ( 4 ) ( η ) , a ≤ η ≤ b | x | = { - x if x < 0 x otherwise you can also typeset 2d mathematical constructs such as matrices.
...</p> <div> <math display="block"> <mtable> <mtr> <mtd> <mtable align="axis" columnalign="left left left"> <mtr> <mtd> <maction id="a11" actiontype="toggle" selection="2"> <msup> <mrow> <mo>(</mo> <mrow> <mi>x</mi> <mo>+</mo> <mi>y</mi> </mrow> <mo>)</mo> </mrow> <mn>0</mn> </msup> <mn>1</mn> </maction> </mtd> <mtd> <maction id="a12" actiontype="toggle" selection="2"> <msup> <mrow> <mo>(</mo> <mrow> <mi>x</mi> <mo>+</mo> <mi>y</mi> </mrow> <mo>)</mo> </mrow> <mn>1</mn> </msup> <mrow> <mi>x</mi> <mo>+</mo> <mi>y</mi> </mrow> </maction> </mtd>...
... <mtd> <maction id="a13" actiontype="toggle" selection="2"> <msup> <mrow> <mo>(</mo> <mrow> <mi>x</mi> <mo>+</mo> <mi>y</mi> </mrow> <mo>)</mo> </mrow> <mn>2</mn> </msup> <mrow> <msup> <mi>x</mi> <mn>2</mn> </msup> <mo>+</mo> <mrow> <mn>2</mn> <mo>&invisibletimes;</mo> <mi>x</mi> <mo>&invisibletimes;</mo> <mi>y</mi> </mrow> <mo>+</mo> <msup> <mi>y</mi> <mn>2</mn> </msup> </mrow> </maction> </mtd> </mtr> <mtr> <mtd> <maction id="a21" actiontype="toggle" selection="2"> <msup> <mrow> <mo>(</mo> <mrow> <mi>x</mi> <mo>+</mo> <mi>y</mi> </mrow> <mo>)</mo> </mrow> <mn>1</mn> </msup> <mrow> <mi>x</mi> <mo>+</mo> <mi>y</mi> </mrow> </maction> </mtd> <mtd> <maction id="a22" actiontype="toggle" selection="2"> <msup> <mrow> <mo>(</mo> <mrow> <mi>x</mi> <mo>+</mo> <mi>y</mi> </mrow> <mo>)</mo> </mrow> <mn>...
...And 5 more matches
64-bit Compatibility
what widths are the random typedefs everywhere?
... the following types or typedefs are always 64-bit on 64-bit platforms, and 32-bit on 32-bit platforms: pointers uintptr_t, intptr_t, ptrdiff_t, (probably) size_t jsval jsuword, jsword length of a string, though the actual length cannot exceed 30 bits jsuintptr, jsintptr, jsptrdiff, jsuptrdiff, jssize, jsuword, jsword (let's not use these, kthx) the following types are 32-bit on 32-bit platforms.
...the best way to fix this is to make types explicit, such as: const uintptr_t pointer_tagbits = 3 or by using a cast inside the macro.
...And 5 more matches
Exact Stack Rooting
class fooclass = { "fooprototype", /* name */ jsclass_has_private | jsclass_has_reserved_slots(1), /* flags */ js_propertystub, /* addproperty */ js_propertystub, /* delproperty */ ...
... js::rooted<t> typedef js::rooted<t> rootedt; -> rootedobject, rootedstring, rootedscript, etc.
... js::handle<t> typedef js::handle<t> js::handlet; -> handleobject, handlestring, handlescript, etc.
...And 5 more matches
JS::CompileOptions
constructor js::readonlycompileoptions(); // added in spidermonkey 31 js::owningcompileoptions(jscontext *cx); // added in spidermonkey 31 js::compileoptions(jscontext *cx, jsversion version = jsversion_unknown); name type description cx jscontext * pointer to a js context from which to derive runtime information.
...(unsigned c) owningcompileoptions &setcompileandgo(bool cng) owningcompileoptions &setforeval(bool eval) owningcompileoptions &setnoscriptrval(bool nsr) owningcompileoptions &setselfhostingmode(bool shm) owningcompileoptions &setcanlazilyparse(bool clp) owningcompileoptions &setsourceislazy(bool 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.
...bool u) compileoptions &setcolumn(unsigned c) compileoptions &setcompileandgo(bool cng) compileoptions &setforeval(bool eval) compileoptions &setnoscriptrval(bool nsr) compileoptions &setselfhostingmode(bool shm) compileoptions &setcanlazilyparse(bool clp) compileoptions &setsourceislazy(bool l) compileoptions &setintroductiontype(const char *t) compileoptions &setintroductioninfo(const char *introducerfn, const char *intro, unsigned line, jsscript *script, uint32_t offset) compileoptions &maybemakestrictmode(bool strict) properties properties of js::readonlycompileoptions name type description version jsversion version of the script.
...And 5 more matches
JS::CreateError
syntax // added in spidermonkey 45 bool js::createerror(jscontext *cx, jsexntype type, handleobject stack, handlestring filename, uint32_t linenumber, uint32_t columnnumber, jserrorreport *report, handlestring message, mutablehandlevalue rval); // obsolete since jsapi 39 bool js::createerror(jscontext *cx, jsexntype type, handlestring stack, handlestring filename, uint32_t linenumber, uint32_t columnnumber, jserrorreport *report, handlestring message, mutablehandlevalue rval); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... type jsexntype the exception's type.
... stack js::handlestring or js::handleobject the value of error.prototype.stack.
...And 5 more matches
JS_PushArguments
syntax jsval * js_pusharguments(jscontext *cx, void **markp, const char *format, ...); jsval * js_pushargumentsva(jscontext *cx, void **markp, const char *format, va_list ap); name type description cx jscontext * the context in which to perform any necessary conversions.
... format const char * null-terminated string holding a list of format types to convert the following arguments to.
...the type va_list is a standard feature of the c programming language.
...And 5 more matches
Animated PNG graphics
MozillaTechAPNG
structure an apng stream is a normal png stream as defined in the png specification, with three additional chunk types describing the animation and providing additional frame data.
...both chunk types share the sequence.
... the 'actl' chunk contains: byte offset field name field type description 0 num_frames unsigned int the number of frames in the apng.
...And 5 more matches
Accessing the Windows Registry Using XPCOM
you have to specify what type of data you expect to read, which we will expand on later.
...however, windows registry values can have several data types, so you need to ensure that you read the correct type.
... you can check the type of a value using the method getvaluetype().
...And 5 more matches
nsIDOMEvent
dom/interfaces/events/nsidomevent.idlscriptable this interface is the primary data type for all events in the document object model.
... nseventptr getinternalnsevent(); violates the xpcom interface guidelines boolean getpreventdefault(); deprecated since gecko 16.0 void initevent(in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg); boolean isdispatchstopped(); violates the xpcom interface guidelines void preventbubble(); obsolete since gecko 24 void preventcapture(); obsolete since gecko 24 void preventdefault(); void serialize(in ipcmessageptr amsg, in boolean aserializeinterfacetype); violates the xpcom interface guidelin...
... void stopimmediatepropagation(); void stoppropagation(); attributes attribute type description bubbles boolean used to indicate whether or not an event is a bubbling event.
...And 5 more matches
nsIDOMMozNetworkStatsManager
ional] in jsval options /* networkstatsalarmoptions */); nsidomdomrequest getallalarms([optional] in nsisupports network); nsidomdomrequest removealarms([optional] in long alarmid); nsidomdomrequest clearstats(in nsisupports network); nsidomdomrequest clearallstats(); nsidomdomrequest getavailablenetworks(); nsidomdomrequest getavailableservicetypes(); attributes attribute type description samplerate long minimum time in milliseconds between samples stored in the database.
... constants constant type description wifi long constant for wifi, set to 0 mobile long constant for mobile, set to 1 methods getsamples() asynchronously queries network interface statistics.
... the query may be filtered by connection type and date.
...And 5 more matches
nsIEventListenerService
venttarget aeventtarget, [optional] out unsigned long acount, [retval, array, size_is(acount)] out nsidomeventtarget aoutarray); void getlistenerinfofor(in nsidomeventtarget aeventtarget, [optional] out unsigned long acount, [retval, array, size_is(acount)] out nsieventlistenerinfo aoutarray); boolean haslistenersfor(in nsidomeventtarget aeventtarget, in domstring atype); void addsystemeventlistener(in nsidomeventtarget target, in domstring type, in nsidomeventlistener listener, in boolean usecapture); void removesystemeventlistener(in nsidomeventtarget target, in domstring type, in nsidomeventlistener listener, in boolean usecapture); attributes attribute type description sys...
... haslistenersfor() returns true if a event target has any listener for the given type.
... boolean haslistenersfor( in nsidomeventtarget aeventtarget, in domstring atype ); parameters aeventtarget the nsidomeventtarget for which to check if this has any listener for atype.
...And 5 more matches
nsITelemetry
void seteventrecordingenabled(in acstring acategory, in boolean aenabled); jsval snapshotevents(in uint32_t adataset, [optional] in boolean aclear); void registerevents(in acstring acategory, in jsval aeventdata); void registerscalars(in acstring acategoryname, in jsval ascalardata); void clearevents(); test only attributes attribute type description canrecordbase boolean a flag indicating if telemetry can record base data (fhr data).
...{ name1: {data1}, name2:{data2}...} where data consists of the following properties: min - minimal bucket size max - maximum bucket size histogram_type - histogram_exponential or histogram_linear counts - an array representing the values of buckets in the histogram.
... constants histogram types constant value description histogram_exponential 0 buckets increase exponentially.
...And 5 more matches
nsIXPConnect
ajscontext, out nsixpcsecuritymanager amanager, out pruint16 flags); nsixpconnectwrappednative getwrappednativeofjsobject(in jscontextptr ajscontext, in jsobjectptr ajsobj); nsixpconnectwrappednative getwrappednativeofnativeobject(in jscontextptr ajscontext, in jsobjectptr ascope, in nsisupports acomobj, in nsiidref aiid); nsixpconnectjsobjectholder getwrappednativeprototype(in jscontextptr ajscontext, in jsobjectptr ascope, in nsiclassinfo aclassinfo); jsval getwrapperforobject(in jscontextptr ajscontext, in jsobjectptr aobject, in jsobjectptr ascope, in nsiprincipal aprincipal, in unsigned long afilenameflags); native code only!
... void reparentscopeawarewrappers(in jscontextptr ajscontext, in jsobjectptr aoldscope, in jsobjectptr anewscope); obsolete since gecko 1.9.1 nsixpconnectjsobjectholder reparentwrappednativeiffound(in jscontextptr ajscontext, in jsobjectptr ascope, in jsobjectptr anewparent, in nsisupports acomobj); void restorewrappednativeprototype(in jscontextptr ajscontext, in jsobjectptr ascope, in nsiclassinfo aclassinfo, in nsixpconnectjsobjectholder aprototype); void setdebugmodewhenpossible(in prbool mode); native code only!
...tjsobjectholder wrapnative(in jscontextptr ajscontext, in jsobjectptr ascope, in nsisupports acomobj, in nsiidref aiid); void wrapnativetojsval(in jscontextptr ajscontext, in jsobjectptr ascope, in nsisupports acomobj, in nswrappercacheptr acache, in nsiidptr aiid, in boolean aallowwrapper, out jsval aval, out nsixpconnectjsobjectholder aholder); attributes attribute type description collectgarbageonmainthreadonly prbool obsolete since gecko 1.9 currentjsstack nsistackframe read only.
...And 5 more matches
nsIAbCard/Thunderbird3
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 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 getpr...
...ropertyasastring(in string name, in astring value); [noscript] void setpropertyasautf8string(in string name, in autf8string value); [noscript] void setpropertyasuint32(in string name, in pruint32 value); [noscript] void setpropertyasbool(in string name, in boolean value); void deleteproperty(in autf8string name); autf8string translateto(in autf8string atype); void copy(in nsiabcard srccard) boolean equals(in nsiabcard card) astring generatephoneticname(in boolean alastnamefirst) attributes attribute type description properties nsisimpleenumerator readonly: a list of all the properties that this card has as an enumerator, whose members are all nsiproperty objects.
...And 5 more matches
XPCOM reference
this macro is meant for critical errors; like assertions, ns_errors should not be reachable.ns_if_addrefmacrons_if_releasemacrons_releasemacrons_warningmacronsgetmoduleprocthis function prototype provides the xpcom entry-point into a module.nsiabcard/thunderbird3the nsiabcard interface is used to represent and manipulate cards in the address book.
... nsmsgnavigationtypethe nsmsgnavigationtype interface contains constants used for message navigation in thunderbird.
...it is (as far as i can tell) not currently used anywhere in thunderbird.nsmsgviewcommandtypethe nsmsgviewcommandtype interface contains constants used for commands in thunderbird.
...And 5 more matches
Activity Manager examples
if activity developers would like to extend the default ui representation of the activity types, they can provide their own xbl elements for their own activity types.
...etservice(nsiam); let process = components.classes["@mozilla.org/activity-process;1"].createinstance(nsiap); // assuming folder is an instance of nsimsgfolder interface // localization is omitted, initiator is not provided process.init("processing folder: " + folder.prettiestname, null); // note that we don't define a custom icon, default process icon // will be used process.contexttype = "account"; // group this activity by account process.contextobj = folder.server; // account in question gactivitymanager.addactivity(process); // step 2: showing some progress let percent = 50; process.setprogress(percent, "junk processing 25 of 50 messages", 25, 50); // step 3: removing the process and adding an event using process' attributes process.state = components.interfaces.nsi...
..._completed; gactivitymanager.removeactivity(process.id); let event = components.classes["@mozilla.org/activity-event;1"].createinstance(nsiae); // localization is omitted, initiator is omitted event.init(folder.prettiestname + " is processed", null, "no junk found", process.starttime, // start time date.now()); // completion time event.contexttype = process.contexttype; // optional event.contextobj = process.contextobj; // optional gactivitymanager.addactivity(event); showing a user-defined activity with cancel capability (javascript) this sample improves the previous one by providing an nsiactivitycancelhandler to allow the user to cancel the process.
...And 5 more matches
Network request list - Firefox Developer Tools
type: content-type of the response.
... 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).
...And 5 more matches
Storage Inspector - Firefox Developer Tools
the storage inspector enables you to inspect various types of storage that a web page can use.
... currently it can be used to inspect the following storage types: cache storage — any dom caches created using the cache api.
... storage inspector user interface the storage inspector ui is split into three main components: storage tree table widget sidebar storage tree the storage tree lists all the storage types that the storage inspector can inspect: under each type, objects are organized by origin.
...And 5 more matches
Using the CSS Painting API - Web APIs
employ the css paint() function like we would any other <image> type, using the same string identifier we used in the paintworklet's registerpaint() function.
...m 9</li> <li>item 10</li> <li>item 11</li> <li>item 12</li> <li>item 13</li> <li>item 14</li> <li>item 15</li> <li>item 16</li> <li>item 17</li> <li>item</li> </ul> css.paintworklet.addmodule('https://mdn.github.io/houdini-examples/csspaint/intro/worklets/boxbg.js'); li { background-image: paint(boxbg); --boxcolor: hsla(55, 90%, 60%, 1.0); } li:nth-of-type(3n) { --boxcolor: hsla(155, 90%, 60%, 1.0); --widthsubtractor: 20; } li:nth-of-type(3n+1) { --boxcolor: hsla(255, 90%, 60%, 1.0); --widthsubtractor: 40; } in our worklet, we can reference those custom properties.
... li { background-image: paint(hollowhighlights, stroke, 10px); } we can also specify that we want a particular type of argument.
...And 5 more matches
DataTransfer.setData() - Web APIs
the datatransfer.setdata() method sets the drag operation's drag data to the specified data and type.
... if data for the given type does not exist, it is added at the end of the drag data store, such that the last item in the types list will be the new type.
... if data for the given type already exists, the existing data is replaced in the same position.
...And 5 more matches
DataTransferItemList.add() - Web APIs
the item may be a file or a string of a given type.
... syntax datatransferitem = datatransferitemlist.add(data, type); datatransferitem = datatransferitemlist.add(file); parameters data a string representing the drag item's data.
... type a string of the drag item's type.
...And 5 more matches
MSManipulationEvent.initMSManipulationEvent() - Web APIs
syntax msmanipulationevent.initmsmanipulationevent(typearg, canbubblearg, cancelablearg, viewarg, detailarg, laststate, currentstate); parameters typearg [in] type: domstring the type of the event being created.
... canbubblearg [in] type: boolean indicates whether the event can bubble.
... cancelablearg [in] type: boolean indicates whether the event’s default action can be prevented.
...And 5 more matches
Media Capabilities API - Web APIs
if ('mediacapabilities' in navigator) { const audiofileconfiguration = { type : 'file', audio : { contenttype: "audio/mp3", channels: 2, bitrate: 132700, samplerate: 5200 } }; navigator.mediacapabilities.decodinginfo(audiofileconfiguration).then(result => { console.log('this configuration is ' + (result.supported ?
...'' : 'not ') + 'power efficient.') }) .catch(() => { console.log("decodinginfo error: " + contenttype) }); } media capabilities api concepts and usage there are a myriad of video and audio codecs.
... different browsers support different media types and new media types are always being developed.
...And 5 more matches
Node - Web APIs
WebAPINode
the dom node interface is an abstract base class upon which many other dom api objects are based, thus letting those object types to be used similarly and often interchangeably.
...these include attr, characterdata (which text, comment, and cdatasection are all based on), processinginstruction, documenttype, notation, entity, and entityreference.
...for example, attempting to add children to a node type that cannot have children will throw an exception.
...And 5 more matches
RTCRtpCapabilities - Web APIs
the rtcrtpcapabilities dictionary is a data type used to describe the capabilities of an rtcrtpsender or rtcrtpreceiver in response to a call to the rtcrtpsender.getcapabilities() or rtcrtpreceiver.getcapabilities() static functions, both of which return an array of rtcrtpcapabilities objects.
...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 used by rtp differ from those used elsewhere.
...And 5 more matches
Using the Resource Timing API - Web APIs
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.
... function calculate_load_times() { // check performance support if (performance === undefined) { console.log("= calculate load times: performance not supported"); return; } // get a list of "resource" performance entries var resources = performance.getentriesbytype("resource"); if (resources === undefined || resources.length <= 0) { console.log("= calculate load times: there are no `resource` performance records"); return; } console.log("= calculate load times"); for (var i=0; i < resources.length; i++) { console.log("== resource[" + i + "] - " + resources[i].name); // redirect time var t = resources[i].redirectend - resources[i...
... if (performance === undefined) { console.log("= display size data: performance not supported"); return; } var list = performance.getentriesbytype("resource"); if (list === undefined) { console.log("= display size data: performance.getentriesbytype() is not supported"); return; } // for each "resource", display its *size property values console.log("= display size data"); for (var i=0; i < list.length; i++) { console.log("== resource[" + i + "] - " + list[i].name); if ("decodedbodysize" in list[i]) console.
...And 5 more matches
SVGFEColorMatrixElement - Web APIs
t="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="366" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfecolormatrixelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_fecolormatrix_type_unknown 0 the type is not one of predefined types.
... 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_fecolormatrix_type_matrix 1 corresponds to the matrix value.
...And 5 more matches
TextEncoder - Web APIs
textencoder.prototype.encodingread only always returns "utf-8".
... textencoder.prototype.encode() takes a usvstring as input, and returns a uint8array containing utf-8 encoded text.
... textencoder.prototype.encodeinto() takes a usvstring to encode and a destination uint8array to put resulting utf-8 encoded text into, and returns a dictionary object indicating the progress of the encoding.
...And 5 more matches
TouchEvent() - Web APIs
syntax event = new touchevent(typearg, toucheventinit); values typearg is a domstring representing the name of the event.
... toucheventinit optional is a toucheventinit dictionary, having the following fields: "touches", optional and defaulting to [], of type touch[], that is a list of objects for every point of contact currently touching the surface.
... "targettouches", optional and defaulting to [], of type touch[], that is a list of objects for every point of contact that is touching the surface and started on the element that is the target of the current event.
...And 5 more matches
WebGL model view projection - Web APIs
webglbox.prototype.draw = function(settings) { // create some attribute data; these are the triangles that will end being // drawn to the screen.
...it still represents a point in 3d space and it can easily be demonstrated how to construct this type of coordinate through a pair of simple functions.
...the new function looks like this: cubedemo.prototype.computemodelmatrix = function(now) { //scale down by 50% var scale = mdn.scalematrix(0.5, 0.5, 0.5); // rotate a slight tilt var rotatex = mdn.rotatexmatrix(now * 0.0003); // rotate according to time var rotatey = mdn.rotateymatrix(now * 0.0005); // move slightly down var position = mdn.translatematrix(0, -0.1, 0); // multiply together, make sure and read them in opposite or...
...And 5 more matches
Fundamentals of WebXR - Web APIs
this is directly related to how many types of movement the webxr hardware configuration is capable of recognizing and reproducing into the virtual scene.
...which type of session you want to create is specified when creating the session.
... there are two basic types of ar device: devices which use cameras to capture the world in front of the user, render the webxr content atop that image, then display the image on a screen.
...And 5 more matches
Example and tutorial: Simple synth keyboard - Web APIs
then we establish a box that will be presented on the left side of the bar and place a label and an <input> element of type "range".
... <div class="settingsbar"> <div class="left"> <span>volume: </span> <input type="range" min="0.0" max="1.0" step="0.01" value="0.5" list="volumes" name="volume"> <datalist id="volumes"> <option value="0.0" label="mute"> <option value="1.0" label="100%"> </datalist> </div> we specify a default value of 0.5, and we provide a <datalist> element which is connected to the range using the name attribute to find an option list whose id matches; in this case, the data set is named "volume".
... volumecontrol is the <input> element (of type "range") used to control the master audio volume.
...And 5 more matches
Using IIR filters - Web APIs
the iirfilternode interface of the web audio api is an audionode processor that implements a general infinite impulse response (iir) filter; this type of filter can be used to implement tone control devices and graphic equalizers, and the filter response parameters can be specified, so that it can be tuned as needed.
...it's one of two primary types of filters used in audio and digital signal processing.
... the other type is fir — finite impulse response filter.
...And 5 more matches
XPathEvaluator.evaluate() - Web APIs
syntax xpathresult xpathevaluator.evaluate(expression, contextnode, resolver, type, result); parameters expression a domstring representing the xpath expression to be parsed and evaluated.
... type optional specifies the type of result to be returned by evaluating the expression.
... exceptions invalid_expression_err if the expression is not legal according to the rules of the xpathevaluator, an xpathexception of type invalid_expression_err is raised.
...And 5 more matches
XPathExpression.evaluate() - Web APIs
syntax xpathresult node.evaluate(contextnode, type, result); parameters contextnode a node representing the context to use for evaluating the expression.
... type optional specifies the type of result to be returned by evaluating the expression.
... exceptions invalid_expression_err if the expression is not legal according to the rules of the xpathevaluator, an xpathexception of type invalid_expression_err is raised.
...And 5 more matches
XRSession.requestReferenceSpace() - Web APIs
the requestreferencespace() method of the xrsession interface returns a promise that resolves with an instance of either xrreferencespace or xrboundedreferencespace as appropriate given the type of reference space requested.
... syntax refspacepromise = xrsession.requestreferencespace(referencespacetype); parameters type a domstring specifying the type of reference space for which an instance is to be returned.
... the string must be one of those found in the xrreferencespacetype enumerated type.
...And 5 more matches
attr() - CSS: Cascading Style Sheets
WebCSSattr
note: the attr() function can be used with any css property, but support for properties other than content is experimental, and support for the type-or-unit parameter is sparse.
... /* simple usage */ attr(data-count); attr(title); /* with type */ attr(src url); attr(data-count number); attr(data-width px); /* with fallback */ attr(data-count number, 0); attr(src url, ""); attr(data-width px, inherit); attr(data-something, "default"); syntax values attribute-name is the name of an attribute on the html element referenced in the css.
... <type-or-unit> is a keyword representing either the type of the attribute's value, or its unit, as in html some attributes have implicit units.
...And 5 more matches
<basic-shape> - CSS: Cascading Style Sheets
the <basic-shape> css data type represents a shape used in the clip-path, shape-outside, and offset-path properties.
... syntax the <basic-shape> data type is defined with one of the basic shape functions listed below.
...if list values are not one of those types but are identical, those values do interpolate.
...And 5 more matches
font-variant-caps - CSS: Cascading Style Sheets
in each case, if the font doesn't support the opentype value, then it synthesizes the glyphs.
... small-caps enables display of small capitals (opentype feature: smcp).
... all-small-caps enables display of small capitals for both upper and lowercase letters (opentype features: c2sc, smcp).
...And 5 more matches
Getting Started - Developer guides
note that if you want to post data, you may have to set the mime type of the request.
... for example, use the following before calling send() for form data sent as a query string: httprequest.setrequestheader('content-type', 'application/x-www-form-urlencoded'); step 2 – handling the server response when you sent the request, you provided the name of a javascript function to handle the response: httprequest.onreadystatechange = nameofthefunction; what should this function do?
... <button id="ajaxbutton" type="button">make a request</button> <script> (function() { var httprequest; document.getelementbyid("ajaxbutton").addeventlistener('click', makerequest); function makerequest() { httprequest = new xmlhttprequest(); if (!httprequest) { alert('giving up :( cannot create an xmlhttp instance'); return false; } httprequest.onreadystatechange = alertcontents; httpr...
...And 5 more matches
Adding captions and subtitles to HTML5 video - Developer guides
the various attributes of this element allow us to specify such things as the type of content that we're adding, the language it's in, and of course a reference to the text file that contains the actual subtitle information.
...we actually have our subtitles in three different languages — english, german, and spanish — so we will reference all three of the relevant vtt files by adding <track> elements inside our html5 <video> element: <video id="video" controls preload="metadata"> <source src="video/sintel-short.mp4" type="video/mp4"> <source src="video/sintel-short.webm" type="video/webm"> <track label="english" kind="subtitles" srclang="en" src="captions/vtt/sintel-en.vtt" default> <track label="deutsch" kind="subtitles" srclang="de" src="captions/vtt/sintel-de.vtt"> <track label="español" kind="subtitles" srclang="es" src="captions/vtt/sintel-es.vtt"> </video> as you can see, each <track> element ...
...has the following attributes set: kind is given a value of subtitles, indicating the type of content the files contain label is given a value indicating which language that subtitle set is for — for example english or deutsch — these labels will appear in the user interface to allow the user to easily select which subtitle language they want to see.
...And 5 more matches
HTML attribute: min - HTML: Hypertext Markup Language
WebHTMLAttributesmin
valid for the numeric input types, including the date, month, week, time, datetime-local, number and range types, and the <meter> element, the min attribute is a number that specifies the most negative value a form control to be considered valid.
... syntax if any is not explicity set, valid values for the number, date/time input types, and range input types are equal to the basis for stepping - the min value and increments of the step value, up to the max value, if specified.
... for example, if we have <input type="number" min="10" step="2"> any even integer, 10 or great, is valid.
...And 5 more matches
Global attributes - HTML: Hypertext Markup Language
dropzone an enumerated attribute indicating what types of content can be dropped on an element, using the drag and drop api.
... inputmode provides a hint to browsers as to the type of virtual keyboard configuration to use when editing this element or its contents.
... itemscope itemscope (usually) works along with itemtype to specify that the html contained in a block is about a particular item.
...And 5 more matches
Control flow and error handling - JavaScript
example in the following example, if fruittype evaluates to 'bananas', the program matches the value with case 'bananas' and executes the associated statement.
... switch (fruittype) { case 'oranges': console.log('oranges are $0.59 a pound.'); break; case 'apples': console.log('apples are $0.32 a pound.'); break; case 'bananas': console.log('bananas are $0.48 a pound.'); break; case 'cherries': console.log('cherries are $3.00 a pound.'); break; case 'mangoes': console.log('mangoes are $0.56 a pound.'); break; case 'papayas': console.log('mangoes and papayas are $2.79 a pound.'); break; default: console.log(`sorry, we are out of ${fruittype}.`); } console.log("is there anything else you'd like?"...
... throw statement try...catch statement exception types just about any object can be thrown in javascript.
...And 5 more matches
Regular expressions - JavaScript
character classes distinguish different types of characters.
... regexp.prototype.global i case-insensitive search.
... regexp.prototype.ignorecase m multi-line search.
...And 5 more matches
Classes - JavaScript
classes in js are built on prototypes but also have some syntax and semantics that are not shared with es5 classalike semantics.
... prototype methods see also method definitions.
... class point { constructor(x, y) { this.x = x; this.y = y; } static distance(a, b) { const dx = a.x - b.x; const dy = a.y - b.y; return math.hypot(dx, dy); } } const p1 = new point(5, 5); const p2 = new point(10, 10); p1.distance; //undefined p2.distance; //undefined console.log(point.distance(p1, p2)); // 7.0710678118654755 binding this with prototype and static methods when a static or prototype method is called without a value for this, such as by assigning a variable to the method and then calling it, the this value will be undefined inside the method.
...And 5 more matches
Object.assign() - JavaScript
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.
... in case of an error, for example if a property is non-writable, a typeerror is raised, and the target object is changed if any properties are added before the error is raised.
...And 5 more matches
Object.preventExtensions() - JavaScript
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).
...properties can still be added to the object prototype.
... this method makes the [[prototype]] of the target immutable; any [[prototype]] re-assignment will throw a typeerror.
...And 5 more matches
RangeError - JavaScript
this can be encountered when: passing a value that is not one of the allowed string values to string.prototype.normalize(), or when attempting to create an array of an illegal length with the array constructor, or when passing bad values to the numeric methods number.prototype.toexponential(), number.prototype.tofixed() or number.prototype.toprecision().
... instance properties rangeerror.prototype.message error message.
... although ecma-262 specifies that rangeerror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
...And 5 more matches
Object initializer - JavaScript
values of object properties can either contain primitive data types or other objects.
... shallow-cloning (excluding prototype) or merging objects is now possible using a shorter syntax than object.assign().
... prototype mutation a property definition of the form __proto__: value or "__proto__": value does not create a property with the name __proto__.
...And 5 more matches
delete operator - JavaScript
exceptions throws typeerror in strict mode if the property is an own non-configurable property.
... 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).
...in strict mode this will raise a typeerror.
...And 5 more matches
<marker> - SVG: Scalable Vector Graphics
WebSVGElementmarker
value type: <length> ; default value: 3; animatable: yes markerunits this attribute defines the coordinate system for the attributes markerwidth, markerheight and the contents of the <marker>.
... value type: userspaceonuse|strokewidth ; default value: strokewidth; animatable: yes markerwidth this attribute defines the width of the marker viewport.
... value type: <length> ; default value: 3; animatable: yes orient this attribute defines the orientation of the marker relative to the shape it is attached to.
...And 5 more matches
<symbol> - SVG: Scalable Vector Graphics
WebSVGElementsymbol
value type: <length>|<percentage> ; default value: auto; animatable: yes preserveaspectratio this attribute defines how the svg fragment must be deformed if it is embedded in a container with a different aspect ratio.
... value type: (none| xminymin| xmidymin| xmaxymin| xminymid| xmidymid| xmaxymid| xminymax| xmidymax| xmaxymax) (meet|slice)?
... value type: <length>|<percentage>|left|center|right ; default value: 0; animatable: yes refy this attribute determines the y coordinate of the reference point of the symbol.
...And 5 more matches
<textPath> - SVG: Scalable Vector Graphics
WebSVGElementtextPath
value type: <url> ; default value: none; animatable: yes lengthadjust where length adjustment should be applied to the text: the space between glyphs, or both the space and the glyphs themselves.
... value type: spacing|spacingandglyphs; default value: spacing; animatable: yes method which method to render individual glyphs along the path.
... value type: align|stretch ; default value: align; animatable: yes path the path on which the text should be rendered.
...And 5 more matches
WebAssembly Concepts - WebAssembly
webassembly is a new type of code that can be run in modern web browsers and provides new features and major gains in performance.
...it has many advantages — it is dynamically typed, requires no compile step, and has a huge ecosystem that provides powerful frameworks, libraries, and other tools.
...(note that webassembly has the high-level goal of supporting languages with garbage-collected memory models in the future.) with the advent of webassembly appearing in browsers, the virtual machine that we talked about earlier will now load and run two types of code — javascript and webassembly.
...And 5 more matches
context-menu - Archive of obsolete content
array an array of any of the other types.
... if you combine selectorcontext and the "context" event, be aware that the node argument passed to the "context" event will not always match the type specified in selectorcontext.
... parameters options : object required options: name type label string the item's label.
...And 4 more matches
passwords - Archive of obsolete content
so: given a form at http://www.example.com/login with the following html: <form action="http://login.example.com/foo/authenticate.cgi"> <div>please log in.</div> <label>username:</label> <input type="text" name="uname"> <label>password:</label> <input type="password" name="pword"> </form> the corresponding values for the credential (excluding username and password) should be: url: "http://www.example.com" formsubmiturl: "http://login.example.com" usernamefield: "uname" passwordfield: "pword" note that for both url and formsubmiturl, the portion of the url after the hostna...
...elf.uri: function show_my_addon_passwords() { require("sdk/passwords").search({ url: require("sdk/self").uri, oncomplete: function oncomplete(credentials) { credentials.foreach(function(credential) { console.log(credential.username); console.log(credential.password); }); } }); } parameters options : object required options: name type oncomplete function the callback function that is called once the function completes successfully.
... optional options: name type username string the username for the credential.
...And 4 more matches
tabs - Archive of obsolete content
} }); parameters options : object required options: name type url string string url to be opened in the new tab.
... optional options: name type isprivate boolean boolean which will determine whether the new tab should be private or not.
... example var tabs = require("sdk/tabs"); tabs.on('ready', function(tab) { var worker = tab.attach({ contentscript: 'document.body.style.border = "5px solid red";' }); }); parameters options : object optional options: name type contentscriptfile string,array the local file urls of content scripts to load.
...And 4 more matches
stylesheet/utils - Archive of obsolete content
globals functions loadsheet(window, uri, type) synchronously loads a style sheet from uri and adds it to the list of additional style sheets of the document.
... parameters window : nsidomwindow uri : string, nsiuri} type : string the type of the sheet.
... removesheet(window, uri, type) remove the document style sheet at sheeturi from the list of additional style sheets of the document.
...And 4 more matches
ui/button/action - Archive of obsolete content
parameters options : object required options: name type id string the button's id.
...wever, the icons in the toolbar will not quite fill the space available, so you can instead supply four icons: icon: { "18": "./addon18.png", // toolbar icon non hidpi "32": "./addon32.png", // menu panel icon non hidpi "36": "./addon36.png", // toolbar icon hidpi "64": "./addon64.png" // menu panel icon hidpi } optional options: name type disabled boolean determines whether the button is disabled.
...the button only emits one type of event, click: button.on("click", handleclick) function handleclick(state) { console.log("button '" + state.label + "' was clicked"); } parameters event : string the event to listen for.
...And 4 more matches
Connecting to Remote Content - Archive of obsolete content
sometimes the server doesn't specify an xml content-type header, which is necessary for the xml parsing to happen automatically.
... you can use overridemimetype to force the response to be parsed as xml.
... request.overridemimetype("text/xml"); // do this before sending the request!
...And 4 more matches
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.
... type is a type object representing the type that was declared.
...And 4 more matches
Menu - Archive of obsolete content
ArchiveMozillaJetpackUIMenu
note: this page documents the jetpack prototype, which has since been replaced by the add-on sdk.
... properties property type description beforehide function a function invoked just before the menu is hidden.
...creating menuitems to pass a new menuitem into the api, pass one of the following types: null a simple menu separator.
...And 4 more matches
Frequently Asked Questions - Archive of obsolete content
when servers send user agents an svg file they must tell the user agent that the file has the mime type "image/svg+xml", and if the svg file is stored gzipped they must tell the browser that too.
...failing to respect the mime types servers send is incorrect and has been a source of security holes in other browsers.
...for example, webpages that embed svg using the <object> or <embed> tags must have a 'type' attribute assigned with the correct svg mime type of "image/svg+xml".
...And 4 more matches
Menus - Archive of obsolete content
menu types a menu is created using the menupopup tag.
...this type of menu is usually used for commands that apply to the entire application.
... button a menu may be attached to a button by setting the type attribute of the button to 'menu'.
...And 4 more matches
Popup Guide - Archive of obsolete content
popups and menus there are various types of popups and menus that may be created.
... popup types xul provides a number of different types of elements which may be used to create popup menus or other types of popup widgets, which vary based on the manner in which they are attached to an element and the manner in which they are opened.
... a brief overview of each type is listed here; more details for each type can be found by following the corresponding links.
...And 4 more matches
Using Recursive Templates - Archive of obsolete content
both the rdf and xml datasource types support recursion.
...<groupbox type="menu" datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="*"/> <action> <vbox uri="?" class="indent"> <label value="?name"/> </vbox> </action> </template> </groupbox> in this simplified example, the xpath expression just gets the list of child elements of the reference node.
...in this next example, an assign element is used to assign the local name of the node is to the variable ?type.
...And 4 more matches
Tree Box Objects - Archive of obsolete content
example 2 : source view <script> function updatefields(event){ var row = {}, column = {}, part = {}; var tree = document.getelementbyid("thetree"); var boxobject = tree.boxobject; boxobject.queryinterface(components.interfaces.nsitreeboxobject); boxobject.getcellat(event.clientx, event.clienty, row, column, part); if (column.value && typeof column.value != "string") column.value = column.value.id; document.getelementbyid("row").value = row.value; document.getelementbyid("column").value = column.value; document.getelementbyid("part").value = part.value; } </script> <tree id="thetree" flex="1" onmousemove="updatefields(event);"> <treecols> <treecol id="utensil" label="utensil" primary="true" flex="1"/> <treecol...
...treeitem> <treeitem> <treerow> <treecell label="knife"/> <treecell label="2"/> </treerow> </treeitem> <treeitem> <treerow> <treecell label="spoon"/> <treecell label="8"/> </treerow> </treeitem> </treechildren> </tree> <label value="row:"/> <label id="row"/> <label value="column:"/> <label id="column"/> <label value="child type:"/> <label id="part"/> the getcellat() function takes five arguments, the coordinates to look up and three out parameters.
... the three out parameters will be filled in with the row, the column and a child type.
...And 4 more matches
Using Remote XUL - Archive of obsolete content
the remote xul manager extension lets you manage this whitelist, which is maintained using nsipermissionmanager, by creating entries of type "allowxulxbl", like this: components.classes["@mozilla.org/permissionmanager;1"] .getservice(components.interfaces.nsipermissionmanager) .add(uri, 'allowxulxbl', components.interfaces.nsipermissionmanager.allow_action); xul (pronounced like "zool"), which is short for xml-based user interface language, is an xml-based language for describing application interfaces.
... if you build a xul file along with this tutorial and put it onto a web server, you need to configure your web server to specify the content type of xul files as application/vnd.mozilla.xul+xml.
... for apache, you can do this by adding the following line to your mime.types file: application/vnd.mozilla.xul+xml .xul alternately, add this line to your httpd.conf file or, if the apache server is configured to allow it, to the .htaccess file in the directory from which the xul file is served: addtype application/vnd.mozilla.xul+xml .xul then restart your web server.
...And 4 more matches
resizer - Archive of obsolete content
attributes dir, element, type examples resizing a window <window xmlns="http://www.mozilla.org/keymaster/gat...re.is.only.xul" hidechrome="true" windowtype="main" orient="vertical" sizemode="normal" width="400" height="300" persist="screenx screeny width height"> <hbox flex="1"> <vbox width="2" style="background-color: grey;"> <resizer dir="topleft" height="2" style="cursor: nw-resize;"/> <resizer dir="left...
..." flex="1" style="cursor: w-resize;"/> <resizer dir="bottomleft" height="2" style="cursor: sw-resize;"/> </vbox> <vbox flex="1"> <resizer dir="top" height="2" style="background-color: grey; cursor: n-resize;"/> <browser flex="1" id="browser" type="content-primary"/> <resizer dir="bottom" height="2" style="background-color: grey; cursor: s-resize;"/> </vbox> <vbox width="2" style="background-color: grey; overflow: hidden;"> <resizer dir="topright" height="2" style="cursor: ne-resize;"/> <resizer dir="right" flex="1" style="cursor: e-resize;"/> <resizer dir="bottomright" height="2" style="cursor: se-resize;"/> </vbox> </hbox> </window> resizing an element <stack style="border: 1px solid black;"> <button id="button" label="resizable" left="18" top="18" right="...
... element="button" right="0" top="0" width="16" height="16"/> <resizer dir="bottomleft" style="background: black; -moz-appearance: none;" element="button" left="0" bottom="0" width="16" height="16"/> <resizer dir="bottomright" style="background: black; -moz-appearance: none;" element="button" right="0" bottom="0" width="16" height="16"/> </stack> attributes dir type: one of the values below the direction that the window is resized.
...And 4 more matches
stringbundle - Archive of obsolete content
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.
... from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties applocale obsolete since gecko 1.9.1 type: nsilocale returns the xpcom object which holds information about the user's locale.
... src type: url gets and sets the value of the src attribute.
...And 4 more matches
treecell - Archive of obsolete content
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">.
... label type: string the label that will appear on the element.
... mode type: one of the values below for columns that are progress meters, this determines the type of progress meter to use.
...And 4 more matches
where - Archive of obsolete content
ArchiveMozillaXULwhere
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.
... multiple type: boolean set to true to indicate that the value contains multiple values separated by commas.
... negate type: boolean set to true to indicate that the comparison should be reversed.
...And 4 more matches
NP_GetMIMEDescription - Archive of obsolete content
np_getmimedescription returns a supported mime type list for your plugin.
...on windows you have to define supported mimetypes in the dll resource file.
... each mime type description should be separated by a semicolon (;).
...And 4 more matches
GetObject - Archive of obsolete content
the class argument uses the syntax appname.objectype and has these parts: appname name of the application providing the object.
... objectype type or class of object to create.
...if pathname is a zero-length string (""), getobject returns a new object instance of the specified type.
...And 4 more matches
New in JavaScript 1.3 - Archive of obsolete content
--> new features in javascript 1.3 new globals nan infinity undefined new methods isfinite() function.prototype.call() function.prototype.apply() date.utc() date.prototype.getfullyear() date.prototype.setfullyear() date.prototype.getmilliseconds() date.prototype.setmilliseconds() date.prototype.getutcfullyear() date.prototype.getutcmonth() date.prototype.getutcdate() date.prototype.getutchours() date.prototype.getutcminutes() date.prototype.getutcseconds() date.prototype.getutcmilliseconds() ...
...date.prototype.toutcstring() date.prototype.setutcfullyear() date.prototype.setutcmonth() date.prototype.setutcdate() date.prototype.setutchours() date.prototype.setutcminutes() date.prototype.setutcseconds() date.prototype.setutcmilliseconds() other new features strict equality operators unicode support a javascript console was introduced.
... array.prototype.push(): in javascript 1.2, the push method returned the last element added to an array.
...And 4 more matches
Archived JavaScript Reference - Archive of obsolete content
it's equivalent to object.observe() invoked with the accept type list ["add", "update", "delete", "splice"].
...this operation leaves oldbuffer in a detached state.date.prototype.tolocaleformat()the non-standard tolocaleformat() method converts a date to a string using the specified formatting.
...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.
...And 4 more matches
Reference - Archive of obsolete content
with <script type="application/javascript;version=1.7" />.
...but when we create a prototype method for object its also available in function object.prototype.myfunction = function() {}; alert(object.myfunction); //available in object alert(function.myfunction); //available in function also the opposite is correct, when we create a prototype method for function it is available in object function.prototype.myfunction = function() {}; alert(object.myfunction); //available in object a...
...lert(function.myfunction); //available in function so no matter what we prototype function or object , it will be available in both...
...And 4 more matches
Implementation Status - Archive of obsolete content
datatypes section title status notes bugs 5.1 xml schema built-in datatypes partial whitespace facet not supported.
... 5.2.1 additional xforms datatypes to allow empty content unsupported 5.2.2 xforms:listitem supported 5.2.3 xforms:listitems supported 5.2.4 xforms:daytimeduration supported 5.2.5 xforms:yearmonthduration supported 5.2.6 xforms:email unsupported 5.2.7 xforms:card-number unsupported supported types: string, normalized string, token, language, boolean, gday, gmonth, gyear, gyearmonth, gmonthday, date, time, datetime, duration, integer, nonpositiveinteger, negativeinteger, posi...
...model item properties section title status notes bugs 6.1.1 type partial limited to types mentioned above 6.1.2 readonly supported 6.1.3 required supported 6.1.4 relevant partial relevancy applied via a bind to an element fails to apply to child attributes 342319; 6.1.5 calculate supported 6.1.6 constraint supported 6.1.7 p3ptype ...
...And 4 more matches
Implementing controls using the Gamepad API - Game development
the theme for the competition was "change", so they submitted a game where you have to feed the hungry fridge by tapping the healthy food (apples, carrots, lettuces) and avoid the "bad" food (beer, burgers, pizza.) a countdown changes the type of food the fridge wants to eat every few seconds, so you have to be careful and act quickly.
...you have to shoot down the food, but once again you also have to find the type of food the fridge wants to eat at each point, or else you'll lose energy.
... the game encapsulates two totally different types of "change" — good food vs.
...And 4 more matches
CSS selectors - Learn web development
in this article and its sub-articles we'll run through the different types in great detail, seeing how they work.
... h1, ..special { color: blue; } types of selectors there are a few different groupings of selectors, and knowing which type of selector you might need will help you to find the right tool for the job.
... type, class, and id selectors this group includes selectors that target an html element such as an <h1>.
...And 4 more matches
Fundamental text and font styling - Learn web development
the list of actual web safe fonts will change as operating systems evolve, but it's reasonable to consider the following fonts web safe, at least for now (many of them have been popularized thanks to the microsoft core fonts for the web initiative in the late 90s and early 2000s): name generic type notes arial sans-serif it's often considered best practice to also add helvetica as a preferred alternative to arial as, although their font faces are almost identical, helvetica is considered to have a nicer shape, even if arial is more broadly available.
... the five names are defined as follows: term definition example serif fonts that have serifs (the flourishes and other small details you see at the ends of the strokes in some typefaces) my big red elephant sans-serif fonts that don't have serifs.
...after doing that, you can easily size the different types of text in your document to what you want.
...And 4 more matches
Sending forms through JavaScript - Learn web development
something went wrong.' ); } ); // set up our request xhr.open( 'post', 'https://example.com/cors.php' ); // add the required http header for form data post requests xhr.setrequestheader( 'content-type', 'application/x-www-form-urlencoded' ); // finally, send our data.
... the html is typical: <form id="myform"> <label for="myname">send me your name:</label> <input id="myname" name="name" value="john"> <input type="submit" value="send me!"> </form> but javascript takes over the form: window.addeventlistener( "load", function () { function senddata() { const xhr = new xmlhttprequest(); // bind the formdata object and the form element const fd = new formdata( form ); // define what happens on successful data submission xhr.addeventlistener( "load", function(event) { alert( eve...
... dealing with binary data if you use a formdata object with a form that includes <input type="file"> widgets, the data will be processed automatically.
...And 4 more matches
What’s in the head? Metadata in HTML - Learn web development
let's revisit the simple html document we covered in the previous article: <!doctype html> <html> <head> <meta charset="utf-8"> <title>my test page</title> </head> <body> <p>this is my page</p> </body> </html> the html head is the contents of the <head> element — unlike the contents of the <body> element (which are displayed on the page when loaded in a browser), the head's content is not displayed on the page.
...there are a lot of different types of <meta> elements that can be included in your page's <head>, but we won't try to explain them all at this stage, as it would just get too confusing.
...this is the code we used: <p>japanese example: ご飯が熱い。</p> adding an author and description many <meta> elements include name and content attributes: name specifies the type of meta element it is; what type of information it contains.
...And 4 more matches
Build your own function - Learn web development
type the following in your browser's javascript console, on any page you like: alert('this is a message'); the alert function takes a single argument — the string that is displayed in the alert box.
... now open your browser developer tools on the example page, go to the javascript console and type the line again there, you'll see it appear again!
... first of all, update the first line of the function: function displaymessage() { to this: function displaymessage(msgtext, msgtype) { now when we call the function, we can provide two variable values inside the parentheses to specify the message to display in the message box, and the type of message it is.
...And 4 more matches
Working with JSON - Learn web development
a json object can be stored in its own file, which is basically just a text file with an extension of .json, and a mime type of application/json.
...you can include the same basic data types inside json as you can in a standard javascript object — strings, numbers, arrays, booleans, and other object literals.
... json can actually take the form of any data type that is valid for inclusion inside json, not just arrays or objects.
...And 4 more matches
Object-oriented JavaScript for beginners - Learn web development
to start this off, we could return to our person object type from our first objects article, which defines the generic data and functionality of a person.
... specialist classes in this case we don't want generic people — we want teachers and students, which are both more specific types of people.
... in oop, we can create new classes based on other classes — these new child classes can be made to inherit the data and code features of their parent class, so you can reuse functionality common to all the object types rather than having to duplicate it.
...And 4 more matches
Ember app structure and componentization - Learn web development
update the application.hbs file again so its content looks like this: <section class="todoapp"> <h1>todos</h1> <input class="new-todo" aria-label="what needs to be done?" placeholder="what needs to be done?" autofocus > <section class="main"> <input id="mark-all-complete" class="toggle-all" type="checkbox"> <label for="mark-all-complete">mark all as complete</label> <ul class="todo-list"> <li> <div class="view"> <input aria-label="toggle the completion of this todo" class="toggle" type="checkbox" > <label>buy movie tickets</label> <button type="button" class="destroy...
..." title="remove this todo" ></button> </div> <input autofocus class="edit" value="todo text"> </li> <li> <div class="view"> <input aria-label="toggle the completion of this todo" class="toggle" type="checkbox" > <label>go to movie</label> <button type="button" class="destroy" title="remove this todo" ></button> </div> <input autofocus class="edit" value="todo text"> </li> </ul> </section> <footer class="footer"> <span class="todo-count"> <strong>0</strong> todos left </span> <ul class="filters"> <li> <a href="#">all</a> <a href="#">active</a>...
... <a href="#">completed</a> </li> </ul> <button type="button" class="clear-completed"> clear completed </button> </footer> </section> the rendered output should now be as follows: this looks pretty complete, but remember that this is only a static prototype.
...And 4 more matches
Componentizing our Svelte app - Learn web development
put the following contents inside this file: <script> export let todo </script> <div class="stack-small"> <div class="c-cb"> <input type="checkbox" id="todo-{todo.id}" on:click={() => todo.completed = !todo.completed} checked={todo.completed} /> <label for="todo-{todo.id}" class="todo-label">{todo.name}</label> </div> <div class="btn-group"> <button type="button" class="btn"> edit <span class="visually-hidden">{todo.name}</span> </button> <button type="button" class="btn btn__danger" on:cl...
... first of all, add the following lines to the top of the todo component's <script> section: import { createeventdispatcher } from 'svelte' const dispatch = createeventdispatcher() now update the delete button in the markup section of the same file to look like so: <button type="button" class="btn btn__danger" on:click={() => dispatch('remove', todo)}> delete <span class="visually-hidden">{todo.name}</span> </button> with dispatch('remove', todo) we are emitting a remove event, and passing as additional data the todo being deleted.
... {:else} <div class="c-cb"> <input type="checkbox" id="todo-{todo.id}" on:click={ontoggle} checked={todo.completed} > <label for="todo-{todo.id}" class="todo-label">{todo.name}</label> </div> <div class="btn-group"> <button type="button" class="btn" on:click={onedit}> edit<span class="visually-hidden"> {todo.name}</span> </button> <button type="button" class="btn btn__danger" on:click={onremove}> ...
...And 4 more matches
pymake
anywhere you would normally type make, instead type python /path/to/srcdir/build/pymake/make.py.
... for example: instead of make -f client.mk to start a build, you would type python build/pymake/make.py -f client.mk.
... to run tests instead of typing make mochitest-plain in the object directory, you would type python ../build/pymake/make.py mochitest-plain.
...And 4 more matches
Multiple Firefox profiles
mac os x multifirefox by dave martorana profile management determining the profile while firefox is running to determine the profile of a currently-running firefox instance in windows, macos or linux, type about:profiles into the browser url search bar.
... from profile manager inside firefox if you already have firefox instance running, you can open another profile from the integrated profile manager on any platform: type about:profiles into the browser url search bar.
... type firefox --new-instance--profilemanager.
...And 4 more matches
Gecko's "Almost Standards" Mode
triggering "almost standards" the doctypes that will trigger "almost standards" mode are those which contain: the public identifier "-//w3c//dtd xhtml 1.0 transitional//en" the public identifier "-//w3c//dtd xhtml 1.0 frameset//en" the public identifier "-//w3c//dtd html 4.01 transitional//en", with a system identifier the public identifier "-//w3c//dtd html 4.01 frameset//en", with a system identifier the ibm system doctype "http...
...://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd" a complete doctype contains a public identifier and a system identifier.
... in discussions of doctypes, many people will refer to a doctype as being "with uri" or "without uri." the uri is the system identifier.
...And 4 more matches
Http.jsm
postdata can be of 2 different types: a string or an array of parameters.
...the elements of the array will be url-encoded and "application/x-www-form-urlencoded; charset=utf-8" will be enforced as the content type.
... http.jsm only forces the content type if the post data is an array, and it serializes it automatically.
...And 4 more matches
PromiseWorker.jsm
like chromeworker objects, promiseworker is mostly used for js-ctypes but it is not limited to that.
...in summary, from a worker file, data can only be sent back as a response to a request from the main thread, it is not possible for a worker to send data to the main thread otherwise, this is a key difference between promiseworker worker file and all other types of workers.
... supported built-in javascript error are following: evalerror internalerror rangeerror referenceerror syntaxerror typeerror urierror in addition to them, stopiteration is also supported (note that stopiteration is deprecated).
...And 4 more matches
Midas
bold if there is no selection, the insertion point will set bold for subsequently typed characters.
... heading h1, h2, h3, h4, h5, h6 selected block will be formatted as the given type of heading.
... italic if there is no selection, the insertion point will set italic for subsequently typed characters.
...And 4 more matches
NSS tools : pk12util
pk12util supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new sqlite databases (cert9.db, key4.db, and pkcs11.txt).
... several types of ciphers are supported.
... nss database types nss originally used berkeleydb databases to store security information.
...And 4 more matches
NSS tools : vfychain
prints root cert subject(double the argument for whole root cert info) -w password database password -w pwfile password file revocation options for pkix api (invoked with -pp options) is a collection of the following flags: [-g type [-h flags] [-m type [-s flags]] ...] ...
... where: -g test-type sets status checking test type.
... possible values are "leaf" or "chain" -g test type sets status checking test type.
...And 4 more matches
NSS Tools crlutil
syntax to run the certificate revocation list management tool, type the command crlutil option [arguments] where options and arguments are combinations of the options and arguments listed in the following section.
... -i import a crl to the cert database -e erase all crls of specified type from the cert database -l list existing crl located in cert database file.
... -t crl-type specify type of crl.
...And 4 more matches
NSS tools : pk12util
pk12util supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new sqlite databases (cert9.db, key4.db, and pkcs11.txt).
... several types of ciphers are supported.
... nss database types nss originally used berkeleydb databases to store security information.
...And 4 more matches
NSS tools : vfychain
prints root cert subject(double the argument for whole root cert info) -w password database password -w pwfile password file revocation options for pkix api (invoked with -pp options) is a collection of the following flags: [-g type [-h flags] [-m type [-s flags]] ...] ...
... where: -g test-type sets status checking test type.
... possible values are "leaf" or "chain" -g test type sets status checking test type.
...And 4 more matches
JSClass.flags
the flags field is of type uint32_t.
... an object obj that emulates undefined behaves like any other object, except in the following ways: typeof obj === "undefined" obj converts to false when obj is converted to a boolean when used in boolean contexts (if conditions, loop continuation/termination conditions [for/while/do { } while], the condition in a ternary ?: expression, and so on) (obj == undefined) is true, and (obj != undefined) is false (obj == null) is true, and (obj != null) is false == and != compariso...
...js_setglobalobject sets an object which is sometimes used as the global object, as a last resort.) enable standard ecmascript behavior for setting the prototype of certain objects, such as function objects.
...And 4 more matches
Gecko object attributes
container-relevant what types of mutations are possibly relevant?
... applied to: state_checkable state datatype warning: obsolete, do not use!
... a qname that refers to an xsd (schema) defined type.
...And 4 more matches
nsACString
}; typedefs char_type [char] storage unit for this class.
... self_type [nsacstring] an alias for the type of this class.
... size_type [pruint32] type used to represent the number of bytes stored in the string.
...And 4 more matches
nsAString
}; typedefs char_type [prunichar] storage unit for this class.
... self_type [nsastring] an alias for the type of this class.
... size_type [pruint32] type used to represent the number of double-byte units stored in the string.
...And 4 more matches
mozIAsyncFavicons
method overview void getfaviconurlforpage(in nsiuri apageuri, in nsifavicondatacallback acallback); void getfavicondataforpage(in nsiuri apageuri, in nsifavicondatacallback acallback); void setandfetchfaviconforpage(in nsiuri apageuri, in nsiuri afaviconuri, in boolean aforcereload, in unsigned long afaviconloadtype, [optional] in nsifavicondatacallback acallback); void replacefavicondata(in nsiuri afaviconuri, [const,array,size_is(adatalen)] in octet adata, in unsigned long adatalen, in autf8string amimetype, [optional] in prtime aexpiration); void replacefavicondatafromdataurl(in nsiuri afaviconuri, in astring adataurl, [optional] in prtime aexpiration); methods g...
...note that the callback's adatalen will be 0, adata will be null, and amimetype will be empty -- only auri will be non-zero/null/empty.
...however, if no favicon data is currently associated with the favicon uri, adatalen will be 0, adata will be an empty array, and amimetype will be an empty string.
...And 4 more matches
nsIDownloadManager
to get the service, use: var downloadmanager = components.classes["@mozilla.org/download-manager;1"] .getservice(components.interfaces.nsidownloadmanager); method overview nsidownload adddownload(in short adownloadtype, in nsiuri asource, in nsiuri atarget, in astring adisplayname, in nsimimeinfo amimeinfo, in prtime astarttime, in nsilocalfile atempfile, in nsicancelable acancelable, in boolean aisprivate); void addlistener(in nsidownloadprogresslistener alistener); void canceldownload(in unsigned long aid); void cleanup(); void endbatchupdate(); obsolete since gecko 1.9.1 ...
...wnloadsbytimeframe(in long long abegintime, in long long aendtime); void removelistener(in nsidownloadprogresslistener alistener); void resumedownload(in unsigned long aid); void retrydownload(in unsigned long aid); void savestate(); obsolete since gecko 1.8 void startbatchupdate(); obsolete since gecko 1.9.1 attributes attribute type description activedownloadcount long the number of files currently being downloaded.
...(see bug 416683) download_type_download 0 the download type used by adddownload.
...And 4 more matches
nsIEditorMailSupport
from: nsisupports last changed in gecko 1.7 method overview nsisupportsarray getembeddedobjects(); nsidomnode insertascitedquotation(in astring aquotedtext, in astring acitation, in boolean ainserthtml); nsidomnode insertasquotation(in astring aquotedtext); void inserttextwithquotations(in domstring astringtoinsert); void pasteascitedquotation(in astring acitation, in long aselectiontype); void pasteasquotation(in long aselectiontype); void rewrap(in boolean arespectnewlines); void stripcites(); methods getembeddedobjects() get a list of img and object tags in the current document.
...insertascitedquotation() insert a string as quoted text (whose representation is dependent on the editor type), replacing the selected text (if any), including, if possible, a "cite" attribute.
...insertasquotation() insert a string as quoted text (whose representation is dependent on the editor type), replacing the selected text (if any).
...And 4 more matches
nsIFeed
1.0 66 introduced gecko 1.8 inherits from: nsifeedcontainer last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) attributes attribute type description cloud nsiwritablepropertybag2 the cloud element on a feed is used to identify the api endpoint of an rsscloud ping server, which distributes notifications of changes to this feed.
... type unsigned long indicates the type of content presented by a feed.
...note: you should consider this a bit mask of values; at some point, the type may include more than one of these values ored together.
...And 4 more matches
nsIFeedTextConstruct
some extension elements also include "type" parameters, and this interface could be used to represent those as well.
... method overview nsidomdocumentfragment createdocumentfragment(in nsidomelement element); astring plaintext(); attributes attribute type description base nsiuri if the text construct contains html or xhtml, relative references in the content should be resolved against this base uri.
...this string may contain markup if the type is either "html" or "xhtml".
...And 4 more matches
nsIFocusManager
tforwindow(in nsidomwindow awindow, in prbool adeep, out nsidomwindow afocusedwindow); pruint32 getlastfocusmethod(in nsidomwindow window); void movecarettofocus(in nsidomwindow awindow); void elementisfocusable(in nsidomelement aelement, in unsigned long aflags); nsidomelement movefocus(in nsidomwindow awindow, in nsidomelement astartelement, in unsigned long atype, in unsigned long aflags); void setfocus(in nsidomelement aelement, in unsigned long aflags); void windowhidden(in nsidomwindow awindow); native code only!
... attributes attribute type description activewindow nsidomwindow the most active (frontmost) window, or null if no window that is part of the application is active.
...this flag will be implied when movefocus() is called except when one of the other mechanisms (mouse or key) is specified, or when the type is movefocus_root or movefocus_caret.
...And 4 more matches
nsIProtocolProxyService
zilla.org/network/protocol-proxy-service;1"] .getservice(components.interfaces.nsiprotocolproxyservice); method overview deprecated since gecko 18 nsiproxyinfo resolve(in nsiuri auri, in unsigned long aflags); nsicancelable asyncresolve(in nsiuri auri, in unsigned long aflags,in nsiprotocolproxycallback acallback); nsiproxyinfo newproxyinfo(in acstring atype, in autf8string ahost,in long aport, in unsigned long aflags, in unsigned long afailovertimeout, in nsiproxyinfo afailoverproxy); nsiproxyinfo getfailoverforproxy(in nsiproxyinfo aproxyinfo, in nsiuri auri, in nsresult areason); void registerfilter(in nsiprotocolproxyfilter afilter, in unsigned long aposition); void unregisterfilter(in nsiprotocolproxyfilter afilter); ...
... however, if the nsiproxyinfo type is "http", then it means that the given uri should be loaded using the http protocol handler, which also supports nsiproxiedprotocolhandler.
... note: if pac is configured, and the pac file has not yet been loaded, then this method will return a nsiproxyinfo instance with a type of "unknown" to indicate to the consumer that asyncresolve should be used to wait for the pac file to finish loading.
...And 4 more matches
nsITransferable
widget/nsitransferable.idlscriptable a container for typed data that can be transferred from one place or owner to another, possibly involving format conversion.
...to create an instance, use: var transferable = components.classes["@mozilla.org/widget/transferable;1"] .createinstance(components.interfaces.nsitransferable); it's important to note that a flavor, which specifies a type of data the transferable supports, is represented by a null-terminated string indicating the mime type of the format supported by the flavor.
... adatalen ); void gettransferdata( in string aflavor, out nsisupports adata, out unsigned long adatalen ); void init(in nsiloadcontext acontext); boolean islargedataset( ); void removedataflavor( in string adataflavor ); void settransferdata( in string aflavor, in nsisupports adata, in unsigned long adatalen ); attributes attribute type description converter nsiformatconverter an nsiformatconverter instance which implements the code needed to convert data into and out of the transferable given the supported flavors.
...And 4 more matches
nsIUpdateItem
method overview void init(in astring id, in astring version, in astring installlocationkey, in astring minappversion, in astring maxappversion, in astring name, in astring downloadurl, in astring xpihash, in astring iconurl, in astring updateurl, in astring updatekey, in long type, in astring targetappid); attributes attribute type description iconurl astring the url of the icon that can be shown for this item.
... type long the type of this item.
...can be null and if supplied must be in the format of "type:hash" (see the types in nsicryptohash and nsixpinstallmanager.initmanagerwithhashes().
...And 4 more matches
nsIXULRuntime
to get an instance, use: var xulruntime = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulruntime); method overview void invalidatecachesonrestart(); attributes attribute type description accessibilityenabled boolean if true, the accessibility service is running.
... processtype unsigned long the type of the caller's process.
... returns one of process type constants.
...And 4 more matches
Int64
because javascript doesn't currently include standard support for 64-bit integer values, js-ctypes offers the int64 and uint64 objects to let you work with c functions and data that need (or may need) values represented using a 64-bit data type.
... exceptions thrown typeerror the specified value cannot be converted into a 64-bit integer.
... exceptions thrown typeerror one or both of the specified values is not a 64-bit integer (either signed or unsigned).
...And 4 more matches
Streams - Plugins
each stream has an associated mime type identifying the format of the data in the stream.
...the browser can create a stream for several different types of data: for the file specified in the data attribute of the object element or the src attribute of the embed element for a data file for a full-page instance the npp_newstream method has the following syntax: nperror npp_newstream(npp instance, npmimetype type, npstream *stream, npbool seekable, uint16* stype); the instance parameter refers to the plug-in instance receiving the strea...
...m; the type parameter represents the stream's mime type.
...And 4 more matches
URLs - Plugins
plug-ins can request and receive the data associated with urls of any type that the browser can handle, including http, ftp, news, mailto, and gopher.
...the url parameter is the url of the request, which can be of any type, including http, ftp, news, or mailto.
... make sure that the target matches the url type sent to it.
...And 4 more matches
Debugger.Memory - Firefox Developer Tools
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.
... you can retrieve the allocation site for a given object with the debugger.object.prototype.allocationsite accessor property.
...any value assigned to a debugging handler must be either a function or undefined; otherwise a typeerror is thrown.
...And 4 more matches
ClipboardItem - Web APIs
the benefit of having the clipboarditem interface to represent data, is that it enables developers to cope with the varying scope of file types and data easily.
... constructor clipboarditem.clipboarditem() creates a new clipboarditem object, with the mime type as the key and blob as the value properties this interface provides the following properties.
... types read only returns an array of mime types available within the clipboarditem.
...And 4 more matches
DOMParser - Web APIs
WebAPIDOMParser
syntax let domparser = new domparser()​​ methods domparser.parsefromstring() syntax let doc = domparser.parsefromstring(string, mimetype) return either document or xmldocument depending on the mimetype argument.
... mimetype a domstring.
...the possible values are the following: mimetype doc.constructor text/html document text/xml xmldocument application/xml xmldocument application/xhtml+xml xmldocument image/svg+xml xmldocument examples parsing xml once you have created a parser object, you can parse xml from a string using the parsefromstring() method: let parser = new domparser() let doc = parser.parsefromstring(stringcontainingxmlsource, "application/xml") error handling note that if the parsing process fails, the domparser does not throw an exception, but instead returns an error document: <parsererror xmlns="http://www.mozilla.org/newlay...
...And 4 more matches
DataTransfer.clearData() - Web APIs
the datatransfer.cleardata() method removes the drag operation's drag data for the given type.
... if data for the given type does not exist, this method does nothing.
... if this method is called with no arguments or the format is an empty string, the data of all types will be removed.
...And 4 more matches
Introduction to the DOM - Web APIs
window.onload = function() { // create a couple of elements in an otherwise empty html page const heading = document.createelement("h1"); const heading_text = document.createtextnode("big head!"); heading.appendchild(heading_text); document.body.appendchild(heading); } </script> </head> <body> </body> </html> fundamental data types this reference tries to describe the various objects and types in simple terms.
... but there are a number of different data types being passed around the api that you should be aware of.
... the following table briefly describes these data types.
...And 4 more matches
Element - Web APIs
WebAPIElement
it implements the properties of parentnode, childnode, nondocumenttypechildnode, and animatable.
... nondocumenttypechildnode.nextelementsibling read only is an element, the element immediately following the given one in the tree, or null if there's no sibling node.
... nondocumenttypechildnode.previouselementsibling read only is a element, the element immediately preceding the given one in the tree, or null if there is no sibling element.
...And 4 more matches
Frame Timing API - Web APIs
an application can register a performanceobserver for "frame" performance entry types.
... performance frames the performanceframetiming interface extends the following performanceentry properties (for "frame" performance entry types) by qualifying and constrainting the properties as follows: performanceentry.entrytype set to "frame".
... frame observers the performance observer interfaces allow an application to register an observer for specific performance event types.
...And 4 more matches
HTMLInputElement.stepDown() - Web APIs
the htmlinputelement.stepdown([n]) method decrements the value of a numeric type of <input> element by the value of the step attribute or up to n multiples of the step attribute if a number is passed as the parameter.
... valid on all numeric, date, and time input types that support the step attribute, includingdate, month, week, time, datetime-local, number, and range.
... given <input id="mytime" type="time" max="17:00" step="900" value="17:00">, invoking mytime.step(3) will change the value to 16:15, decrementing the time by 3 * 900, or 45 minutes.
...And 4 more matches
MediaDevices.ondevicechange - Web APIs
{ cursor: pointer; width: 160px; border: 1px solid black; font-size: 16px; text-align: center; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; } h2 { margin-bottom: 4px; } .left { float:left; width: 48%; margin-right: 2% } .right { float:right; width: 48%; margin-left: 2% } .devicelist { border: 1px solid black; list-style-type: none; margin-top: 2px; padding: 6px; } javascript content other code below is other code which, while needed to make this example work, isn'tt related directly to ondevicechange, so we won't go into any detail.
... function updatedevicelist() { navigator.mediadevices.enumeratedevices() .then(function(devices) { audiolist.innerhtml = ""; videolist.innerhtml = ""; devices.foreach(function(device) { let elem = document.createelement("li"); let [kind, type, direction] = device.kind.match(/(\w+)(input|output)/i); elem.innerhtml = "<strong>" + device.label + "</strong> (" + direction + ")"; if (type === "audio") { audiolist.appendchild(elem); } else if (type === "video") { videolist.appendchild(elem); } }); }); } updatedevicelist() consists entirely of a call to the function enumeratedevices() on the me...
... the line let [kind, type, direction] = device.kind.match(/(\w+)(input|output)/i); deserves special notice.
...And 4 more matches
Network Information API - Web APIs
the network information api provides information about the system's connection in terms of general connection type (e.g., 'wifi', 'cellular', etc.).
... var connection = navigator.connection || navigator.mozconnection || navigator.webkitconnection; var type = connection.effectivetype; function updateconnectionstatus() { console.log("connection type changed from " + type + " to " + connection.effectivetype); type = connection.effectivetype; } connection.addeventlistener('change', updateconnectionstatus); preload large resources the connection object is useful for deciding whether to preload resources that take large amounts of bandwidth or m...
...this example would be called soon after page load to check for a connection type where preloading a video may not be desirable.
...And 4 more matches
performance.getEntriesByName() - Web APIs
the getentriesbyname() method returns a list of performanceentry objects for the given name and type.
... syntax entries = window.performance.getentriesbyname(name, type); arguments name the name of the entry to retrieve.
... type optional the type of entry to retrieve such as "mark".
...And 4 more matches
RTCSessionDescription - Web APIs
each rtcsessiondescription consists of a description type indicating which part of the offer/answer negotiation process it describes and of the sdp descriptor of the session.
... rtcsessiondescription.type read only an enum of type rtcsdptype describing the session description's type.
... constants rtcsdptype this enum defines strings that describe the current state of the session description, as used in the type property.
...And 4 more matches
Resource Timing API - Web APIs
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.
... the performanceresourcetiming interface extends the performanceentry for performance entries which have an entrytype of "resource".
...these timestamps have a domhighrestimestamp type and as its name implies, they represent a high-resolution point in time.
...And 4 more matches
Sensor APIs - Web APIs
these sensor types are referred to as low-level and high-level respectively.
... the latter type of sensor is also called a fusion sensor (alternatively, virtual or synthetic sensors).
... if (typeof gyroscope === "function") { // run in circles...
...And 4 more matches
WebGLRenderingContext.readPixels() - Web APIs
syntax // webgl1: void gl.readpixels(x, y, width, height, format, type, pixels); // webgl2: void gl.readpixels(x, y, width, height, format, type, glintptr offset); void gl.readpixels(x, y, width, height, format, type, arraybufferview pixels, gluint dstoffset); parameters x a glint specifying the first horizontal pixel that is read from the lower left corner of a rectangular block of pixels.
... webgl2 adds gl.red gl.rg gl.red_integer gl.rg_integer gl.rgb_integer gl.rgba_integer type a glenum specifying the data type of the pixel data.
...the array type must match the type of the type parameter.
...And 4 more matches
Using bounded reference spaces - Web APIs
basics the xrreferencespacetype of all bounded reference spaces is bounded-floor.
... this is the only type of bounded reference space currently available; in all others, if you need boundaries, you will have to manage them yourself.
...however, it's entirely possible that the device will simply decline to support bounded spaces at all, so you should be prepared to fall back to some other type of reference space.
...And 4 more matches
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
*/ ) { var aargs = array.prototype.slice.call(arguments, 2); return __nativest__(vcallback instanceof function ?
...*/ ) { var aargs = array.prototype.slice.call(arguments, 2); return __nativesi__(vcallback instanceof function ?
... settimeout.call(myarray, myarray.mymethod, 2.0*1000); // error: "ns_error_xpc_bad_op_on_wn_proto: illegal operation on wrappednative prototype object" settimeout.call(myarray, myarray.mymethod, 2.5*1000, 2); // same error possible solutions a common way to solve the problem is to use a wrapper function that sets this to the required value: settimeout(function(){myarray.mymethod()}, 2.0*1000); // prints "zero,one,two" after 2 seconds settimeout(function(){myarray.mymethod('1')}, 2.5*1000); // prints "one" after 2.5 seconds arrow fun...
...And 4 more matches
HTML in XMLHttpRequest - Web APIs
also, html support is only available if the responsetype property has been set to "document".
... usage retrieving an html resource as a dom using xmlhttprequest works just like retrieving an xml resource as a dom using xmlhttprequest, except you can't use the synchronous mode and you have to explicitly request a document by assigning the string "document" to the responsetype property of the xmlhttprequest object after calling open() but before calling send().
... var xhr = new xmlhttprequest(); xhr.onload = function() { console.log(this.responsexml.title); } xhr.open("get", "file.html"); xhr.responsetype = "document"; xhr.send(); feature detection method 1 this method relies on the "force async" nature of the feature.
...And 4 more matches
XRPermissionDescriptor.optionalFeatures - Web APIs
syntax xrpermissiondescriptor = { mode: xrsessionmode, requiredfeatures: reqfeaturelist, optionalfeatures: optfeaturelist }; xrpermissiondescriptor.optionalfeatures = optfeaturelist; optfeaturelist = xrpermissiondescriptor.optionalfeatures; value an array of strings taken from the xrreferencespacetype enumerated type, indicating set of features that your app would like to use, but can operate without if permission to use them isn't available.
... while further features may be defined in future editions of webxr, currently all permitted values come from the xrreferencespacetype enumerated type, indicating reference spaces the app rquires to be available.
...the "interface" column in the table below indicates which of the two types is returned for each reference space type constant..
...And 4 more matches
ARIA: textbox role - Accessibility
whenever possible, rather than using this role, use an <input> element with type="text", for single-line input, or a <textarea> element for multi-line input.
... the default is a single line input, in which return or enter submits the form; in this case, it is preferable to use an html <input> with type="text".
... <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.
...And 4 more matches
@media - CSS: Cascading Style Sheets
WebCSS@media
description media types media types describe the general category of a device.
... except when using the not or only logical operators, the media type is optional and the all type will be implied.
... deprecated media types: css2.1 and media queries 3 defined several additional media types (tty, tv, projection, handheld, braille, embossed, and aural), but they were deprecated in media queries 4 and shouldn't be used.
...And 4 more matches
Overview of events and handlers - Developer guides
this overview of events and event handling explains the code design pattern used to react to incidents occurring when a browser accesses a web page, and it summarizes the types of such incidents modern web browsers can handle.
...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.
...browsers use as the data structure for the properties of the event, an object derived from the eventprototype object.
...And 4 more matches
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
svg commands are formatted as xml, and can be embedded directly into a web page or can be placed in he page using the <img> element, just like any other type of image.
... for more detailed discussion of each of the color value types, see the reference for the css <color> unit.
...although historically it's been necessary to implement your own color picker, html now provides support for browsers to provide one for your use through the <input> element, by using "color" as the value of its type attribute.
...And 4 more matches
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
WebHTMLElementaudio
waiting playback has stopped because of a temporary lack of data usage notes browsers don't all support the same file types and audio codecs; you can provide multiple sources inside nested <source> elements, and the browser will then use the first one it understands: <audio controls> <source src="myaudio.mp3" type="audio/mpeg"> <source src="myaudio.ogg" type="audio/ogg"> <p>your browser doesn't support html5 audio.
... here is a <a href="myaudio.mp4">link to the audio</a> instead.</p> </audio> we offer a substantive and thorough guide to media file types and the audio codecs that can be used within them.
...instead, they're sent to the track list object within the <audio> element's htmlmediaelement that corresponds to the type of track that was added to the element: htmlmediaelement.audiotracks an audiotracklist containing all of the media element's audio tracks.
...And 4 more matches
<source>: The Media or Image Source element - HTML: Hypertext Markup Language
WebHTMLElementsource
type the mime media type of the resource, optionally with a codecs parameter.
... if the type attribute isn't specified, the media's type is retrieved from the server and checked to see if the user agent can handle it; if it can't be rendered, the next <source> is checked.
... if the type attribute is specified, it's compared against the types the user agent can present, and if it's not recognized, the server doesn't even get queried; instead, the next <source> element is checked at once.
...And 4 more matches
itemprop - HTML: Hypertext Markup Language
html <div itemscope itemtype="http://schema.org/movie"> <h1 itemprop="name">avatar</h1> <span>director: <span itemprop="director">james cameron</span> (born august 16, 1954)</span> <span itemprop="genre">science fiction</span> <a href="../movies/avatar-theatrical-trailer.html" itemprop="trailer">trailer</a> </div> structured data item itemprop name itemprop value itemp...
... a meter element <div itemscope itemtype="http://schema.org/product"> <span itemprop="name">panasonic white 60l refrigerator</span> <img src="panasonic-fridge-60l-white.jpg" alt=""> <div itemprop="aggregaterating" itemscope itemtype="http://schema.org/aggregaterating"> <meter itemprop="ratingvalue" min=0 value=3.5 max=5>rated 3.5/5</meter> (based on <span itemprop="reviewcount">11</span> custome...
...an item is called a typed item if it is a url.
...And 4 more matches
Accept - HTTP
WebHTTPHeadersAccept
the accept request http header advertises which content types, expressed as mime types, the client is able to understand.
... using content negotiation, the server then selects one of the proposals, uses it and informs the client of its choice with the content-type response header.
... header type request header forbidden header name no cors-safelisted request header yes, with the additional restriction that values can't contain a cors-unsafe request header byte: 0x00-0x1f (except 0x09 (ht)), "():<>?@[\]{}, and 0x7f (del).
...And 4 more matches
Content-Location - HTTP
header type entity header forbidden header name no syntax content-location: <url> directives <url> a relative (to the request url) or absolute url.
... on the request's accept header: request header response header accept: application/json, text/json content-location: /documents/foo.json accept: application/xml, text/xml content-location: /documents/foo.xml accept: text/plain, text/* content-location: /documents/foo.txt these urls are examples — the site could serve the different filetypes with any url patterns it wishes, such as a query string parameter: /documents/foo?format=json, /documents/foo?format=xml, and so on.
... pointing to a new document (http 201 created) say you're creating a new blog post through a site's api: put /new/post host: example.com content-type: text/markdown # my first blog post!
...And 4 more matches
Content-Security-Policy - HTTP
header type response header forbidden header name no syntax content-security-policy: <policy-directive>; <policy-directive> where <policy-directive> consists of: <directive> <value> with no internal punctuation.
... directives fetch directives fetch directives control the locations from which certain resource types may be loaded.
... plugin-types restricts the set of plugins that can be embedded into a document by limiting the types of resources which can be loaded.
...And 4 more matches
Numbers and dates - JavaScript
in addition to being able to represent floating-point numbers, the number type has three symbolic values: +infinity, -infinity, and nan (not-a-number).
... see also javascript data types and structures for context with other primitive types in javascript.
... you can use four types of number literals: decimal, binary, octal, and hexadecimal.
...And 4 more matches
EvalError - JavaScript
instance properties evalerror.prototype.message error message.
... although ecma-262 specifies that evalerror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
... evalerror.prototype.name error name.
...And 4 more matches
JSON.stringify() - JavaScript
exceptions throws a typeerror ("cyclic object value") exception when a circular reference is found.
... throws a typeerror ("bigint value can't be serialized in json") when trying to stringify a bigint value.
...ke no sense in json let a = ['foo', 'bar']; a['baz'] = 'quux'; // a: [ 0: 'foo', 1: 'bar', baz: 'quux' ] json.stringify(a); // '["foo","bar"]' json.stringify({ x: [10, undefined, function(){}, symbol('')] }); // '{"x":[10,null,null,null]}' // standard data structures json.stringify([new set([1]), new map([[1, 2]]), new weakset([{a: 1}]), new weakmap([[{a: 1}, 2]])]); // '[{},{},{},{}]' // typedarray json.stringify([new int8array([1]), new int16array([1]), new int32array([1])]); // '[{"0":1},{"0":1},{"0":1}]' json.stringify([new uint8array([1]), new uint8clampedarray([1]), new uint16array([1]), new uint32array([1])]); // '[{"0":1},{"0":1},{"0":1},{"0":1}]' json.stringify([new float32array([1]), new float64array([1])]); // '[{"0":1},{"0":1}]' // tojson() json.stringify({ x: 5, y: 6, toj...
...And 4 more matches
Object.seal() - JavaScript
attempting to delete or add properties to a sealed object, or to convert a data property to accessor or vice versa, will fail, either silently or by throwing a typeerror (most commonly, although not exclusively, when in strict mode code).
... the prototype chain remains untouched.
...object.defineproperty(obj, 'foo', { get: function() { return 'g'; } }); // throws a typeerror // now any changes, other than to property values, // will fail.
...And 4 more matches
Proxy - JavaScript
let validator = { set: function(obj, prop, value) { if (prop === 'age') { if (!number.isinteger(value)) { throw new typeerror('the age is not an integer'); } if (value > 200) { throw new rangeerror('the age seems invalid'); } } // the default behavior to store the value obj[prop] = value; // indicate success return true; } }; const person = new proxy({}, validator); person.age = 100; console.log(person.age); // 100 person.age = 'young'; // throws an exception p...
... function extend(sup, base) { var descriptor = object.getownpropertydescriptor( base.prototype, 'constructor' ); base.prototype = object.create(sup.prototype); var handler = { construct: function(target, args) { var obj = object.create(base.prototype); this.apply(target, obj, args); return obj; }, apply: function(target, that, args) { sup.apply(that, args); base.apply(that, args); } }; var proxy = new proxy(base, handler); descriptor.value = proxy; object.defineproperty(base.prototype, 'constructor', descriptor); return proxy; } v...
...ar person = function(name) { this.name = name; }; var boy = extend(person, function(name, age) { this.age = age; }); boy.prototype.gender = 'm'; var peter = new boy('peter', 13); console.log(peter.gender); // "m" console.log(peter.name); // "peter" console.log(peter.age); // 13 manipulating dom nodes sometimes you want to toggle the attribute or class name of two different elements.
...And 4 more matches
ReferenceError - JavaScript
instance properties referenceerror.prototype.message error message.
... although ecma-262 specifies that referenceerror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
... referenceerror.prototype.name error name.
...And 4 more matches
Reflect.construct() - JavaScript
it gives also the added option to specify a different prototype.
... newtarget optional the constructor whose prototype should be used.
... exceptions a typeerror, if target or newtarget are not constructors.
...And 4 more matches
SyntaxError - JavaScript
instance properties syntaxerror.prototype.message error message.
... although ecma-262 specifies that syntaxerror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
... syntaxerror.prototype.name error name.
...And 4 more matches
URIError - JavaScript
instance properties urierror.prototype.message error message.
... although ecma-262 specifies that urierror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
... urierror.prototype.name error name.
...And 4 more matches
WeakMap - JavaScript
description keys of weakmaps are of the type object only.
... primitive data types as keys are not allowed (e.g.
... instance methods weakmap.prototype.delete(key) removes any value associated to the key.
...And 4 more matches
WebAssembly.Global - JavaScript
global instances all global instances inherit from the global() constructor's prototype object — this can be modified to affect all global instances.
... instance properties global.prototype.constructor returns the function that created this object's instance.
... global.prototype[@@tostringtag] the initial value of the @@tostringtag property is the string value "webassembly.global".
...And 4 more matches
Iteration protocols - JavaScript
some built-in types are built-in iterables with a default iteration behavior, such as array or map, while other types (such as object) are not.
... in order to be iterable, an object must implement the @@iterator method, meaning that the object (or one of the objects up its prototype chain) must have a property with a @@iterator key which is available via constant symbol.iterator: property value [symbol.iterator] a zero-argument function that returns an object, conforming to the iterator protocol.
...if a non-object value gets returned (such as false or undefined), a typeerror ("iterator.next() returned a non-object value") will be thrown.
...And 4 more matches
Spread syntax (...) - JavaScript
examples spread in function calls replace apply() it is common to use function.prototype.apply() in cases where you want to use the elements of an array as arguments to a function.
... an array can be easily used with new thanks to spread syntax: const datefields = [1970, 0, 1]; // 1 jan 1970 const d = new date(...datefields); to use new with an array of parameters without spread syntax, you would have to do it indirectly through partial application: function applyandnew(constructor, args) { function partial () { return constructor.apply(this, args); }; if (typeof constructor.prototype === "object") { partial.prototype = object.create(constructor.prototype); } return partial; } function myconstructor () { console.log("arguments.length: " + arguments.length); console.log(arguments); this.prop1="val1"; this.prop2="val2"; }; const myarguments = ["hi", "how", "are", "you", "mr", null]; const myconstructorwitharguments = applyandnew...
... now array 'a' is affected as well: a // [[], [2], [3]] a better way to concatenate arrays array.prototype.concat() is often used to concatenate an array to the end of an existing array.
...And 4 more matches
for...in - JavaScript
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).
...therefore, it is better to use a for loop with a numeric index (or array.prototype.foreach() or the for...of loop) when iterating over arrays where the order of access is important.
...And 4 more matches
Web audio codec guide - Web media technologies
common codecs the list below denotes the codecs most commonly used on the web and which containers (file types) support them.
...of course, individual browsers may or may not choose to support all of these codecs, and their support for which container types can use them may vary as well.
...in addition to choosing the type of encoder to use, you may have the opportunity to adjust the encoder using parameters that choose specific algorithms, tune those algorithms, and specify how many passes to apply while encoding.
...And 4 more matches
values - SVG: Scalable Vector Graphics
WebSVGAttributevalues
the values attribute has different meanings, depending upon the context where itʼs used, either it defines a sequence of values used over the course of an animation, or itʼs a list of numbers for a color matrix, which is interpreted differently depending on the type of color change to be performed.
...the type of the values is defined by the href and attributename attributes.
... fecolormatrix for the <fecolormatrix> element, values is a list of numbers interpreted differently depending on the value of the type attribute.
...And 4 more matches
<rect> - SVG: Scalable Vector Graphics
WebSVGElementrect
value type: <length>|<percentage> ; default value: 0; animatable: yes y the y coordinate of the rect.
... value type: <length>|<percentage> ; default value: 0; animatable: yes width the width of the rect.
... value type: auto|<length>|<percentage> ; default value: auto; animatable: yes height the height of the rect.
...And 4 more matches
<text> - SVG: Scalable Vector Graphics
WebSVGElementtext
value type: <length>|<percentage> ; default value: 0; animatable: yes y the y coordinate of the starting point of the text baseline.
... value type: <length>|<percentage> ; default value: 0; animatable: yes dx shifts the text position horizontally from a previous text element.
... value type: <length>|<percentage> ; default value: none; animatable: yes dy shifts the text position vertically from a previous text element.
...And 4 more matches
<tspan> - SVG: Scalable Vector Graphics
WebSVGElementtspan
value type: <length>|<percentage> ; default value: none; animatable: yes y the y coordinate of the starting point of the text baseline.
... value type: <length>|<percentage> ; default value: none; animatable: yes dx shifts the text position horizontally from a previous text element.
... value type: <length>|<percentage> ; default value: none; animatable: yes dy shifts the text position vertically from a previous text element.
...And 4 more matches
Example - SVG: Scalable Vector Graphics
view the example <?xml version='1.0'?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg"> <head> <title>a swarm of motes</title> <style type='text/css'> <![cdata[ label, input { width: 150px; display: block; float: left; margin-bottom: 10px; } label { text-align: right; width: 75px; padding-right: 20px; } br { clear: left; } ]]> </style> </head> <body onload='update()'> <svg:svg id='display' width='400' height='300'> <svg:circle id='cursor' cx='200' cy='150' r='7' fill='#0000ff' fill...
... </p> <div> (c) 2006 <a id='emailme' href='#'>nick johnson</a> <script type='text/javascript'> <![cdata[ // foil spam bots var email = '@riovia.net'; email ='nick' + email; document.getelementbyid('emailme').href = 'mailto:'+email; ]]> </script> this software is free for you to use in any way whatsoever, and comes with no warranty at all.
...velocity:</label> <input id='max_velocity' value='15'/> <br/> <label>attraction to cursor:</label> <input id='attract_cursor' value='6'/> <br/> <label>repulsion from peers:</label> <input id='repel_peer' value='5'/> <br/> </p> </form> <script type='text/javascript'> <![cdata[ // array of motes var motes; // get the display element.
...And 4 more matches
Namespaces crash course - SVG: Scalable Vector Graphics
background it has been a long standing goal of the w3c to make it possible for different types of xml based content to be mixed together in the same xml file.
...being able to mix content types like this has many advantages, but it also required a very real problem to be solved.
... contrary to popular opinion, the answer to this question is not "it can tell from the doctype declaration".
...And 4 more matches
Mixed content - Web security
types of mixed content there are two categories for mixed content: mixed passive/display content and mixed active content.
... passive content list this section lists all types of http requests which are considered passive content: <img> (src attribute) <audio> (src attribute) <video> (src attribute) <object> subresources (when an <object> performs http requests) mixed active content mixed active content is content that has access to all or parts of the document object model of the https page.
... this type of mixed content can alter the behavior of the https page and potentially steal sensitive data from the user.
...And 4 more matches
Exported WebAssembly functions - WebAssembly
when you call them, you get some activity in the background to convert the arguments into types that wasm can work with (for example converting javascript numbers to int32), the arguments are passed to the function inside your wasm module, the function is invoked, and the result is converted and passed back to javascript.
... you can retrieve exported webassembly functions in two ways: by calling table.prototype.get() on an existing table.
... they are real functions in the previous example, the return value of each table.prototype.get() call is an exported webassembly function — exactly what we have been talking about.
...And 4 more matches
core/namespace - Archive of obsolete content
let { ns } = require('sdk/core/namespace'); let anamespace = ns(); anamespace(publicapi).secret = secret; one namespace may be used with multiple objects: let { ns } = require('sdk/core/namespace'); let dom = ns(); function view(element) { let view = object.create(view.prototype); dom(view).element = element; // ....
... } view.prototype.destroy = function destroy() { let { element } = dom(this); element.parentnode.removechild(element); // ...
... let sandboxes = ns(); function widget(options) { let { element, contentscript } = options; let widget = object.create(widget.prototype); view.call(widget, options.element); sandboxes(widget).sandbox = cu.sandbox(element.ownerdocument.defaultview); // ...
...And 3 more matches
ui/frame - Archive of obsolete content
for example, this html document defines a <select> element and a couple of <span> elements, and includes a css file to style the content and a javascript script to implement behavior: <!doctype html> <html> <head> <link href="city-info.css" rel="stylesheet"></link> </head> <body> <select name="city" id="city-selector"></select> <span id="time" class="info-element"></span> <span id="weather" class="info-element"></span> <script type="text/javascript" src="city-info.js"></script> </body> </html> if we save this document as "city-info.html" under the add-on'...
...this toolbar might look something like: scripting frames to add scripts to frames, include them directly from the frame's html content, as with a normal web page: <script type="text/javascript" src="frame.js"></script> as usual, the path to the script is relative to the html file's location.
...if you send a json object, the sdk takes care of serializing and deserializing it for you: // frame.js var label = window.document.getelementbyid("linky"); label.addeventlistener("click", function() { window.parent.postmessage({ "type" : "ping", "reason" : "they clicked me" }, "*"); }, true); // main.js var { frame } = require("sdk/ui/frame"); var frame = new frame({ url: "./frame.html" }); frame.on("message", pong); function pong(e) { if (e.data.type == "ping") { console.log(e.data.reason); e.source.postmessage("pong", event.origin); } } globals constructors frame(options) creates an frame.
...And 3 more matches
window/utils - Archive of obsolete content
options : object options for the function, with the following properties: name type parent nsidomwindow parent for the new window.
... 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.
... in order to see private windows in this list, your add-on must have opted into private browsing and you must include the includeprivate key in the list of options: var allwindows = window_utils.windows(null, {includeprivate:true}); parameters type : string string identifying the type of window to return.
...And 3 more matches
Displaying web content in an extension without security issues - Archive of obsolete content
however, if the document is loaded into <iframe type="content"> or <browser type="content">, it will be considered a content document, and so will be all the frames it loads (the "type" attribute is ignored at that point).
...note: dynamic changes of the "type" attribute have no effect, the frame type is read out when the frame element is inserted into the document and never again.
... so the usual rule is: don’t change the value of the "type" attribute.
...And 3 more matches
Extension Versioning, Update and Compatibility - Archive of obsolete content
it varies depending on what type of add-on you are providing information for: for an extension or plugin bundle it must be urn:mozilla:extension:<id> for a theme it must be urn:mozilla:theme:<id> for any other type of add-on it must be urn:mozilla:item:<id> note: prior to gecko 2.0 (firefox 4.0), the ordering of the versions within the <rdf:seq> is significant.
... the information page retrieved must currently be totally valid xhtml, including being delivered with the mime type application/xhtml+xml (important: see problems section) you may include %app_locale% in your updateinfourl if you want to have locale information included in the url -- this allows you to customize the text based on the user's locale.
...other tags aren't included in the result but do have their contents displayed, so the following snippet: <span><q>text</q></span> would be rendered exactly the same as: <q>text</q> sample file <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html lang="en-us" dir="ltr" xmlns="http://www.w3.org/1999/xhtml"> <h2>my extension</h2> <ul> <li>this update fixes some stability related issues.</li> </ul> </html> what end-user sees the content of updateinfourl will be displayed to user in the add-ons page, in a list of all available updates...
...And 3 more matches
Images, Tables, and Mysterious Gaps - Archive of obsolete content
all it takes is a modern browser and the right doctype, and kaboom!
... now let's see what that same simple table looks like in a modern browser when the page has a strict doctype.
... you can do this by using a doctype that will trigger either "quirks" mode or "almost standards" mode, or not having a doctype appear in your document at all.
...And 3 more matches
Compiling The npruntime Sample Plugin in Visual Studio - Archive of obsolete content
general decisions filename of dll must start with "np" (not "ns") and ends with ".dll" (i wasted hours on this - repeatedly) mimetype reflects the data type handled by the plugin.
...should either be like "application/x-vnd-yourorganization-yourfiletype" or be officially registered with iana (unlikely) or be a standard type (e.g.
... file extension reflects the data type handled by the plugin, esp.
...And 3 more matches
Editor Embedding Guide - Archive of obsolete content
from there you call editingsession->makewindoweditable(domwindow, editortype, pr_true).
... the first parameter is the nsidomwindow you just retrieved, the second is the editor type you want to create, and the third is whether you want the window editable immediately or when the document is done loading.
...nscomptr<nsieditingsession> editingsession; nsiwebbrowser->do_getinterface(getter_addrefs(editingsession)); if (editingsession) editingsession->makewindoweditable(domwindow, "html", pr_true); the valid editor types are: "text" (similar to notepad or a textarea; does not allow for html) "textmail" (similar to "text" but html can be inserted; intended for plaintext mail usage and handling of citations) "html" (this is the default type if no type is specified; it allows for all html tags to be inserted) "htmlmail" (this is much like "html" except there are a few editing rules/behaviors that differ such as splitting of mail quote...
...And 3 more matches
Modularization techniques - Archive of obsolete content
/* * the nsisupports interface */ class nsisupports { public: ns_imethod queryinterface(const nsiid &aiid, void **aresult) = 0; ns_imethod_(nsrefcnt) addref(void) = 0; ns_imethod_(nsrefcnt) release(void) = 0; }; the ns_imethod and ns_imethod_(type) macros are basically shorthand for virtual nsresult and virtualtype.
... on windows they expand to virtual nsresult __stdcall and virtual type __stdcall for com compatibility reasons.
...it outputs nspr types when generating c++ headers.
...And 3 more matches
Elements - Archive of obsolete content
helloworld.html: <!doctype html public "-//w3c//dtd html 4.01//en"> <html> <head> <title>hello world!</title> <style type="text/css"> p { -moz-binding: url(hello.xml#default); } #p03 { -moz-binding: url(hello.xml#hello2); } </style> </head> <body> <p>default content</p> <p>default content</p> <p id="p03">default content</p> </body> </html> hello.xml: <?xml version="1.0"?> <bindings xmlns="http://www.mozilla.o...
...not all tags have a unique display type.
... the following xul display types may be used: browser, button, checkbox, description, editor, grippy, iframe, image, label, menu, menuitem, menubar, progressmeter, radio, resizer, scrollbar, scrollbox, spacer, splitter, titlebar, treechildren and treecol.
...And 3 more matches
How to implement a custom XUL query processor component - Archive of obsolete content
here is an example of what our xul might look like when using a custom query processor: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <grid> <columns> <column flex="1"/> <column flex="3"/> <column flex="2"/> <column flex="1"/> </columns> <rows datasources="dummy" ref="." querytype="simpledata"> <template> <row uri="?"> ...
...the querytype is important.
...the contract id of our xpcom component should be of the form "@mozilla.org/xul/xul-query-processor;1?name=xxx", where the xxx is the querytype used in the xul template block.
...And 3 more matches
Panels - Archive of obsolete content
a panel is a popup which can support any type of content.
... <?xml-stylesheet href="chrome://global/skin" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <button label="details" type="panel"> <panel id="search-panel"> <label control="name" value="name:"/> <textbox id="name"/> </panel> </button> </window> many panels will be associated with a button, as in this example.
...you also need to set the type attribute on the button to the value panel, or the button will look and behave like a regular button.
...And 3 more matches
Building Menus With Templates - Archive of obsolete content
this applies to menus on menubars, submenus, as well as menu-type buttons such as those with a type attribute set to menu.
...here is an example using an xml source: <button type="menu" datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="person"/> <action> <menupopup> <menuitem uri="?" label="?name"/> </menupopup> </action> </template> </button> <button label="children" oncommand="alert(this.previoussibling.childnodes.length);"/> in this example, the datasources attribute has been placed on a menu-type button.
...here is an rdf example: <button label="houses in my neighbourhood" type="menu" datasources="template-guide-streets.rdf" ref="http://www.xulplanet.com/rdf/myneighbourhood" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <template> <rule rdf:type="http://www.xulplanet.com/rdf/house"> <menupopup> <menuitem uri="rdf:*" label="rdf:http://www.xulplanet.com/rdf/address"/> </menupopup> </rule> <rule> <m...
...And 3 more matches
Special Condition Tests - Archive of obsolete content
« previousnext » there are several additional types of conditional tests that may be performed.
...here is a previous example, rewritten to use the parent matching syntax: <vbox datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="*"/> <rule parent="vbox"> <action> <groupbox uri="?"> <caption label="?name"/> </groupbox> </action> </rule> <rule> <action> <label uri="?" value="?name"/> </action> </rule> </template> </vbox> previously, an assign element was used to assign the tagname of the result to a variable, w...
...if this is not the case, you will still need to use other types of conditions to handle this case.
...And 3 more matches
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
in the file, type some of the special characters that your language uses.
...check that the text you typed looks ok with this setting.
...paste it into the new file: <?xml version="1.0" encoding="utf-8"?> <!doctype rdf:rdf> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:chrome="http://www.mozilla.org/rdf/chrome#"> <rdf:seq rdf:about="urn:mozilla:package:root"> <rdf:li rdf:resource="urn:mozilla:package:custombutton"/> </rdf:seq> <rdf:description rdf:about="urn:mozilla:package:custombutton" chrome:displayname="custom button" chrome:description="my custo...
...And 3 more matches
Tree Widget Changes - Archive of obsolete content
checkbox columns tree columns now implement the checkbox type.
...you can create a checkbox column by setting the type attribute of a column to checkbox.
... <treecol type="checkbox"> you can then set or clear the checkbox for a particular cell in that column by setting the value attribute to true, or leaving out the attribute.
...And 3 more matches
Creating a Window - Archive of obsolete content
the simplest xul file has the following structure: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <!-- other elements go here --> </window> this window will not do anything since it doesn't contain any ui elements.
... <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> this line is used to specify the style sheets to use for the file.
...if you are only in the development stage, you can just type the url (whether a chrome:, file: or other url type) into the location bar in a mozilla browser window.
...And 3 more matches
Localization - Archive of obsolete content
dtd files entities are declared in document type definition (dtd) files.
... files of this type are normally used to declare the syntax and semantics of a particular xml file, but they also let you declare entities.
...to do this, add a line of the following form somewhere near the top of the xul file: <!doctype window system "chrome://findfile/locale/findfile.dtd"> this line specifies that the url indicated is to be used as a dtd for the file.
...And 3 more matches
Open and Save Dialogs - Archive of obsolete content
« previousnext » a common type of dialog is one where the user can select a file to open or save.
... the appearance of the dialog will be different for each type and will vary on each platform.
... the second is a filter that indicates the list of file types that are displayed in the dialog.
...And 3 more matches
Templates - Archive of obsolete content
there are two different types of builders.
...that means that we want to have two different types of content be created, one type for regular bookmarks and a second type for separators.
...e demonstrates the earlier example with two rules: example 4 : source <window id="example-window" title="bookmarks list" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <vbox datasources="rdf:bookmarks" ref="nc:bookmarksroot" flex="1"> <template> <rule rdf:type="http://home.netscape.com/nc-rdf#bookmarkseparator"> <spacer uri="rdf:*" height="16"/> </rule> <rule> <button uri="rdf:*" label="rdf:http://home.netscape.com/nc-rdf#name"/> </rule> </template> </vbox> </window> by using two rules, we have allowed the contents of the template to be selectively generated.
...And 3 more matches
The Implementation of the Application Object Model - Archive of obsolete content
rdf provides a very general mechanism for representing relationships between different disparate types of data.
...in order to accomplish this, our architecture has to have some sort of facility whereby different types of content, e.g., mail and bookmarks, can register themselves as the appropriate content to be instantiated for a given uri.
...however, in this xpcom world, where each type of pluggable content is off in its own dll, there's no clean way to inherit functionality from some base class implementation, when that implementation must necessarily reside in a different dll, without introducing a code dependency between all pluggable content and the common base class.
...And 3 more matches
image - Archive of obsolete content
ArchiveMozillaXULimage
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 has finished loading.
... src type: uri the uri of the content to appear in the element.
...And 3 more matches
listcell - Archive of obsolete content
attributes crop, disabled, image, label, type properties disabled style classes listcell-iconic, examples (example needed) attributes crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute.
...for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not.
... image type: uri the uri of the image to appear on the element.
...And 3 more matches
<statusbarpanel> - Archive of obsolete content
this is a special type of button which is drawn differently.
... attributes crop, image, label properties image, label style classes statusbarpanel-iconic, statusbarpanel-iconic-text, statusbarpanel-menu-iconic examples <statusbar> <statusbarpanel label="left panel"/> <spacer flex="1"/> <progressmeter mode="determined" value="82"/> <statusbarpanel label="right panel"/> </statusbar> attributes crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute.
...for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } image type: uri the uri of the image to appear on the element.
...And 3 more matches
wizardpage - Archive of obsolete content
attributes description, label, next, pageid properties next, pageid attributes description type: string descriptive text to appear in addition to the dialog title.
... label type: string the label that will appear on the element.
... next type: id set to the pageid of the next wizardpage after this one.
...And 3 more matches
NPAPI plugin reference - Archive of obsolete content
np_getmimedescription np_getmimedescription returns a supported mime type list for your plugin.
...on windows you have to define supported mimetypes in the dll resource file.
... npidentifier npidentifier is an opaque type used for method and property identifiers, such as strings or integers.
...And 3 more matches
Building a Theme - Archive of obsolete content
all manifest open the file called install.rdf that you created at the top of your extension's folder hierarchy and put this inside: <?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:id>sample@example.net</em:id> <em:version>1.0</em:version> <em:type>4</em:type> <!-- target application this theme can install into, with minimum and maximum supported versions.
...(example.example.example) 4 - the type of the add-on.
...if you were to install an extension it would be 2 (see install manifests#type for other type codes).
...And 3 more matches
-ms-filter - Archive of obsolete content
syntax the -ms-filter property is specified as a string that contains a list of one or more items, separated by spaces, of the following types: filters transitions procedural surfaces formal syntax filter: <-ms-filter-function>+ -ms-filter: [ "'" <-ms-filter-function># "'" ] | [ '"' <-ms-filter-function># '"' ] where <-ms-filter-function> = <-ms-filter-function-progid> | <-ms-filter-function-legacy> where <-ms-filter-function-progid> = 'progid:' [ <ident-token> '.' ]* [ <ident-token> | <function-token> <any-value> ')' ] <-ms-...
...e; top: 20px; left: 20px;" src="sphere.jpg" alt="sphere"> <div id="filterto" style="position: absolute; width: 200px; height: 250px; top: 20px; left: 20px; background: white; visibility: hidden;"> </div> </div> <script type="text/javascript"> let filterimg = document.queryselector('#filterfrom'); filterimg.addeventlistener('click', dofilter); function dofilter () { filterfrom.filters.item(0).apply(); // 12 is the dissolve filter.
... filterfrom.filters.item(0).transition=12; imagefrom.style.visibility = "hidden"; filterto.style.visibility = ""; filterfrom.filters.item(0).play(14); } </script> </body> gradient progid:dximagetransform.microsoft.gradient( <properties> ) where <properties> = [ <enabled> | <endcolor> | <endcolorstr> | <gradienttype> | <startcolor> | <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.
...And 3 more matches
ECMAScript 2015 support in Mozilla - Archive of obsolete content
standard library additions to the array object array iteration with for...of (firefox 13) array.from() (firefox 32) array.of() (firefox 25) array.prototype.fill() (firefox 31) array.prototype.find(), array.prototype.findindex() (firefox 25) array.prototype.entries(), array.prototype.keys() (firefox 28), array.prototype.values() array.prototype.copywithin() (firefox 32) get array[@@species] (firefox 48) new map and set objects, and their weak counterparts map (firefox 13) map iteration with for...of (firefox 17) map.prototype.f...
...oreach() (firefox 25) map.prototype.entries() (firefox 20) map.prototype.keys() (firefox 20) map.prototype.values() constructor argument: new map(null) (firefox 37) monkey-patched set() in constructor (firefox 37) get map[@@species] (firefox 41) set (firefox 13) set iteration with for...of (firefox 17) set.prototype.foreach() (firefox 25) set.prototype.entries(), set.prototype.keys(), set.prototype.values() (firefox 24) constructor argument: new set(null) (firefox 37) monkey-patched add() in constructor (firefox 37) get set[@@species] (firefox 41) weakmap (firefox 6) weakmap.clear() (firefox 20) optional iterable argument in weakmap constructor (firefox 36) constructor argument: new weakmap(null) (firefox 37) monkey-patc...
...), math.cbrt() (firefox 25) additions to the number object number.isnan() (firefox 16) number.isfinite() (firefox 16) number.isinteger() (firefox 16) number.parseint() (firefox 25) number.parsefloat() (firefox 25) number.epsilon (firefox 25) number.max_safe_integer, number.min_safe_integer (firefox 31) number.issafeinteger() (firefox 32) additions to the object object object.prototype.__proto__ has been standardized object.is() (firefox 22) object.setprototypeof() (firefox 31) object.assign() (firefox 34) object.getownpropertysymbols() (firefox 33) additions to the date object date.prototype is an ordinary object (firefox 41) generic date.prototype.tostring (firefox 41) date.prototype[@@toprimitive] (firefox 44) new promise object promise (firefox 24, enabled b...
...And 3 more matches
Object.observe() - Archive of obsolete content
type: a string indicating the type of change taking place.
... oldvalue: only for "update" and "delete" types.
... acceptlist the list of types of changes to be observed on the given object for the given callback.
...And 3 more matches
XForms Upload Element - Archive of obsolete content
a filter can be specified to limit the types of files that the user can select from.
... visually, the upload control is shown as a file picker dialog that hides disallowed (filtered) file types.
... the xforms author can set the filter by using the mediatype attribute directly on the upload element or by placing a mediatype element (see the spec) as a direct child of the upload element.
...And 3 more matches
Building up a basic demo with the PlayCanvas engine - Game development
<!doctype html> <html> <head> <meta charset="utf-8"> <title>mdn games: playcanvas demo</title> <style> body { margin: 0; padding: 0; } canvas { width: 100%; height: 100%; } </style> </head> <body> <script src="playcanvas-latest.js"></script> <canvas id="application-canvas"></canvas> <script> var canvas = document.getelementbyid("application-canvas"); /* all our javas...
...let's start by defining the geometry for a cube shape — add the following new code below your previous additions: var box = new pc.entity(); box.addcomponent("model", { type: "box" }); app.root.addchild(box); box.rotate(10, 15, 0); it will create an entity with the box model component and add it to the root of the application, our scene.
... lights the basic light types in playcanvas are directional and ambient.
...And 3 more matches
Accessible multimedia - Learn web development
for example (see native-controls.html source code and live): <audio controls> <source src="viper.mp3" type="audio/mp3"> <source src="viper.ogg" type="audio/ogg"> <p>your browser doesn't support html5 audio.
... here is a <a href="viper.mp3">link to the audio</a> instead.</p> </audio> <br> <video controls> <source src="rabbit320.mp4" type="video/mp4"> <source src="rabbit320.webm" type="video/webm"> <p>your browser doesn't support html5 video.
... first of all, let's look at the html for the video player, in the html: <section class="player"> <video controls> <source src="rabbit320.mp4" type="video/mp4"> <source src="rabbit320.webm" type="video/webm"> <p>your browser doesn't support html5 video.
...And 3 more matches
WAI-ARIA basics - Learn web development
html5 provides special input types to render such controls: <input type="date"> <input type="range"> these are not well-supported across browsers, and it is also difficult to style them, making them not very useful for integrating with website designs.
...the search form is a really important landmark that people will want to find, but it is not listed in the landmarks menu or treated like a notable landmark, beyond the actual input being called out as a search input (<input type="search">).
... <input type="search" name="q" placeholder="search query" aria-label="search through site content"> now if we use voiceover to look at this example, we get some improvements: the search form is called out as a separate item, both when browsing through the page, and in the landmarks menu.
...And 3 more matches
Advanced text formatting - Learn web development
description lists in html text fundamentals, we walked through how to mark up basic lists in html, but we didn't mention the third type of list you'll occasionally come across — description lists.
...this is usually a feeling, thought or piece of additional background information description lists use a different wrapper than the other list types — <dl>; in addition each term is wrapped in a <dt> (description term) element, and each description is wrapped in a <dd> (description definition) element.
...a light brown color.</textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solu...
...And 3 more matches
HTML text fundamentals - Learn web development
my legs are made of cardboard and i am married to a fish.</textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution =...
...lists are everywhere on the web, too, and we've got three different types to worry about.
... playable code <h2>live output</h2> <div class="output" style="min-height: 50px;"> </div> <h2>editable code</h2> <p class="a11y-label">press esc to move focus away from the code area (tab inserts a tab character).</p> <textarea id="code" class="input" style="min-height: 100px; width: 95%">milk eggs bread hummus</textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution =...
...And 3 more matches
Introducing asynchronous JavaScript - Learn web development
there are two main types of asynchronous code style you'll come across in javascript code, old-style callbacks and newer promise-style code.
... an example of an async callback is the second parameter of the addeventlistener() method (as we saw in action above): btn.addeventlistener('click', () => { alert('you clicked me!'); let pelem = document.createelement('p'); pelem.textcontent = 'this is a newly-added paragraph.'; document.body.appendchild(pelem); }); the first parameter is the type of event to be listened for, and the second parameter is a callback function that is invoked when the event is fired.
...let's look at another example that loads a resource via the xmlhttprequest api (run it live, and see the source): function loadasset(url, type, callback) { let xhr = new xmlhttprequest(); xhr.open('get', url); xhr.responsetype = type; xhr.onload = function() { callback(xhr.response); }; xhr.send(); } function displayimage(blob) { let objecturl = url.createobjecturl(blob); let image = document.createelement('img'); image.src = objecturl; document.body.appendchild(image); } loadasset('coffee.jpg', 'blob', disp...
...And 3 more matches
Making decisions in your code — conditionals - Learn web development
o represent such decision making in javascript, from the choice that must be made (for example, "one cookie or two"), to the resulting outcome of those choices (perhaps the outcome of "ate one cookie" might be "still felt hungry", and the outcome of "ate two cookies" might be "felt full, but mom scolded me for eating all the cookies".) if...else statements let's look at by far the most common type of conditional statement you'll use in javascript — the humble if...else statement.
...} — check out the following more involved example, which could be part of a simple weather forecast application: <label for="weather">select the weather type today: </label> <select id="weather"> <option value="">--make a choice--</option> <option value="sunny">sunny</option> <option value="rainy">rainy</option> <option value="snowing">snowing</option> <option value="overcast">overcast</option> </select> <p></p> const select = document.queryselector('select'); const para = document.queryselector('p'); select.addeventlistener('change', set...
... let's look at a quick or example: if (icecreamvanoutside || housestatus === 'on fire') { console.log('you should leave the house quickly.'); } else { console.log('probably should just stay in then.'); } the last type of logical operator, not, expressed by the !
...And 3 more matches
Fetching data from the server - Learn web development
add this below your previous line: request.open('get', url); next, we'll set the type of response we are expecting — which is defined by the request's responsetype property — as text.
... this isn't strictly necessary here — xhr returns text by default — but it is a good idea to get into the habit of setting this in case you want to fetch other types of data in the future.
... add this next: request.responsetype = 'text'; fetching a resource from the network is an asynchronous operation, meaning that you have to wait for that operation to complete (e.g., the resource is returned from the network) before you can do anything with that response, otherwise, an error will be thrown.
...And 3 more matches
Introduction to web APIs - Learn web development
find out more about these types of api in manipulating documents.
...if you look at our simple web audio example (see it live also), you'll first see the following html: <audio src="outfoxing.mp3"></audio> <button class="paused">play</button> <br> <input type="range" min="0" max="1" step="0.01" value="1" class="volume"> we, first of all, include an <audio> element with which we embed an mp3 into the page.
...next, we include a <button> that we'll use to play and stop the music, and an <input> element of type range, which we'll use to adjust the volume of the track while it's playing.
...And 3 more matches
Arrays - Learn web development
array objects can be stored in variables and dealt with in much the same way as any other type of value, the difference being that we can access each value inside the list individually, and do super useful and efficient things with the list, like loop through it and do the same thing to every value.
...paste the following code into the console: let shopping = ['bread', 'milk', 'cheese', 'hummus', 'noodles']; shopping; in the above example, each element is a string, but in an array we can store various data types — strings, numbers, objects, and even other arrays.
... we can also mix data types in a single array — we do not have to limit ourselves to storing only numbers in one array, and in another only strings.
...And 3 more matches
Dynamic behavior in Svelte: working with variables and props - Learn web development
replace the existing <ul> element with the following simplified version to get an idea of how it works: <ul> {#each todos as todo, index (todo.id)} <li> <input type="checkbox" checked={todo.completed}/> {index}.
...replace your existing <ul> block with the following: <!-- todos --> <ul role="list" class="todo-list stack-large" aria-labelledby="list-heading"> {#each todos as todo (todo.id)} <li class="todo"> <div class="stack-small"> <div class="c-cb"> <input type="checkbox" id="todo-{todo.id}" checked={todo.completed}/> <label for="todo-{todo.id}" class="todo-label"> {todo.name} </label> </div> <div class="btn-group"> <button type="button" class="btn"> edit <span class="visually-hidden">{todo.name}</span> </button> <button type="button" class="btn btn__danger"> ...
... update the <input type="checkbox"> element inside src/components/todos.svelte as follows: <input type="checkbox" id="todo-{todo.id}" on:click={() => todo.completed = !todo.completed} checked={todo.completed} /> next we'll add a function to remove a todo from our todos array.
...And 3 more matches
Styling Vue components with CSS - Learn web development
ground: transparent; color: inherit; font: inherit; line-height: normal; -webkit-font-smoothing: inherit; -moz-osx-font-smoothing: inherit; -webkit-appearance: none; } button::-moz-focus-inner { border: 0; } button, input, optgroup, select, textarea { font-family: inherit; font-size: 100%; line-height: 1.15; margin: 0; } button, input { /* 1 */ overflow: visible; } input[type="text"] { border-radius: 0; } body { width: 100%; max-width: 68rem; margin: 0 auto; font: 1.6rem/1.25 "helvetica neue", helvetica, arial, sans-serif; background-color: #f5f5f5; color: #4d4d4d; -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; } @media screen and (min-width: 620px) { body { font-size: 1.9rem; line-height: 1.31579; } } /*end rese...
... add class="btn btn__primary btn__lg" to your form’s <button> element: <button type="submit" class="btn btn__primary btn__lg"> add </button> while we're here, there's one more semantic and styling change we can make.
... </label> </h2> <input type="text" id="new-todo-input" name="new-todo" autocomplete="off" v-model.lazy.trim="label" class="input__lg" /> <button type="submit" class="btn btn__primary btn__lg"> add </button> </form> </template> let's also add the stack-large class to the <ul> tag in our app.vue file.
...And 3 more matches
Download
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.
... contenttype string the mime type of the download, for example "text/plain", or null if the mime type is not available.
... this property may be populated or changed while the download is in progress, using the mime type provided by the server.
...And 3 more matches
L20n HTML Bindings
consider the following source html: <p data-l10n-id="save"> <input type="submit"> <a href="/main" class="btn-cancel"></a> </p> assume the following malicious translation: <save """ <input value="save" type="text"> or <a href="http://myevilwebsite.com" onclick="alert('pwnd!')" title="back to the homepage">cancel</a>.
... """> the result will be: <p data-l10n-id="back"> <input value="save" type="submit"> or <a href="/main" class="btn-cancel" title="back to the homepage">cancel</a>.
...the value attribute is allowed on input elements, but type is not.
...And 3 more matches
Creating a Cookie Log
change to your firefox directory (usually c:\program files\mozilla firefox) type "set nspr_log_file=c:\temp\cookie-log.txt", enter type "set nspr_log_modules=cookie:4" and press enter run firefox by typing "firefox.exe" and pressing enter.
... type "export nspr_log_file=~/cookie-log.txt" and press enter.
... type "export nspr_log_modules=cookie:4" and press enter.
...And 3 more matches
Introduction to NSPR
nspr naming conventions naming of nspr types, functions, and macros follows the following conventions: types exported by nspr begin with pr and are followed by intercap-style declarations, like this: print, prfiledesc function definitions begin with pr_ and are followed by intercap-style declarations, like this: pr_read, pr_jointhread preprocessor macros begin with the letters pr and are followed by all uppercase characters separated ...
... to an nspr client, a thread is represented by a pointer to an opaque structure of type prthread.
... in nspr, a mutual exclusion lock (or mutex) of type prlock controls locking, and associated condition variables of type prcondvar communicate changes in state among threads.
...And 3 more matches
Monitors
in addition to the mutex type prlock, nspr provides a special type, prmonitor, for use in java programming.
... this chapter describes the nspr api for creation and manipulation of a mutex of type prmonitor.
... monitor type monitor functions with a mutex of type prlock, a single thread may enter the monitor only once before it exits, and the mutex can have multiple associated condition variables.
...And 3 more matches
NSPR API Reference
introduction to nspr nspr naming conventions nspr threads thread scheduling setting thread priorities preempting threads interrupting threads nspr thread synchronization locks and monitors condition variables nspr sample code nspr types calling convention types algebraic types 8-, 16-, and 32-bit integer types signed integers unsigned integers 64-bit integer types floating-point integer type native os integer types miscellaneous types size type pointer difference types boolean types status type for return values threads threading types and constants threading functions creating, joining, and identifying threads controlling thread priorities contr...
...olling per-thread private data interrupting and yielding setting global thread concurrency getting a thread's scope process initialization identity and versioning name and version constants initialization and cleanup module initialization locks lock type lock functions condition variables condition variable type condition variable functions monitors monitor type monitor functions cached monitors cached monitor functions i/o types directory type file descriptor types file info types network address types types used with socket options functions type used with memory-mapped i/o offset interpretation for seek functions i/o functions functions that operate on pathnames functions that act on file descriptors directory i/o fun...
...ctions socket manipulation functions converting between host and network addresses memory-mapped i/o functions anonymous pipe function polling functions pollable events manipulating layers network addresses network address types and constants network address functions atomic operations pr_atomicincrement pr_atomicdecrement pr_atomicset interval timing interval time type and constants interval functions date and time types and constants time parameter callback functions functions memory management operations memory allocation functions memory allocation macros string operations pl_strlen pl_strcpy pl_strdup pl_strfree floating point number to string conversion pr_strtod pr_dtoa pr_cnvtf long long (64-bit) integers bitmaps formatted print...
...And 3 more matches
NSS Certificate Download Specification
the contenttype field oid must be netscape-cert-sequence (see object identifiers).
...for mozilla browsers, this handling will depend upon the mime content-type that is used on the object being downloaded.
...there are several mime content types that are used to indicate to the browser what type of certificate is being imported.
...And 3 more matches
NSS 3.35 release notes
new types in sslt.h sslhandshaketype - the type of a tls handshake message.
... applications using nss may explicitly request to use a specific database format, by adding a type prefix to the database directory, provided at nss initialization time.
... without a prefix, the default database type will be used (dbm in versions prior to 3.35, and sql in version 3.35 and later.) when using the sql type (either explicitly, or because of the new default), with a database directory which already contains a dbm type database, nss will automatically perform a one time migration of the information contained in the dbm files to the newer sql files.
...And 3 more matches
NSS Sample Code Sample_1_Hashing
sample code 1 /* nspr headers */ #include <prprf.h> #include <prtypes.h> #include <plgetopt.h> #include <prio.h> /* nss headers */ #include <secoid.h> #include <secmodt.h> #include <sechash.h> typedef struct { const char *hashname; secoidtag oid; } nametagpair; /* the hash algorithms supported */ static const nametagpair hash_names[] = { { "md2", sec_oid_md2 }, { "md5", sec_oid_md5 }, { "sha1", sec_oid_sha1 }, { "sha256", sec_oid_sha256 }, { "sha384", sec_oid_sha384 }, { "sha512", sec_oid_sha512 } }; /* * maps a hash name to a secoidtag.
...{ pr_fprintf(out, "%02x", data[i]); column += 2; break; } if (column > 76 || (i % 16 == limit)) { newline(out); column = level; limit = i % 16; } } if (column != level) { newline(out); } } /* * prints a usage message and exits */ static void usage(const char *progname) { int htype; int hash_algtotal = sizeof(hash_names) / sizeof(hash_names[0]); fprintf(stderr, "usage: %s -t type [ < input ] [ > output ]\n", progname); fprintf(stderr, "%-20s specify the digest method (must be one of\n", "-t type"); fprintf(stderr, "%-20s ", ""); for (htype = 0; htype < hash_algtotal; htype++) { fprintf(stderr, hash_names[htype].hashname); if...
... (htype == (hash_algtotal - 2)) fprintf(stderr, " or "); else if (htype != (hash_algtotal - 1)) fprintf(stderr, ", "); } fprintf(stderr, " (case ignored))\n"); fprintf(stderr, "%-20s define an input file to use (default is stdin)\n", "< input"); fprintf(stderr, "%-20s define an output file to use (default is stdout)\n", "> output"); exit(-1); } /* * check for the missing arguments */ static void printmsgandexit(const char *progname, char opt) { fprintf(stderr, "%s: option -%c requires an argument\n", progname, opt); usage(progname); } #define require_arg(opt,value) if (!(value)) printmsgandexit(progname, opt) /* * digests a file according to the specified algorithm.
...And 3 more matches
nss tech note7
data types nss uses the following data types to represent keys: seckeypublickey: a public key, defined in "keythi.h".
... these data types should be used as if they were opaque structures, that is, they should only be created by some nss functions and you always pass pointers to these data types to nss functions and never examine the members of these structures.
...call seckey_importderpublickey() with type=ckk_rsa to import a der-encoded rsa public key.
...And 3 more matches
NSS tools : crlutil
to run the certificate revocation list management tool, type the command crlutil option [arguments] where options and arguments are combinations of the options and arguments listed in the following section.
... -i import a crl to the cert database -e erase all crls of specified type from the cert database -l list existing crl located in cert database file.
... -t crl-type specify type of crl.
...And 3 more matches
NSS tools : crlutil
MozillaProjectsNSStoolscrlutil
to run the certificate revocation list management tool, type the command crlutil option [arguments] where options and arguments are combinations of the options and arguments listed in the following section.
... -i import a crl to the cert database -e erase all crls of specified type from the cert database -l list existing crl located in cert database file.
... -t crl-type specify type of crl.
...And 3 more matches
NSS tools : signver
MozillaProjectsNSStoolssignver
signver supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new sqlite databases (cert9.db, key4.db, and pkcs11.txt).
... signver -a -s signature_file -o output_file nss database types nss originally used berkeleydb databases to store security information.
...these new databases provide more accessibility and performance: o cert9.db for certificates o key4.db for keys o pkcs11.txt, which is listing of all of the pkcs #11 modules contained in a new subdirectory in the security databases directory because the sqlite databases are designed to be shared, these are the shared database type.
...And 3 more matches
The JavaScript Runtime
types and values there are six fundamental types in javascript.
... these types are implemented with the following java types and values: javascript fundamental type java type undefined a singleton object defined by context.getundefinedtype() null null boolean java.lang.boolean number java.lang.number, that is, any of java.lang.byte, java.lang.short, java.lang.integer, java.lang.float, or java.lang.double.
...these object types are represented by implementing the function interface.
...And 3 more matches
Self-hosted builtins in SpiderMonkey
in contrast to function.prototype.call, this syntax makes it impossible for other code to interfere and gets compiled to bytecode that doesn't have any overhead compared to a normal function invocation.
... self-hosted functions by default are not constructors and do not have a prototype property, so that they meet the requirements for standard built-in functions as described in the ecmascript language specification 5.1, clause 15.
...a prototype property can be added from the self-hosted code itself.
...And 3 more matches
JSNewEnumerateOp
the type of objectops::enumerate.
... 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.
... description from spidermonkey 38, jsnewenumerateop is the type of objectops::enumerate.
...And 3 more matches
JSObjectOps.setProto
the jsobjectops.setproto and setparent callbacks implement the js_setprototype and js_setparent functions.
... these callbacks share the same type, jssetobjectslotop.
... syntax typedef jsbool (*jssetobjectslotop)(jscontext *cx, jsobject *obj, uint32 slot, jsobject *pobj); name type description cx jscontext * pointer to the js context in which the object's prototype or parent is being modified.
...And 3 more matches
JSPropertyOp
jspropertyop and jsstrictpropertyop are the type of property getter and setter callbacks in the jsapi.
... they are also the types of the jsclass.addproperty, getproperty, and setproperty callbacks, which are called during object property accesses.
... syntax typedef bool (* jspropertyop)(jscontext *cx, js::handleobject obj, js::handleid id, js::mutablehandlevalue vp); typedef bool (* jsstrictpropertyop)(jscontext *cx, js::handleobject obj, js::handleid id, bool strict, js::mutablehandlevalue vp); // added in spidermonkey 1.9.3 name type description cx jscontext * the context in which the property access is taking place.
...And 3 more matches
JSProtoKey
this article covers features introduced in spidermonkey 24 possible standard object prototype types.
... value prototype in javascript jsproto_null a dummy key for invalid prototype.
...rror mxr search for jsproto_internalerror jsproto_evalerror evalerror mxr search for jsproto_evalerror jsproto_rangeerror rangeerror mxr search for jsproto_rangeerror jsproto_referenceerror referenceerror mxr search for jsproto_referenceerror jsproto_syntaxerror syntaxerror mxr search for jsproto_syntaxerror jsproto_typeerror typeerror mxr search for jsproto_typeerror jsproto_urierror urierror mxr search for jsproto_urierror jsproto_iterator iterator mxr search for jsproto_iterator jsproto_stopiteration stopiteration mxr search for jsproto_stopiteration jsproto_arraybuffer arraybuffer mxr search for jsproto_arraybuffer jsproto_in...
...And 3 more matches
JS_ConstructObject
create a new object of the specified class, with the specified prototype and parent, then invokes a constructor function to initialize the new object.
... syntax jsobject * js_constructobject(jscontext *cx, jsclass *clasp, jsobject *proto, jsobject *parent); jsobject * js_constructobjectwitharguments(jscontext *cx, jsclass *clasp, jsobject *proto, jsobject *parent, unsigned int argc, jsval *argv); name type description cx jscontext * the context in which to create the new object.
... proto jsobject * the object to serve as the new object's prototype, or null.
...And 3 more matches
JS_NewObjectForConstructor
syntax jsobject * js_newobjectforconstructor(jscontext *cx, const jsclass *clasp, const js::callargs& args); // added in jsapi 32 jsobject * js_newobjectforconstructor(jscontext *cx, jsclass *clasp, const jsval *vp); // added in jsapi 14, obsolete since jsapi 32 jsobject * js_newobjectforconstructor(jscontext *cx, const jsval *vp); // obsolete since jsapi 14 name type description cx jscontext * the context in which to create the new object.
...this must be an object that has a prototype property.
...if the constructor does not have a prototype property, this function will return null and set an exception on cx.
...And 3 more matches
JS_PropertyStub
cx, js::handleobject obj, js::handleid id, bool *resolvedp); // obsolete since jsapi 37 bool js_deletepropertystub(jscontext *cx, js::handleobject obj, js::handleid id, bool *succeeded); // obsolete since jsapi 37 bool js_enumeratestub(jscontext *cx, js::handleobject obj); // obsolete since jsapi 37 bool js_convertstub(jscontext *cx, js::handleobject obj, jstype type, js::mutablehandlevalue vp); // obsolete since jsapi 37 void js_finalizestub(jscontext *cx, jsobject *obj); // obsolete since jsapi 14 description the stub functions are not designed to be called directly by a jsapi application.
... rather, they are convenient stand-ins anywhere the jsapi requires callbacks of certain types.
... js_propertystub is of type jspropertyop, the type of getter callback.
...And 3 more matches
SpiderMonkey 31
this entailed changing the vast majority of the jsapi from raw types, such as js::value or js::value*, to js::handle and js::mutablehandle template types that encapsulate access to the provided value/string/object or its location.
...many jsapi types, functions, and callback signatures have changed, though most functions that have changed still have the same names and implement essentially unchanged functionality.
...here is a list of the most significant changes: many of the garbage collector changes require type signature changes to jsapi methods: specifically introducing js::rooted, js::handle, and js::mutablehandle types.
...And 3 more matches
TPS History Lists
there are two types of history asset lists, one used for adding/modiyfing/verifying history, and the other for deleting history.
...an array of objects representing visits to the page, each object has the following properties: type: required.
... an integer value from one of the transition types listed at https://developer.mozilla.org/en/nsinavhistoryservice#constants.
...And 3 more matches
Secure Development Guidelines
validation input validation most vulnerabilities are a result of un-validated input always perform input validation could save you without knowing it examples: if it doesn’t have to be negative, store it in an unsigned int if the input doesn’t have to be > 512, cut it off there if the input should only be [a-za-z0-9], enforce it cross site scripting (xss) xss is a type of code injection attack typically occurs in web applications injection of arbitrary data into an html document from another site victim’s browser executes those html instructions could be used to steal user credentials think: webmail, online auction, cms, online banking...
... bits maximum value that can be represented data type 8 28-1 255 char 16 216-1 65535 short 32 232-1 4294967295 int 64 264-1 18446744073709551615 long long integer overflows/underflows example of an integer overflow int main() { unsigned int foo = 0xffffffff; printf(“foo: 0x%08x\r\n”, foo); foo++; printf(“foo: 0x%08x\r\n”, foo); } integer...
... } integer overflows/underflows: prevention difficult to fix: you need to check every arithmetic operation with user input arithmetic libraries like safeint can help signedness issues bits data type range 8 signed char -128 - +127 unsigned char 0 - +255 16 signed short -32768 - +32767 unsigned short 0 - +65535 32 signed int -2147483648 - +2147483647 unsigned int 0 - +4294967295 64 signed long long -9223372036854775808 - +9223372036854775807 unsigned long long 0 -...
...And 3 more matches
Using the Places annotation service
from c++ you must use the setter for the explicit data type being saved: setpageannotationstring(auri, aname, avalue, aflags, aexpiration); setpageannotationint32(auri, aname, avalue, aflags, aexpiration); setpageannotationint64(auri, aname, avalue, aflags, aexpiration); setpageannotationdouble(auri, aname, avalue, aflags, aexpiration); setpageannotationbinary(auri, aname, adata, adatalen, aflags, aexpiration); and likewise for items in the place...
... is the annotation value", 0, 0); retrieving annotations there are corresponding getters for the setters above (see nsiannotationservice.idl for the exact declarations): from c++: getpageannotationstring(auri, aname); getpageannotationint32(auri, aname); getpageannotationint64(auri, aname); getpageannotationdouble(auri, aname); getpageannotationbinary(auri, aname, adata, adatalen, amimetype); getitemannotationstring(aitemid, aname); getitemannotationint32(aitemid, aname); getitemannotationint64(aitemid, aname); getitemannotationdouble(aitemid, aname); getitemannotationbinary(aitemid, aname, adata, adatalen, amimetype); from javascript: getpageannotation(auri, aname); getitemannotation(aitemid, aname); these functions will return/throw ns_error_not_available if the an...
... the getter functions return only the value of the annotation (with the exception of the c++ getpageannotationbinary and getitemannotationbinary methods which return the mimetype as well).
...And 3 more matches
Finishing the Component
to add the weblock component to this category, modify the weblockregistration callback function so that it looks like this: static ns_method weblockregistration(nsicomponentmanager *acompmgr, nsifile *apath, const char *registrylocation, const char *componenttype, const nsmodulecomponentinfo *info) { nsresult rv; nscomptr<nsiservicemanager> servman = do_queryinterface((nsisupports*)acompmgr, &rv); if (ns_failed(rv)) return rv; nscomptr<nsicategorymanager> catman; servman->getservicebycontractid(ns_categorymanager_contractid, ns_get_iid(nsicategorymanager), ...
...in the weblock component, the shouldload method looks like this: ns_imethodimp weblock::shouldload(print32 contenttype, nsiuri *contentlocation, nsisupports *ctxt, nsidomwindow *window, prbool *_retval) uniform resource locators the method passes in an interface pointer of type nsiuri, which is based on the uniform resource identifier, or uri.
... this type is defined by the world wide web consortium as: the naming scheme of the mechanism used to access the resource.
...And 3 more matches
XPCOM Stream Guide
MozillaTechXPCOMGuideStreams
primitive streams there are streams for several different types of data storage.
... primitive input streams type native class contract id interface how to bind to a data source generic nsstorageinputstream n/a nsiinputstream, nsiseekablestream storagestream.newinputstream(); string (8-bit characters) nsstringstream @mozilla.org/io/string-input-stream;1 nsistringinputstream stream.setdata(data, length); file nsfileinputstream @mozilla.org/network/file-input-stream;1 nsifileinputstream stream.init(file, ioflags, perm, behaviorflags); zip nsjarinputstream n/a nsiinputstream zipreader.getinputstream(zipentry); similarly, each of these implements nsioutputstream.
... primitive output streams type native class contract id interface how to bind to a data target generic nsstoragestream @mozilla.org/storagestream;1 nsistoragestream stream.getoutputstream(); // returns nsioutputstream file nsfileoutputstream @mozilla.org/network/file-output-stream;1 nsifileoutputstream stream.init(file, ioflags, perm, behaviorflags); file nssafefileoutputstream @mozilla.org/network/safe-file-output-stream;1 nsisafefileoutputstream, nsifileoutputstream stream.init(file, ioflags, perm, behaviorflags); channels have streams too any implementation of nsichannel will have an input stream as well, but unless you own the channel, you shouldn't try to read from the input str...
...And 3 more matches
nsIBrowserSearchService
method overview void addengine(in astring engineurl, in long datatype, in astring iconurl, in boolean confirm, [optional] in nsisearchinstallcallback callback); void addenginewithdetails(in astring name, in astring iconurl, in astring alias, in astring description, in astring method, in astring url); void getdefaultengines([optional] out unsigned long enginecount, [retval, array, size_is(enginecount)] out nsisearchengine engines); ...
...g enginecount, [retval, array, size_is(enginecount)] out nsisearchengine engines); void init([optional] in nsibrowsersearchinitobserver observer); void moveengine(in nsisearchengine engine, in long newindex); void removeengine(in nsisearchengine engine); void restoredefaultengines(); attributes attribute type description currentengine nsisearchengine the currently active search engine.
...void addengine( in astring engineurl, in long datatype, in astring iconurl, in boolean confirm, [optional] in nsisearchinstallcallback callback ); parameters engineurl the url to the search engine's description file.
...And 3 more matches
nsIDBChangeListener
the typedef of nsmsgkey is given in mailnewstypes2.idl.
...the typedef of nsmsgkey is given in mailnewstypes2.idl.
...the typedef of nsmsgkey is given in mailnewstypes2.idl.
...And 3 more matches
nsIDOMHTMLSourceElement
attributes attribute type description src domstring the src attribute gives the address of the media resource.
... type domstring the type attribute gives the type of the media resource, to help the user agent determine if it can play this media resource before fetching it.
... if specified, its value must be a valid mime type.
...And 3 more matches
nsIDirIndex
inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description contenttype string the content type; may be null if it is unknown.
... type unsigned long the type of the entry; one of the type_* constants.
... constants constant value description type_unknown 0 the type is unknown.
...And 3 more matches
Building an Account Manager Extension
components.utils.import("resource://gre/modules/xpcomutils.jsm"); //class constructor function devmoaccountmanagerextension() {}; // class definition devmoaccountmanagerextension.prototype = { name : "devmo-account", chromepackagename : "example@mozilla.org", showpanel: function(server) { //this panel is only shown for imap accounts...
... if (server.type == \"imap\") return true; return false; }, queryinterface: xpcomutils.generateqi([ components.interfaces.nsimsgaccountmanagerextension ]) } step 2: building a component we convert the interface to a xpcom component and register it in the component manager as account manager extension.
...devmoaccountmanagerextension.prototype.classid = components.id("{659ce960-9dfb-11dd-ad8b-0800200c9a55}"); // ...
...And 3 more matches
nsIMsgIncomingServer
erlist afilterlist); void setintattribute(in string name, in long value); void setintvalue(in string attr, in long value); void setunicharattribute(in string name, in astring value); void setunicharvalue(in string attr, in astring value); void shutdown(); void storepassword(); astring tostring(); void writetofoldercache(in nsimsgfoldercache foldercache); attributes attribute type description accountmanagerchrome astring read only.
... constructedprettyname astring helper function to construct the pretty name in a server type specific way - for example, mail for foo@test.com, news on news.mozilla.org.
... limitofflinemessagesize boolean localpath nsilocalfile localstoretype acstring the schema for the local mail store, such as "mailbox", "imap", or "news" used to construct uris.
...And 3 more matches
nsINavHistoryFullVisitResultNode
toolkit/components/places/public/nsinavhistoryservice.idlscriptable this interface describes a result from a result_type_full_visit query on the places service.
... this includes more detailed information than the result_type_visit query (which returns nsinavhistoryvisitresultnode, and as such takes more time to look up.
... 1.0 66 introduced gecko 1.9 inherits from: nsinavhistoryvisitresultnode last changed in gecko 1.9 (firefox 3) the information returned in this interface is not commonly used, hence its separation into a separate query type for efficiency.
...And 3 more matches
nsINavHistoryObserver
nsiuri auri, in unsigned long awhat, in astring avalue); void onpageexpired(in nsiuri auri, in prtime avisittime, in boolean awholeentry); obsolete since gecko 2.0 void ontitlechanged(in nsiuri auri, in astring apagetitle); void onvisit(in nsiuri auri, in long long avisitid, in prtime atime, in long long asessionid, in long long areferringid, in unsigned long atransitiontype, in acstring aguid, out unsigned long aadded); constants constant value description attribute_favicon 3 the page's favicon changed.
...note that for typed and hidden pages, the page might not actually have been added yet.
... this needs to be clarified; what are typed and hidden?
...And 3 more matches
nsISelectionPrivate
obsolete since gecko 12.0 long gettableselectiontype(in nsidomrange range); void removeselectionlistener(in nsiselectionlistener listenertoremove); void scrollintoview(in short aregion, in boolean aissynchronous, in short avpercent, in short ahpercent); void setancestorlimiter(in nsicontent acontent); native code only!
... void startbatchchanges(); wstring tostringwithformat(in string formattype, in unsigned long flags, in print32 wrapcolumn); attributes attribute type description cancacheframeoffset boolean frame offset cache can be used just during calling nseditor::endplaceholdertransaction.
... interlineposition boolean type short returns the type of the selection (see nsiselectioncontroller for available constants).
...And 3 more matches
nsISocketTransportService
netwerk/base/public/nsisockettransportservice.idlscriptable this interface provides a mapping between a socket type and its associated socket provider instance.
... nsisockettransport createtransport(in array<acstring> asockettypes, in autf8string ahost, in long aport, in nsiproxyinfo aproxyinfo); void init(); obsolete since gecko 1.8 void notifywhencanattachsocket(in nsirunnable aevent); native code only!
... void shutdown(); obsolete since gecko 1.8 attributes attribute type description autodialenabled boolean controls whether or not the socket transport service should poke the autodialer on connection failure.
...And 3 more matches
nsIUploadChannel
inherits from: nsisupports last changed in gecko 1.7 method overview void setuploadstream(in nsiinputstream astream, in acstring acontenttype, in long acontentlength); attributes attribute type description uploadstream nsiinputstream get the stream (to be) uploaded by this channel.
... history here is that we need to support both streams that already have headers (for example, content-type and content-length) information prepended to the stream (by plugins) as well as clients (composer, uploading application) that want to upload data streams without any knowledge of protocol specifications.
... for this reason, we have a special meaning for the acontenttype parameter.
...And 3 more matches
nsIWebProgressListener
state type flags these flags further describe the entity for which the state transition is occurring.
...(see below for a description of document requests.) other types of requests, such as requests for inline content (for example images and stylesheets) are considered normal requests.
...this flag is accompanied by either state_start or state_stop, and it may be combined with other state type flags.
...And 3 more matches
Examples
these examples demonstrate how to use js-ctypes.
... general using c struct and pointers an example on how to use basic c data types with js-ctypes.
... using objective-c from js-ctypes an example how to use objective-c from js-ctypes, by converting objective-c code into c code.
...And 3 more matches
Initialization and Destruction - Plugins
during initialization, when the browser encounters data of a mime type registered for a plug-in (either embedded in an html page or in a separate file), it loads the plug-in code into memory (if it hasn't been loaded already) and creates a new instance of the plug-in.
...more than one instance of the same plug-in can exist if a single page contains multiple embedded plug-ins, or if several browser windows are open and display the same data type.
...npp_new informs the plug-in of the creation of a new instance with the specified mime type.
...And 3 more matches
Accessibility Inspector - Firefox Developer Tools
this can mean different things depending on the type of the item; for example, a form input (role: entry) would have a value of whatever is entered in the input, whereas a link's value would be the url in the corresponding <a> element's href.
... domnode — the type of dom node that the item in the accessibility tree represents.
...the available menu items include: none — don't show the possible list of issues all issues — check for all types of issues contrast — check for issues with visual contrast keyboard — check for issues with navigating via a keyboard text labels — check for issues with missing text labels when you one of the menu items, firefox scans your document for the type of issues you selected.
...And 3 more matches
Debugger.Environment - Firefox Developer Tools
spidermonkey creates debugger.environment instances as needed as the debugger inspects stack frames and function objects; calling debugger.environment as a function or constructor raises a typeerror exception.
... 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.
... type the type of this environment object, one of the following values: “declarative”, indicating that the environment is a declarative environment record.
...And 3 more matches
Debugger.Source - Firefox Developer Tools
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".
... accessor properties of the debugger.source prototype object a debugger.source instance inherits the following accessor properties from its prototype: text if the instance refers to javascript source, the javascript source code, as a string.
...for function.prototype’s script, this is null.
...And 3 more matches
BlobBuilder - Web APIs
method overview void append(in arraybuffer data); void append(in blob data); void append(in string data, [optional] in string endings); blob getblob([optional] in domstring contenttype); file getfile(in domstring name, [optional] in domstring contenttype); methods append() appends the contents of the specified javascript object to the blob being built.
... blob getblob( in domstring contenttype optional ); parameters contenttype optional the mime type of the data to be returned in the blob.
... this will be the value of the blob object's type property.
...And 3 more matches
CSSRule - Web APIs
WebAPICSSRule
there are several types of rules, listed in the type constants section below.
... the cssrule interface specifies the properties common to all rules, while properties unique to specific rule types are specified in the more specialized interfaces for those rules' respective types.
...the value of "font-size" in the example) use the properties on the specialized interface for the rule's type.
...And 3 more matches
Applying styles and colors - Web APIs
linecap = type sets the appearance of the ends of lines.
... linejoin = type sets the appearance of the "corners" where lines meet.
...25 : -25; ctx.lineto(math.pow(i, 1.5) * 2, 75 + dy); } ctx.stroke(); return false; } <table> <tr> <td><canvas id="canvas" width="150" height="150"></canvas></td> <td>change the <code>miterlimit</code> by entering a new value below and clicking the redraw button.<br><br> <form onsubmit="return draw();"> <label>miter limit</label> <input type="number" size="3" id="miterlimit"/> <input type="submit" value="redraw"/> </form> </td> </tr> </table> document.getelementbyid('miterlimit').value = document.getelementbyid('canvas').getcontext('2d').miterlimit; draw(); screenshotlive sample using line dashes the setlinedash method and the linedashoffset property specify the dash pattern for lines.
...And 3 more matches
CharacterData - Web APIs
this is an abstract interface, meaning there aren't any object of type characterdata: it is implemented by other interfaces, like text, comment, or processinginstruction which aren't abstract.
...#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="331" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">characterdata</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, node, and implements the childnode and nondocumenttypechildnode interface.
... nondocumenttypechildnode.nextelementsibling read only returns the element immediately following the specified one in its parent's children list, or null if the specified element is the last one in the list.
...And 3 more matches
ContentIndex.add() - Web APIs
WebAPIContentIndexadd
type: optional the mime type of the image.
... return value returns a promise that resolves with undefined exceptions typeerror if the service worker's registration is not present or the service worker does not contain a fetchevent.
... if the id, title, description or url are missing, not of type string, or an empty string.
...And 3 more matches
Document.getElementById() - Web APIs
example <!doctype html> <html> <head> <meta charset="utf-8"> <title>document</title> </head> <body> <div id="parent-id"> <p>hello word1</p> <p id="test1">hello word2</p> <p>hello word3</p> <p>hello word4</p> </div> <script> var parentdom = document.getelementbyid('parent-id'); var test1 = parentdom.getelementbyid('test1'); //throw error ...
... //uncaught typeerror: parentdom.getelementbyid is not a function </script> </body> </html> if there is no element with the given id, this function returns null.
...the dom implementation must have information that says which attributes are of type id.
...And 3 more matches
Document - Web APIs
WebAPIDocument
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.
... document.contenttype read only returns the content-type from the mime header of the current document.
...And 3 more matches
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
take the following minimal example: <!doctype html> <h1> hello world!
... </h1> this source code contains a couple of line feeds after the doctype and a bunch of space characters before, after, and inside the <h1> element, but the browser doesn’t seem to care at all and just shows the words "hello world!" as if these characters didn’t exist at all: this is so that whitespace characters don't impact the layout of your page.
... take the following document, for example: <!doctype html> <html> <head> <title>my document</title> </head> <body> <h1>header</h1> <p> paragraph </p> </body> </html> the dom tree for this looks like so: conserving whitespace characters in the dom is useful in many ways, but there are certain places where this makes certain layouts more difficult to implement, and causes problems for developers who want to iterate through nodes in t...
...And 3 more matches
HTMLCanvasElement.toBlob() - Web APIs
if type is not specified, the image type is image/png.
... syntax canvas.toblob(callback, mimetype, qualityargument); parameters callback a callback function with the resulting blob object as a single argument.
... mimetype optional a domstring indicating the image format.
...And 3 more matches
HTMLFormElement - Web APIs
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.
... elements that are considered form controls the elements included by htmlformelement.elements and htmlformelement.length are the following: <button> <fieldset> <input> (with the exception that any whose type is "image" are omitted for historical reasons) <object> <output> <select> <textarea> no other elements are included in the list returned by elements, which makes it an excellent way to get at the elements most important when processing forms.
...ody f.action = "/cgi-bin/some.cgi"; // add action and method attributes f.method = "post"; f.submit(); // call the form's submit() method extract information from a <form> element and set some of its attributes: <form name="forma" action="/cgi-bin/test" method="post"> <p>press "info" for form details, or "set" to change those details.</p> <p> <button type="button" onclick="getforminfo();">info</button> <button type="button" onclick="setforminfo(this.form);">set</button> <button type="reset">reset</button> </p> <textarea id="form-info" rows="15" cols="20"></textarea> </form> <script> function getforminfo(){ // get a reference to the form via its name var f = document.forms["forma"]; // the form properties we're interested in ...
...And 3 more matches
MediaSource.addSourceBuffer() - Web APIs
the addsourcebuffer() method of the mediasource interface creates a new sourcebuffer of the given mime type and adds it to the mediasource's sourcebuffers list.
... syntax var sourcebuffer = mediasource.addsourcebuffer(mimetype); parameters mimetype a domstring specifying the mime type of the sourcebuffer to create and add to the mediasource.
... exceptions invalidaccesserror the value specified for mimetype is an empty string rather than a valid mime type.
...And 3 more matches
MediaStream Recording API - Web APIs
create a mediarecorder object, specifying the source stream and any desired options (such as the container's mime type or the desired bit rates of its tracks).
...var stream = canvas.capturestream(25); var recordedchunks = []; console.log(stream); var options = { mimetype: "video/webm; codecs=vp9" }; mediarecorder = new mediarecorder(stream, options); mediarecorder.ondataavailable = handledataavailable; mediarecorder.start(); function handledataavailable(event) { console.log("data-available"); if (event.data.size > 0) { recordedchunks.push(event.data); console.log(recordedchunks); download(); } else { // ...
... } } function download() { var blob = new blob(recordedchunks, { type: "video/webm" }); var url = url.createobjecturl(blob); var a = document.createelement("a"); document.body.appendchild(a); a.style = "display: none"; a.href = url; a.download = "test.webm"; a.click(); window.url.revokeobjecturl(url); } // demo: to download after 9sec settimeout(event => { console.log("stopping"); mediarecorder.stop(); }, 9000); examining and controlling the recorder status you can also use the properties of the mediarecorder object to determine the state of the recording process, and its pause() and resume() methods to pause and resume recording of the source media.
...And 3 more matches
Performance - Web APIs
an object of this type can be obtained by calling the window.performance read-only attribute.
... performance.clearresourcetimings() removes all performance entries with a entrytype of "resource" from the browser's performance data buffer.
... performance.getentriesbyname() returns a list of performanceentry objects based on the given name and entry type.
...And 3 more matches
PerformanceNavigation - Web APIs
an object of this type can be obtained by calling the performance.navigation read-only attribute.
... performancenavigation.type read only an unsigned short which indicates how the navigation to this page was done.
... possible values are: type_navigate (0) the page was accessed by following a link, a bookmark, a form submission, or a script, or by typing the url in the address bar.
...And 3 more matches
PointerEvent - Web APIs
the pointerevent interface represents the state of a dom event produced by a pointer such as the geometry of the contact point, the device type that generated the event, the amount of pressure that was applied on the contact surface, etc.
... pointerevent.pointertype read only indicates the device type that caused the event (mouse, pen, touch, etc.) pointerevent.isprimary read only indicates if the pointer represents the primary pointer of this pointer type.
... pointer event types the pointerevent interface has several event types.
...And 3 more matches
RTCIceCandidate - Web APIs
the permitted values are listed in the rtcicecomponent enumerated type.
... foundation read only returns a domstring containing a unique identifier that is the same for any candidates of the same type, share the same base (the address from which the ice agent sent the candidate), and come from the same stun server.
...the string is one of those in the enumerated type rtciceprotocol.
...And 3 more matches
RTCRemoteOutboundRtpStreamStats.localId - Web APIs
thus, if an rtcstatsreport includes an remote-outbound-rtp statistics object (of type rtcremoteoutboundrtpstreamstats), it should also have a corresponding inbound-rtp object.
... finding paired statistics each statistics record of type remote-outbound-rtp (describing a remote peer's statistics about sending data to the local peer) has a corresponding record of type inbound-rtp which describes the local peer's perspective on the same data being moved between the two peers.
... async function networkteststop(pc) { if (pc) { let statsbox = document.queryselector(".stats-box"); let endreport = await pc.getstats(); for (let endremoteoutbound of endreport.values()) { if (endremoteoutbound.type === "remote-outbound-rtp") { let startremoteoutbound = startreport.get(endremoteoutbound.id); if (startremoteoutbound) { let startinboundstats = findreportentry(startreport, "remoteid", startremoteoutbound.id); let endinboundstats = findreportentry(endreport, "remoteid", endremoteoutbound.id); let elapsedtime = (endremoteoutbound.timestamp - startre...
...And 3 more matches
SVGPreserveAspectRatio - Web APIs
tratio_xmidymax = 9 svg_preserveaspectratio_xmaxymax = 10 svg_meetorslice_unknown = 0 svg_meetorslice_meet = 1 svg_meetorslice_slice = 2 normative document svg 1.1 (2nd edition) constants name value description svg_preserveaspectratio_unknown 0 the enumeration was set to a value that is not one of predefined types.
... 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_meetorslice_unknown 0 the enumeration was set to a value that is not one of predefined types.
...And 3 more matches
Using server-sent events - Web APIs
sending events from the server the server-side script that sends events needs to respond using the mime type text/event-stream.
... the php code for the example we're using here follows: date_default_timezone_set("america/new_york"); header("cache-control: no-cache"); header("content-type: text/event-stream"); $counter = rand(1, 10); while (true) { // every second, send a "ping" event.
..."\n\n"; $counter = rand(1, 10); } ob_end_flush(); flush(); sleep(1); } the code above generates an event every second, with the event type "ping".
...And 3 more matches
WebGLRenderingContext.getActiveUniform() - Web APIs
the webglrenderingcontext.getactiveuniform() method of the webgl api returns a webglactiveinfo object containing size, type, and name of a uniform attribute.
... the type attribute of the return value will be one of the following: gl.float gl.float_vec2 gl.float_vec3 gl.float_vec4 gl.int gl.int_vec2 gl.int_vec3 gl.int_vec4 gl.bool gl.bool_vec2 gl.bool_vec3 gl.bool_vec4 gl.float_mat2 gl.float_mat3 gl.float_mat4 gl.sampler_2d gl.sampler_cube when using a webgl 2 context, the following values are possible additionally: gl.unsigned_int gl.
...webgl generates one or more entries in the list depending on the declared type of the uniform in the shader: single basic type: one entry with the name of the uniform.
...And 3 more matches
Matrix math for the web - Web APIs
matrices can be used to represent transformations of objects in space, and are used for performing many key types of computation when constructing images and visualizing data on the web.
... this article explores how to create matrices and how to use them with css transforms and the matrix3d transform type.
... transformation matrices there are many types of matrices, but the ones we are interested in are the 3d transformation matrices.
...And 3 more matches
Adding 2D content to a WebGL context - Web APIs
let's take a quick look at the two types of shader, with the example in mind of drawing a 2d shape into the webgl context.
...the code below creates the two shaders by calling loadshader(), passing the type and source for the shader.
...ogram, vertexshader); gl.attachshader(shaderprogram, fragmentshader); gl.linkprogram(shaderprogram); // if creating the shader program failed, alert if (!gl.getprogramparameter(shaderprogram, gl.link_status)) { alert('unable to initialize the shader program: ' + gl.getprograminfolog(shaderprogram)); return null; } return shaderprogram; } // // creates a shader of the given type, uploads the source and // compiles it.
...And 3 more matches
Starting up and shutting down a WebXR session - Web APIs
confirming the session type you need is available before trying to create a new webxr session, it's often wise to first check to see if the user's hardware and software support the presentation mode you wish to use.
...this returns a promise which resolves to true if the given type of session is available for use or false otherwise.
...this string specifies the type of webxr session you want to establish—in this case, a fully-immersive virtual reality experience.
...And 3 more matches
Controlling multiple parameters with ConstantSourceNode - Web APIs
the solution is simple, and it involves using an audio node type which, at first glance, doesn't look all that useful: constantsourcenode.
... html the html content for this example is primarily a button to toggle the oscillator tones on and off and an <input> element of type range to control the volume of two of the three oscillators.
... <div class="controls"> <div class="left"> <div id="playbutton" class="button"> ▶️ </div> </div> <div class="right"> <span>volume: </span> <input type="range" min="0.0" max="1.0" step="0.01" value="0.8" name="volume" id="volumecontrol"> </div> </div> <p>use the button above to start and stop the tones, and the volume control to change the volume of the notes e and g in the chord.</p> css .controls { width: 400px; position: relative; vertical-align: middle; height: 44px; } .button { font-size: 32px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -o-user-select: none; } .right { width: 50%; font: 14px "open sans", "lucida grande", "arial", sans-serif; positi...
...And 3 more matches
ARIA: grid role - Accessibility
y td[role="gridcell"]:hover, tbody td[role="gridcell"]:focus { background-color: #f6f6f6; outline: 3px solid blue; } } javascript var selectables = document.queryselectorall('table td[role="gridcell"]'); selectables[0].setattribute('tabindex', 0); var trs = document.queryselectorall('table tbody tr'), row = 0, col = 0, maxrow = trs.length - 1, maxcol = 0; array.prototype.foreach.call(trs, function(gridrow, i){ array.prototype.foreach.call(gridrow.queryselectorall('td'), function(el, i){ el.dataset.row = row; el.dataset.col = col; col = col + 1; }); if (col>maxcol) { maxcol = col - 1; } col = 0; row = row + 1; }); function moveto(newrow, newcol) { var tgt = document.queryselector('[data-row="' + newrow + '"][data-col="' + newcol + '"]'); ...
... if (tgt && (tgt.getattribute('role')==='gridcell') ) { array.prototype.foreach.call(document.queryselectorall('[role=gridcell]'), function(el, i){ el.setattribute('tabindex', '-1'); }); tgt.setattribute('tabindex', '0'); tgt.focus(); return true; } else { return false; } } document.queryselector('table').addeventlistener("keydown", function(event) { switch (event.key) { case "arrowright": moveto(parseint(event.target.dataset.row, 10), parseint(event.target.dataset.col, 10) + 1); break; case "arrowleft": moveto(parseint(event.target.dataset.row, 10), parseint(event.target.dataset.col, 10) - 1); break; case "arrowdown": moveto(parseint(event.target.dataset.row, 10) + 1, parseint(event.target.dataset.col, 10)); ...
...ent.ctrlkey) { var i = maxrow; var result; do { var j = maxcol; do { result = moveto(i, j); j--; } while (result == false); i--; } while (result == false); } else { moveto(parseint(event.target.dataset.row, 10), document.queryselector('[data-row="' + event.target.dataset.row + '"]:last-of-type').dataset.col); } break; case "pageup": var i = 0; var result; do { result = moveto(i, event.target.dataset.col); i++; } while (result == false); break; case "pagedown": var i = maxrow; var result; do { result = moveto(i, event.target.dataset.col); i--; } while (result == false); break;...
...And 3 more matches
Text labels and names - Accessibility
there are a number of different types of problems in this category, found in different contexts, and each has its own solution.
... examples <form> <fieldset> <legend>choose your favorite monster</legend> <input type="radio" id="kraken" name="monster"> <label for="kraken">kraken</label><br/> <input type="radio" id="sasquatch" name="monster"> <label for="sasquatch">sasquatch</label><br/> <input type="radio" id="mothman" name="monster"> <label for="mothman">mothman</label> </fieldset> </form> you can see a live, interactive version of this example on the <fieldset> reference page.
...this applies to all types of <input> items, as well as <button>, <output>, <select>, <textarea>, <progress> and <meter> elements, as well as any element with the switch aria role.
...And 3 more matches
font-feature-settings - CSS: Cascading Style Sheets
the font-feature-settings css property controls advanced typographic features in opentype fonts.
... syntax /* use the default settings */ font-feature-settings: normal; /* set values for opentype feature tags */ font-feature-settings: "smcp"; font-feature-settings: "smcp" on; font-feature-settings: "swsh" 2; font-feature-settings: "smcp", "swsh" 2; /* global values */ font-feature-settings: inherit; font-feature-settings: initial; font-feature-settings: unset; whenever possible, web authors should instead use the font-variant shorthand property or an associated longhand property such as font-variant-ligatures, font-variant-caps, font-variant-east-asian, font-vari...
... these lead to more effective, predictable, understandable results than font-feature-settings, which is a low-level feature designed to handle special cases where no other way exists to enable or access an opentype font feature.
...And 3 more matches
font-language-override - CSS: Cascading Style Sheets
the font-language-override css property controls the use of language-specific glyphs in a typeface.
...for example, a lot of fonts have a special character for the digraph fi that merge the dot on the "i" with the "f." however, if the language is set to turkish the typeface will likely know not to use the merged glyph; turkish has two versions of the "i," one with a dot (i) and one without (ı), and using the ligature would incorrectly transform a dotted "i" into a dotless "i." the font-language-override property lets you override the typeface behavior for a specific language.
... this is useful, for example, when the typeface you're using lacks proper support for the language.
...And 3 more matches
font-variant-ligatures - CSS: Cascading Style Sheets
they correspond to the opentype values liga and clig.
... <discretionary-lig-values> these values control specific ligatures, specific to the font and defined by the type designer.
... they correspond to the opentype values dlig.
...And 3 more matches
Creating a cross-browser video player - Developer guides
<figure id="videocontainer"> <video id="video" controls preload="metadata" poster="img/poster.jpg"> <source src="video/tears-of-steel-battle-clip-medium.mp4" type="video/mp4"> <source src="video/tears-of-steel-battle-clip-medium.webm" type="video/webm"> <source src="video/tears-of-steel-battle-clip-medium.ogg" type="video/ogg"> <!-- flash fallback --> <object type="application/x-shockwave-flash" data="flash-player.swf?videourl=video/tears-of-steel-battle-clip-medium.mp4" width="1024" height="576"> <param name="movie" value=...
... once again the html is quite straightforward, using an unordered list with list-style-type:none set to enclose the controls, each of which is a list item with float:left.
... <ul id="video-controls" class="controls"> <li><button id="playpause" type="button">play/pause</button></li> <li><button id="stop" type="button">stop</button></li> <li class="progress"> <progress id="progress" value="0" min="0"> <span id="progress-bar"></span> </progress> </li> <li><button id="mute" type="button">mute/unmute</button></li> <li><button id="volinc" type="button">vol+</button></li> <li><button id="voldec" type="button">vol-</button></...
...And 3 more matches
Audio and video manipulation - Developer guides
html we can set up our video player and <canvas> element like this: <video id="my-video" controls="true" width="480" height="270" crossorigin="anonymous"> <source src="https://udn.realityripple.com/samples/5b/8cd6da9c65.webm" type="video/webm"> <source src="https://udn.realityripple.com/samples/6f/08625b424a.m4v" type="video/mp4"> </video> <canvas id="my-canvas" width="480" height="270"></canvas> javascript this code handles altering the frames.
... html <video id="my-video" controls src="https://udn.realityripple.com/samples/6f/08625b424a.m4v"> </video> javascript var myvideo = document.getelementbyid('my-video'); myvideo.playbackrate = 2; playable code <video id="my-video" controls="true" width="480" height="270"> <source src="https://udn.realityripple.com/samples/5b/8cd6da9c65.webm" type="video/webm"> <source src="https://udn.realityripple.com/samples/6f/08625b424a.m4v" type="video/mp4"> </video> <div class="playable-buttons"> <input id="edit" type="button" value="edit" /> <input id="reset" type="button" value="reset" /> </div> <textarea id="code" class="playable-code"> var myvideo = document.getelementbyid('my-video'); myvideo.playbackrate = 2;</textarea> var textarea = ...
... use this web audio node type an audio track from an html <audio> or <video> element mediaelementaudiosourcenode a plain raw audio data buffer in memory audiobuffersourcenode an oscillator generating a sine wave or other computed waveform oscillatornode an audio track from webrtc (such as the microphone input you can get using getusermedia().
...And 3 more matches
The Web Open Font Format (WOFF) - Developer guides
WebGuideWOFF
woff (the web open font format) is a web font format developed by mozilla in concert with type supply, letterror, and other organizations.
... it uses a compressed version of the same table-based sfnt structure used by truetype, opentype, and open font format, but adds metadata and private-use data structures, including predefined fields allowing foundries and vendors to provide license information if desired.
... there are three main benefits to using woff: the font data is compressed, so sites using woff will use less bandwidth and will load faster than if they used equivalent uncompressed truetype or opentype files.
...And 3 more matches
HTML attribute: pattern - HTML: Hypertext Markup Language
the pattern attribute is an attribute of the text, tel, email, url, password, and search input types.
...it must be a valid javascript regular expression, as used by the regexp type, and as documented in our guide on regular expressions; the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of unicode code points, instead of as ascii.
... some of the input types supporting the pattern attribute, notably the email and url input types, have expected value syntaxes that must be matched.
...And 3 more matches
HTML attribute: readonly - HTML: Hypertext Markup Language
the readonly attribute is supported by text, search, url, tel, email, password, date, month, week, time, datetime-local, and number<input> types and the <textarea> form control elements.
... if present on any of these input types and elements, the :read-only pseudo class will match.
... the attribute is not supported or relevant to <select> or input types that are already not mutable, such as checkbox and radio or cannot, by definition, start with a value, such as the file input type.
...And 3 more matches
HTML attribute: required - HTML: Hypertext Markup Language
the required attribute is supported by text, search, url, tel, email, password, date, month, week, time, datetime-local, number, checkbox, radio, file, <input> types along with the <select> and <textarea> form control elements.
... if present on any of these input types and elements, the :required pseudo class will match.
...nor is it supported on any of the button types, including image.
...And 3 more matches
<menu> - HTML: Hypertext Markup Language
WebHTMLElementmenu
type this attribute indicates the kind of menu being declared, and can be one of two values.
...type 'list' is likely to change to 'toolbar' according to html5.1.
... examples context menu html <!-- a <div> element with a context menu --> <div contextmenu="popup-menu"> right-click to see the adjusted context menu </div> <menu type="context" id="popup-menu"> <menuitem>action</menuitem> <menuitem>another action</menuitem> <hr/> <menuitem>separated action</menuitem> </menu> css div { width: 300px; height: 80px; background-color: lightgreen; } result menu button menu buttons haven't been implemented in any known browsers yet.
...And 3 more matches
<object> - HTML: Hypertext Markup Language
WebHTMLElementobject
codetypehtml 4 onlyobsolete since html5 the content type of the data specified by classid.
...at least one of data and type must be defined.
... type the content type of the resource specified by data.
...And 3 more matches
<ol>: The Ordered List element - HTML: Hypertext Markup Language
WebHTMLElementol
always an arabic numeral (1, 2, 3, etc.), even when the numbering type is letters or roman numerals.
... type sets the numbering type: a for lowercase letters a for uppercase letters i for lowercase roman numerals i for uppercase roman numerals 1 for numbers (default) the specified type is used for the entire list unless a different type attribute is used on an enclosed <li> element.
... note: unless the type of the list number matters (like legal or technical documents where items are referenced by their number/letter), use the css list-style-type property instead.
...And 3 more matches
<style>: The Style Information element - HTML: Hypertext Markup Language
WebHTMLElementstyle
type this attribute defines the styling language as a mime type (charset should not be specified).
... examples a simple stylesheet in the following example, we apply a very simple stylesheet to a document: <!doctype html> <html> <head> <style> p { color: red; } </style> </head> <body> <p>this is my paragraph.</p> </body> </html> multiple style elements in this example we've included two <style> elements — notice how the conflicting declarations in the later <style> element override those in the earlier one, if they have equal specificity.
... <!doctype html> <html> <head> <style> p { color: white; background-color: blue; padding: 5px; border: 1px solid black; } </style> <style> p { color: blue; background-color: yellow; } </style> </head> <body> <p>this is my paragraph.</p> </body> </html> including a media query in this example we build on the previous one, including a media attribute on the second <style> element so it is only applied when the viewport is less than 500px in width.
...And 3 more matches
Microformats - HTML: Hypertext Markup Language
these top-level root classes usually indicate a type and corresponding expected vocabulary of properties.
... p-street-address street number + name p-locality city/town/village p-country-name country name nested h-card example <div class="h-card"> <a class="p-name u-url" href="http://blog.lizardwrangler.com/" >mitchell baker</a> (<a class="p-org h-card" href="http://mozilla.org/" >mozilla foundation</a>) </div> parsed json: { "items": [{ "type": ["h-card"], "properties": { "name": ["mitchell baker"], "url": ["http://blog.lizardwrangler.com/"], "org": [{ "value": "mozilla foundation", "type": ["h-card"], "properties": { "name": ["mozilla foundation"], "url": ["http://mozilla.org/"] } }] } }] } note: the nested h-card has implied 'name' and 'url' properties, just like any other root-cla...
...is microformats resource</p> <p> <a href="https://quickthoughts.jgregorymcverry.com/profile/jgmac1106">greg mcverry</a> published this <a class="u-url url" href="https://quickthoughts.jgregorymcverry.com/2019/05/31/hey-thanks-for-making-this-microformats-resource"><time class="dt-published" datetime="2019-05-31t14:19:09+0000">31 may 2019</time></a></p> </div> { "items": [ { "type": [ "h-entry" ], "properties": { "in-reply-to": [ "/docs/web/html/microformats" ], "name": [ "hey thanks for making this microformats resource" ], "url": [ "https://quickthoughts.jgregorymcverry.com/2019/05/31/hey-thanks-for-making-this-microformats-resource" ], "published": [ "2019-05-31t14:19:09+0000" ], "content": [ { "html": ...
...And 3 more matches
Evolution of HTTP - HTTP
<html> a very simple html page </html> unlike subsequent evolutions, there were no http headers, meaning that only html files could be transmitted, but no other type of documents.
... with the help of the new http headers, the ability to transmit other documents than plain html files has been added (thanks to the content-type header).
... at this point, a typical request and response looked like this: get /mypage.html http/1.0 user-agent: ncsa_mosaic/2.0 (windows 3.1) 200 ok date: tue, 15 nov 1994 08:12:31 gmt server: cern/3.0 libwww/2.17 content-type: text/html <html> a page with an image <img src="/myimage.gif"> </html> followed by a second connection and request to fetch the image (followed by a response to that request): get /myimage.gif http/1.0 user-agent: ncsa_mosaic/2.0 (windows 3.1) 200 ok date: tue, 15 nov 1994 08:12:32 gmt server: cern/3.0 libwww/2.17 content-type: text/gif (image content) these novelties have not been introduced as concerted effort, but as a try-and-see approach over the 1991-1995 period: a server and a browser added one feature and it saw if it got traction.
...And 3 more matches
Configuring servers for Ogg media - HTTP
this information may also be useful if you encounter other media types your server isn't already configured to recognize.
... serve media with the correct mime type *.ogg and *.ogv files containing video (possibly with an audio track as well, of course), should be served with the video/ogg mime type.
... *.oga and *.ogg files containing only audio should be served with the audio/ogg mime type.
...And 3 more matches
POST - HTTP
WebHTTPMethodsPOST
the type of the body of the request is indicated by the content-type header.
...in this case, the content type is selected by putting the adequate string in the enctype attribute of the <form> element or the formenctype attribute of the <input> or <button> elements: application/x-www-form-urlencoded: the keys and values are encoded in key-value tuples separated by '&', with a '=' between the key and the value.
... non-alphanumeric characters in both keys and values are percent encoded: this is the reason why this type is not suitable to use with binary data (use multipart/form-data instead) multipart/form-data: each value is sent as a block of data ("body part"), with a user agent-defined delimiter ("boundary") separating each part.
...And 3 more matches
A typical HTTP session - HTTP
WebHTTPSession
an absolute url without the protocol or domain name the http protocol version subsequent lines represent an http header, giving the server information about what type of data is appropriate (e.g., what language, what mime types), or other data altering its behavior (e.g., not sending an answer if it is already cached).
... for example, sending the result of a form: post /contact_form.php http/1.1 host: developer.mozilla.org content-length: 64 content-type: application/x-www-form-urlencoded name=joe%20user&request=send%20me%20one%20of%20your%20catalogue request methods http defines a set of request methods indicating the desired action to be performed upon a resource.
...type, data size, compression algorithm used, hints about caching).
...And 3 more matches
CSS Houdini
houdini's css typed om is a css object model with types and methods, exposing values as javascript objects making for more intuitive css manipulation than previous string based htmlelement.style manipulations.
... css parser api an api exposing the css parser more directly, for parsing arbitrary css-like languages into a mildly typed representation.
...properties registered using this api are provided with a parse syntax that defines a type, inheritance behaviour, and an initial value.
...And 3 more matches
InternalError - JavaScript
instance properties internalerror.prototype.message error message.
... internalerror.prototype.name error name.
... internalerror.prototype.filename path to file that raised this error.
...And 3 more matches
Intl.DisplayNames - JavaScript
instance methods intl.displaynames.prototype.of() this method receives a code and returns a string based on the locale and options provided when instantiating intl.displaynames.
... intl.displaynames.prototype.resolvedoptions() returns a new object with properties reflecting the locale and formatting options computed during initialization of the object.
... // get display names of region in english let regionnames = new intl.displaynames(['en'], {type: 'region'}); regionnames.of('419'); // "latin america" regionnames.of('bz'); // "belize" regionnames.of('us'); // "united states" regionnames.of('ba'); // "bosnia & herzegovina" regionnames.of('mm'); // "myanmar (burma)" // get display names of region in traditional chinese regionnames = new intl.displaynames(['zh-hant'], {type: 'region'}); regionnames.of('419'; // "拉丁美洲" regionnames.of('bz'); // "貝里斯" regionnames.of('us'); // "美國" regionnames.of('ba'); // "波士尼亞與赫塞哥維納" regionnames.of('mm'); // "緬甸" language display names to ...
...And 3 more matches
Promise - JavaScript
as the promise.prototype.then() and promise.prototype.catch() methods return promises, they can be chained.
... the signatures of these two functions are simple, they accept a single parameter of any type.
... instance methods promise.prototype.catch() appends a rejection handler callback to the promise, and returns a new promise resolving to the return value of the callback if it is called, or to its original fulfillment value if the promise is instead fulfilled.
...And 3 more matches
WeakSet - JavaScript
they cannot contain arbitrary values of any type, as sets can.
... weaksets are ideal for this purpose: // execute a callback on everything stored inside an object function execrecursively(fn, subject, _refs = null){ if(!_refs) _refs = new weakset(); // avoid infinite recursion if(_refs.has(subject)) return; fn(subject); if("object" === typeof subject){ _refs.add(subject); for(let key in subject) execrecursively(fn, subject[key], _refs); } } const foo = { foo: "foo", bar: { bar: "bar" } }; foo.bar.baz = foo; // circular reference!
... instance methods weakset.prototype.add(value) appends value to the weakset object.
...And 3 more matches
Equality (==) - JavaScript
unlike the strict equality operator, it attempts to convert and compare operands that are of different types.
... if the operands are of different types, try to convert them to the same type before comparing: when comparing a number to a string, try to convert the string to a numeric value.
... if the operands have the same type, they are compared as follows: string: return true only if both operands have the same characters in the same order.
...And 3 more matches
this - JavaScript
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.
... function bar() { console.log(object.prototype.tostring.call(this)); } bar.call(7); // [object number] bar.call('foo'); // [object string] bar.call(undefined); // [object global] the bind method ecmascript 5 introduced function.prototype.bind().
... o.b = {g: independent, prop: 42}; console.log(o.b.g()); // 42 this on the object's prototype chain the same notion holds true for methods defined somewhere on the object's prototype chain.
...And 3 more matches
for...of - JavaScript
the for...of statement creates a loop iterating over iterable objects, including: built-in string, array, array-like objects (e.g., arguments or nodelist), typedarray, map, set, and user-defined iterables.
... const iterable = [10, 20, 30]; for (let value of iterable) { value += 1; console.log(value); } // 11 // 21 // 31 iterating over a string const iterable = 'boo'; for (const value of iterable) { console.log(value); } // "b" // "o" // "o" iterating over a typedarray const iterable = new uint8array([0x00, 0xff]); for (const value of iterable) { console.log(value); } // 0 // 255 iterating over a map const iterable = new map([['a', 1], ['b', 2], ['c', 3]]); for (const entry of iterable) { console.log(entry); } // ['a', 1] // ['b', 2] // ['c', 3] for (const [key, value] of iterable) { console.log(value); } // 1 // 2 // 3 iterating over a set...
...into a javascript function: (function() { for (const argument of arguments) { console.log(argument); } })(1, 2, 3); // 1 // 2 // 3 iterating over a dom collection iterating over dom collections like nodelist: the following example adds a read class to paragraphs that are direct descendants of an article: // note: this will only work in platforms that have // implemented nodelist.prototype[symbol.iterator] const articleparagraphs = document.queryselectorall('article > p'); for (const paragraph of articleparagraphs) { paragraph.classlist.add('read'); } closing iterators in for...of loops, abrupt iteration termination can be caused by break, throw or return.
...And 3 more matches
<maction> - MathML
the action itself is specified by the actiontype attribute, which accepts several values.
... attributes actiontype the action which specifies what happens for this element.
...the syntax is: <maction actiontype="statusline"> expression message </maction>.
...And 3 more matches
Navigation and resource timings - Web Performance
you can also create marks: performance.getentriesbytype('navigation').foreach((navigation) => { console.dir(navigation); }); performance.getentriesbytype('resource').foreach((resource) => { console.dir(resource); }); performance.getentriesbytype('mark').foreach((mark) => { console.dir(mark); }); performance.getentriesbytype("measure").foreach((measure) => { console.dir(measure); }); performance.getentriesbytype('paint').foreach((paint) => ...
...{ console.dir(paint); }); performance.getentriesbytype('frame').foreach((frame) => { console.dir(frame); }); in supporting browsers, you can use performance.getentriesbytype('paint') to query the measure for first-paint and first-contentful-paint.
... we use performance.getentriesbytype('navigation') and performance.getentriesbytype('resource') to query the navigation and resource timings respectively.
...And 3 more matches
The building blocks of responsive design - Progressive web apps (PWAs)
we've written a simple-but-fun prototype for an application called snapshot, which takes a video stream from your webcam (using getusermedia()) then allows you to capture stills from that video stream (using html5 <canvas>), and save them to a gallery.
... x-card:nth-child(1) video, x-card:nth-child(2) img, x-card:nth-child(3) { margin-top: 17.5vw; } x-card:nth-child(1) button, x-card:nth-child(2) button { position: absolute; bottom: 0; } x-card:nth-child(2) button:nth-of-type(2) { bottom: 5.9rem; } x-card:nth-child(1) button { font-size: 7vw; } x-card:nth-child(2) button { font-size: 7vw; } the next rules do some sizing on the buttons inside the first two cards, and give all card contents a top margin so that their content won't be lost under the navigation buttons (see below).
...to achieve this, we applied the brick css to the page using a separate <link> element with a media attribute: <link href="dist/brick.css" type="text/css" rel="stylesheet" media="all and (max-width: 480px)"> this says that the whole stylesheet will not be linked to the html unless the viewport width is 480px or less.
...And 3 more matches
<mask> - SVG: Scalable Vector Graphics
WebSVGElementmask
value type: <length> ; default value: 120%; animatable: yes maskcontentunits this attribute defines the coordinate system for the contents of the <mask>.
... value type: userspaceonuse|objectboundingbox ; default value: userspaceonuse; animatable: yes maskunits this attribute defines defines the coordinate system for attributes x, y, width and height on the <mask>.
... value type: userspaceonuse|objectboundingbox ; default value: objectboundingbox; animatable: yes x this attribute defines the x-axis coordinate of the top-left corner of the masking area.
...And 3 more matches
<use> - SVG: Scalable Vector Graphics
WebSVGElementuse
value type: <url> ; default value: none; animatable: yes xlink:href an <iri> reference to an element/fragment that needs to be duplicated.
... value type: <iri> ; default value: none; animatable: yes x the x coordinate of the use element.
... value type: <coordinate> ; default value: 0; animatable: yes y the y coordinate of the use element.
...And 3 more matches
page-worker - Archive of obsolete content
parameters options : object optional options: name type contenturl string the url of the content to load in the panel.
... on(type, listener) registers an event listener with the page worker.
... parameters type : string the type of event to listen for.
...And 2 more matches
core/promise - Archive of obsolete content
earlier described defer may be passed optional prototype argument, in order to make the returned promise and all the subsequent promises decendents of that prototype: let { promise, resolve } = defer({ get: function get(name) { return this.then(function(value) { return value[name]; }); } }); promise.get('foo').get('bar').then(console.log); resolve({ foo: { bar: 'taram !!' } }); // => 'taram !!' also promised function maybe be pass...
...ed a second optional prototype argument to achieve the same effect.
...in such cases it's usually easier to wrap value into promise than branch on value type: function or(a, b) { var second = resolve(b).then(function(bvalue) { return !!bvalue }); return resolve(a).then(function(avalue) { return !!avalue || second; }, function() { return second; }) } note: we could not use promised function here, as they reject returned promise if any of the given arguments is rejected.
...And 2 more matches
dev/panel - Archive of obsolete content
n: "./my-devtool.png", url: "./my-devtool.html", setup: function(options) { // my setup goes here }, dispose: function() { // my teardown goes here }, onready: function() { // i can send messages to // the panel document here } }); alternatively, you can use the extend function: const { extend } = require("sdk/core/heritage"); function mypanel() {}; mypanel.prototype = extend(panel.prototype, { label: "my panel", tooltip: "...", ....
... name type description label string the string to display in the toolbox toolbar.
...eritage"); const mypanel = class({ extends: panel, label: "my panel", tooltip: "my new devtool's panel", icon: "./my-icon.png", url: "./my-panel.html", setup: function(options) { this.debuggee = options.debuggee; this.debuggee.start(); this.debuggee.onmessage = function(event) { console.log(event.data); } this.debuggee.postmessage({ "to":"root", "type":"listtabs" }); } }); // export the constructor exports.mypanel = mypanel; // create a new tool, initialized // with the new constructor const mytool = new tool({ panels: { mypanel: mypanel } }); more usefully, you can pass debuggee from the main add-on to the panel document using the ports argument to postmessage.
...And 2 more matches
system/events - Archive of obsolete content
var events = require("sdk/system/events"); var { ci } = require("chrome"); function listener(event) { var channel = event.subject.queryinterface(ci.nsihttpchannel); channel.setrequestheader("user-agent", "mybrowser/1.0", false); } events.on("http-on-modify-request", listener); globals functions emit(type, event) send an event to observer service parameters type : string the event type.
... on(type, listener, strong) listen to events of a given type parameters type : string the event type name to watch.
...this object has three attributes: type: the event type name subject: the event subject object data: the event data string strong : boolean default is false, a weak reference, which means it can be garbage collected at any time if there are no other references to it.
...And 2 more matches
ui/button/toggle - Archive of obsolete content
parameters options : object required options: name type id string the button's id.
...wever, the icons in the toolbar will not quite fill the space available, so you can instead supply four icons: icon: { "18": "./addon18.png", // toolbar icon non hidpi "32": "./addon32.png", // menu panel icon non hidpi "36": "./addon36.png", // toolbar icon hidpi "64": "./addon64.png" // menu panel icon hidpi } optional options: name type disabled boolean determines whether the button is disabled.
...toggle buttons emit two types of event, "click" and "change".
...And 2 more matches
Creating Event Targets - Archive of obsolete content
pec); }, onitemvisited: function(aitemid, avisitid, time) { emit(exports, "visited", bookmarkservice.getbookmarkuri(aitemid).spec); }, queryinterface: xpcomutils.generateqi([ci.nsinavbookmarkobserver]) }; bookmarkservice.addobserver(bookmarkobserver, false); exports.on = on.bind(null, exports); exports.once = once.bind(null, exports); exports.removelistener = function removelistener(type, listener) { off(exports, type, listener); }; this code implements a module which can emit added and visited events.
... it duplicates the previous code, but with a few changes: import emit(), on(), once(), and off() from event/core replace listener functions with calls to emit(), passing the appropriate event type export its own event api.
... this consists of three functions: on(): start listening for events or a given type once(): listen for the next occurrence of a given event, and then stop removelistener(): stop listening for events of a given type the on() and once() exports delegate to the corresponding function from event/core, and use bind() to pass the exports object itself as the target argument to the underlying function.
...And 2 more matches
Canvas code snippets - Archive of obsolete content
function canvas2dcontext(canvas) { if (typeof canvas === 'string') { canvas = document.getelementbyid(canvas); } if (!(this instanceof canvas2dcontext)) { return new canvas2dcontext(canvas); } this.context = this.ctx = canvas.getcontext('2d'); if (!canvas2dcontext.prototype.arc) { canvas2dcontext.setup.call(this, this.ctx); } } canvas2dcontext.setup = function() { var methods = ['arc', 'arcto', 'beginpath', 'bezie...
...ient', 'createradialgradient', 'getimagedata', 'putimagedata' ]; var props = ['canvas', 'fillstyle', 'font', 'globalalpha', 'globalcompositeoperation', 'linecap', 'linejoin', 'linewidth', 'miterlimit', 'shadowoffsetx', 'shadowoffsety', 'shadowblur', 'shadowcolor', 'strokestyle', 'textalign', 'textbaseline']; for (let m of methods) { let method = m; canvas2dcontext.prototype[method] = function() { this.ctx[method].apply(this.ctx, arguments); return this; }; } for (let m of gettermethods) { let method = m; canvas2dcontext.prototype[method] = function() { return this.ctx[method].apply(this.ctx, arguments); }; } for (let p of props) { let prop = p; canvas2dcontext.prototype[prop] = function(value) { if (value ===...
... function savecanvas(canvas, path, type, options) { return task.spawn(function *() { var reader = new filereader; var blob = yield new promise(accept => canvas.toblob(accept, type, options)); reader.readasarraybuffer(blob); yield new promise(accept => { reader.onloadend = accept }); return yield os.file.writeatomic(path, new uint8array(reader.result), ...
...And 2 more matches
File I/O - Archive of obsolete content
creating temporary files to create a temporary file, use nsifile.createunique(): components.utils.import("resource://gre/modules/fileutils.jsm"); var file = fileutils.getfile("tmpd", ["suggestedname.tmp"]); file.createunique(components.interfaces.nsifile.normal_file_type, fileutils.perms_file); // do whatever you need to the created file alert(file.path); user input via nsifilepicker the file picker component, nsifilepicker, can be used to open standard open / save dialogs.
... // you can read it into a string with var data = netutil.readinputstreamtostring(inputstream, inputstream.available()); }); read with content type hint it's useful to provide a content type hint to prevent the file system from doing a potentially expensive content type look up (which would be synchronous i/o).
... in this case an nsichannel object has to be explicitly created from the file: components.utils.import("resource://gre/modules/netutil.jsm"); // content type hint is useful on mobile platforms where the filesystem // would otherwise try to determine the content type.
...And 2 more matches
Forms related code snippets - Archive of obsolete content
date picker (before implementing it in a working environment, please read the note about the const statement compatibility) <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>datepicker example - mdn</title> <script type="text/javascript"> /*\ |*| |*| datepicker example mdndeveloper network |*| |*| https://developer.mozilla.org/docs/code_snippets/forms |*| https://developer.mozilla.org/user:fusionchess |*| |*| this snippet is released under the gnu public license, version 3 or later.
...) { otable.parentnode.removechild(otable); return; } otable.style.zindex = nzindex++; otable.style.position = "absolute"; otable.style.left = otarget.offsetleft + "px"; otable.style.top = (otarget.offsettop + otarget.offsetheight) + "px"; otarget.parentnode.insertbefore(otable, otarget); }; ainstances.push(this); } datepicker.prototype.writedays = function () { const nendblanks = (this.current.getday() + bzeroismonday * 6) % 7, nend = amonthlengths[this.current.getmonth()] + nendblanks, ntotal = nend + ((7 - nend % 7) % 7); var otd, otr; if (this.otbody) { this.container.removechild(this.otbody); } this.otbody = document.createelement("tbody"); for (var nday, oday, niter = 0; n...
...document.attachevent("onmousedown", ondocclick) : (document.onmousedown = ondocclick); })(); </script> <style type="text/css"> table.zdp-calendar { border: 1px solid #666666; border-collapse: collapse; background-color: #cccccc; cursor: default; font-family: verdana; font-size: 12px; } table.zdp-calendar th { border: 1px solid #666666; font-weight: bold; background-color: #ff6666; } table.zdp-calendar td { border: 1px solid #666666; text-align: center; } table.zdp-calendar caption { ...
...And 2 more matches
HTML to DOM - Archive of obsolete content
the returned <body> object is of type element here is a sample that counts the number of paragraphs in a string: var dompars = htmlparser('<p>foo</p><p>bar</p>'); alert(dompars.getelementsbytagname('p').length); if htmlparser() returns the element name html (instead of body), you have all document object with its complete functions list, therefore you can retrieve info within div tag like this: var dompars = htmlparser("<div id=...
...'userinfo'>john was a mediocre programmer, but people liked him <strong>anyway</strong>.</div>"); alert(dompars.getelementbyid('userinfo').innerhtml); to parse a complete html page, load it into an iframe whose type is content (not chrome).
... var frame = document.getelementbyid("sample-frame"); if (!frame) { // create frame frame = document.createelement("iframe"); // iframe (or browser on older firefox) frame.setattribute("id", "sample-frame"); frame.setattribute("name", "sample-frame"); frame.setattribute("type", "content"); frame.setattribute("collapsed", "true"); document.getelementbyid("main-window").appendchild(frame); // or // document.documentelement.appendchild(frame); // set restrictions as needed frame.webnavigation.allowauth = false; frame.webnavigation.allowimages = false; frame.webnavigation.allowjavascript = false; frame.webnavigation.allowmetaredirects = true; frame.we...
...And 2 more matches
QuerySelector - Archive of obsolete content
along the lines of other frameworks such as jquery or prototype, shortening the "queryselector" name can be convenient: function $ (selector, el) { if (!el) {el = document;} return el.queryselector(selector); } function $$ (selector, el) { if (!el) {el = document;} return el.queryselectorall(selector); // note: the returned object is a nodelist.
... // if you'd like to convert it to a array for convenience, use this instead: // return array.prototype.slice.call(el.queryselectorall(selector)); } alert($('#myid').id); (note that while using the firefox web console, the above functions are available automatically.) both xul and even xml can be easily made supportable (an alternative approach to the following would be to add chromewindow.prototype or window.prototype, accessing this.document.queryselector, or following the jquery style of chaining by returning 'this' within each prototype method of $()): htmldocument.prototype.$ = function (selector) { // only for html return this.queryselector(selector); }; example: <h1>test!</h1> <script> htmldocument.prototype.$ = function (selector) { return this.queryselector(select...
...or); }; alert(document.$('h1')); // [object htmlheadingelement] </script> xuldocument.prototype.$ = function (selector) { // only for xul return this.queryselector(selector); }; example: <label value="test!"/> <script type="text/javascript"><![cdata[ xuldocument.prototype.$ = function (selector) { // only for xul return this.queryselector(selector); }; alert(document.$('label')); // [object xulelement] ]]></script> document.prototype.$ = function (selector) { // only for plain xml return this.queryselector(selector); }; var foo = document.implementation.createdocument('somens', 'foo', null); // create an xml document <foo xmlns="somens"/> var bar = foo.createelementns('somens', 'bar'); // add <bar xmlns="somens"/> foo.documentelement.appendchild(bar); alert(foo.$('bar').nodena...
...And 2 more matches
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
note: with the modern jit javascript engine in gecko and js-ctypes more extension code can be written only in javascript than ever before.
... = @top_srcdir@ srcdir = @srcdir@ vpath = @srcdir@ include $(depth)/config/autoconf.mk module = myextension xpidl_module = myextension xpi_name = myextension exports = \ myheader.h \ $(null) xpidlsrcs = \ myifirstcomponent.idl \ myisecondcomponent.idl \ $(null) include $(topsrcdir)/config/rules.mk xpidl_module is the name of the generated xpt file that contains type information about your idl interfaces.
...in addition, an xpt (type library) file is generated and placed in the components/ subdirectory of your extension.
...And 2 more matches
Multiple item extension packaging - Archive of obsolete content
the only required properties are em:id, em:targetapplication, and em:type.
... for the firefox and thunderbird 1.5 extension manager to determine that the package is a multiple item package, the em:type specified in your install.rdf must be 32 and specified as <em:type nc:parsetype="integer">32</em:type>.
...<rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:nc="http://home.netscape.com/nc-rdf#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <description about="urn:mozilla:install-manifest"> <!-- nsiupdateitem type for a multiple item package --> <em:type nc:parsetype="integer">32</em:type> ...
...And 2 more matches
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
fixme: figure 3: inserting a breakpoint start debugger type in some text into the quicknote screen, and then select save current tab from the menu.
... listing 1: calc.js (stage 1) function rpncalc() { } rpncalc.prototype = { init: function() { }, push: function(val) { }, plus: function() { }, pop: function() { } } implement the addition operation create test case begin by creating the test case.
...('rpn calc testcase'); var module = new modulemanager(); var rpncalc = module.require('package', 'calc'); tc.tests = { '2 1 +': function() { var calc = new rpncalc.rpncalc(); calc.init(); calc.push(2); calc.push(1); calc.plus(); assert.equals(calc.pop(), 3); } } listing 3: additional content for calc.js function rpncalc() { this.stack = new array(); } rpncalc.prototype = { init: function() { this.stack = new array(); }, push: function(val) { this.stack.push(number(val)); }, _letfunc: function(func) { a = this.pop(); b = this.pop(); this.push(func(a, b)); }, plus: function() { return this._letfunc(this._plus); }, _plus: function(a, b) { return a + b; }, pop: function() { return this.stack.pop(); } } check...
...And 2 more matches
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
toolbar buttons there are several types of buttons and elements you can add to a toolbar depending on your needs.
... the toolbarbutton element has the type attribute that allows you to change the behavior of the button in many ways.
... the menu and menu-button types allow you to create buttons that open popup menus beneath them.
...And 2 more matches
Handling Preferences - Archive of obsolete content
you can type on the "filter" textbox to search for specific preferences.
... if you type the word "homepage", it will filter all the preferences and display only the ones which include the word "homepage" in its name or value.
...just type "xulschool" in the filter box to see your new preference.
...And 2 more matches
JavaScript Object Management - Archive of obsolete content
*/ if (typeof 〈namespace〉 == "undefined") { var 〈namespace〉 = {}; }; note: the naming standard that we normally follow is that the first part of the namespace corresponds to the development group (or company), and the second to the specific project.
... */ if (typeof 〈namespace〉 == "undefined") { var 〈namespace〉 = { /** * initializes this object.
...in order to access a file messagecount.js in this directory, the url would be: resource://xulschoolhello/messagecount.js code modules are regular js files, so there's nothing new in regards to naming or file types.
...And 2 more matches
Adding preferences to an extension - Archive of obsolete content
observe: function(subject, topic, data) { if (topic != "nspref:changed") { return; } switch(data) { case "symbol": this.tickersymbol = this.prefs.getcharpref("symbol").touppercase(); this.refreshinformation(); break; } }, the topic parameter indicates what type of event occurred.
... <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <prefwindow id="stockwatcher2-prefs" title="stockwatcher 2 options" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <prefpane id="sw2-stock-pane" label="stock settings"> <preferences> <preference id="pref_symbol" name="extensions.stockwatcher2.symbol" type="string"/> </preferences> <hbox align="center"> <label control="symbol" value="...
...stock to watch: "/> <textbox preference="pref_symbol" id="symbol" maxlength="4"/> </hbox> </prefpane> </prefwindow> the <preferences> block establishes all the settings we implement as well as their types.
...And 2 more matches
Index of archived content - Archive of obsolete content
ocesses 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 high-level apis addon-page base64 clipboard context-menu hotkeys indexed-db l10n notifications page-mod page-wor...
... content/worker core/heritage core/namespace core/promise dev/panel event/core event/target frame/hidden-frame frame/utils fs/path io/byte-streams io/file io/text-streams lang/functional lang/type loader/cuddlefish loader/sandbox net/url net/xhr places/bookmarks places/favicon places/history platform/xpcom preferences/event-target preferences/service remote/child remote/parent stylesheet/style sty...
... xulrunner 1.9 release notes xulrunner 1.9.1 release notes xulrunner 1.9.2 release notes xulrunner 2.0 release notes xulrunner faq xulrunner hall of fame xulrunner tips xulrunner/old releases toolkit.defaultchromefeatures toolkit.defaultchromeuri toolkit.singletonwindowtype xulauncher ant script to assemble an extension application/http-index-format specification calicalendarview calicalendarviewcontroller califiletype mozilla.dev.platform faq reftest opportunities files symsrv_convert xbdesignmode.js archi...
...And 2 more matches
Notes on HTML Reflow - Archive of obsolete content
as described below, the reflow command has a type and a target frame .
... multiple reflow commands with the same type and target frame are coalesced : the presentation shell simply refuses to add subsequent commands of the same type for the same frame to the queue.
...at some point, the incremental reflow reaches the target frame , at which point the reflow command's type becomes significant.
...And 2 more matches
Using XML Data Islands in Mozilla - Archive of obsolete content
javascript can use the content of a <script> element as a data block if the src attribute is omitted and the type attribute does not specify an executable script type.
...for example, a simple xml purchase order can be embedded like this: <script id="purchase-order" type="application/xml"> <purchaseorder xmlns="http://example.mozilla.org/purchaseorderml"> <lineitem> <name>line item 1</name> <price>1.25</price> </lineitem> <lineitem> <name>line item 2</name> <price>2.48</price> </lineitem> </purchaseorder> </script> the xml source text can then be retrieved like this: var ordersource = document.getelementbyid("purchase-order").textcontent; the xml source text can be parsed into a dom tree using the domparser api: var parser = new domparser(); var doc = parser.parsefromstrin...
...here is a complete demo (also available as an attachment): <!doctype html> <html> <head> <title>xml data block demo</title> <script id="purchase-order" type="application/xml"> <purchaseorder xmlns="http://example.mozilla.org/purchaseorderml"> <lineitem> <name>line item 1</name> <price>1.25</price> </lineitem> <lineitem> <name>line item 2</name> <price>2.48</price> </lineitem> </purchaseorder> </script> <script> function rundemo() { var ordersource = document.getelementbyid("purchase-order").textcontent; var parser = new domparser(); var doc = parser.parsefromstrin...
...And 2 more matches
Using Dehydra - Archive of obsolete content
example: printing the location of type declarations save the following c++ code dumptypes.cc: typedef int myint; struct foo { int i; char *c; }; save the following analysis script dumptypes.js: function process_type(t) { print("type found: " + t.name + " location: " + t.loc); } function input_end() { print("hello, world!"); } compile using the following command: $ g++ -fplugin=~/dehydra/gcc_dehydra.so -fplugin-arg=~/dumptypes.js -o/dev/null -c dumptypes.cc note:for g++4.5 and up use -fplugin-arg-gcc_dehydra-script= rather than -fplugin-arg it should print the following results: type fo...
...und: foo location: test.cc:2:12 type found: myint location: test.cc:1:13 hello, world!
... see documentation for: process_type, input_end, print, .loc property example: using attributes to mark a class as "final" save the following code as final.cc: // this class should not be subclassed!
...And 2 more matches
Drag and Drop Example - Archive of obsolete content
the user can click on one of several xul elements on the palette and drag it onto a stack element to create an element of a particular type.
...we need this so that we know what type of element to create when dragging.
...the ondrop function will grab the data from the drag session and create a new element of the appropriate type.
...And 2 more matches
PyDOM - Archive of obsolete content
once you set the script type for a node, it is the default for that node and all children.
... this means that if you set the script-type to python for the window, python is the default script type for all child elements in the window.
... xul use a script-type attribute on your elements.
...And 2 more matches
open - Archive of obsolete content
summary opens the file, specifying file mode and type.
... syntax open(mode,type) parameters mode a comma-delimited list describing the method to use to open the file, described in detail here.
... type a string describing the type of file being opened.
...And 2 more matches
Extensions - Archive of obsolete content
instead of having separate context menus depending on what type of element was the target of the context menu, only one context menu is used and items that don't apply to that type of element are hidden from the menu as needed.
...this allows the menu to have different commands for different types of targets.
...specifically, this object is initialized with a set of properties that indiciate the type of object that was the target of the context menu.
...And 2 more matches
Sorting Results - Archive of obsolete content
for ascending or descending sorts, this doesn't matter, since it will ignore whether results are containers and just sort by a value, alphabetically or numerically depending on the type of data.
...for rdf datasources, another way to sort by dates is to use the the parsetype="date" construct in the rdf datasource.
...here is a sample of how to specify this in the rdf/xml datasource: <rdf:rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:r="http://www.xulplanet.com/rdf/" xmlns:nc="http://home.netscape.com/nc-rdf#"> <rdf:description rdf:about="http://www.xulplanet.com/ndeakin/images/t/palace.jpg"> <r:date nc:parsetype="date">1125966767295<r:date> </rdf:description> </rdf:rdf> you can also specify parsetype="integer" for numbers which will allow sorting numerically.
...And 2 more matches
XML Templates - Archive of obsolete content
when an xml source is desired, specify a querytype attribute on the root node of the template to the value xml.
... an example: <listbox datasources="people.xml" ref="*" querytype="xml"> <template> ...
...here is an example: <listbox datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="person"/> <action> <listitem uri="?" label="?name"/> </action> </template> </listbox> the expr attribute is a very simple xpath expression which simply retrieves the person elements from within the datasource.
...And 2 more matches
Adding Style Sheets - Archive of obsolete content
the second line has always been: <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> this line indicates that we want to use the style provided by chrome://global/skin/.
...first, the modifed lines of findfile.xul: <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="findfile.css" type="text/css"?> ...
... <spacer class="titlespace"/> <groupbox orient="horizontal"> <caption label="search criteria"/> <menulist id="searchtype"> <menupopup> <menuitem label="name"/> <menuitem label="size"/> <menuitem label="date modified"/> </menupopup> </menulist> <spacer class="springspace"/> <menulist id="searchmode"> <menupopup> <menuitem label="is"/> <menuitem label="is not"/> </menupopup> </menulist> <spacer class="springspace"/> <menulist id="find-text" flex="1" editable="true" datasources="file:///mozilla/recents.rdf" ref="http://www.xulplanet.com/rdf/recent/all"/> ...
...And 2 more matches
Anonymous Content - Archive of obsolete content
declaring scrollbar example the example below shows how a scrollbar might be declared (it has been simplified a bit from the real thing): <bindings xmlns="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <binding id="scrollbarbinding"> <content> <xul:scrollbarbutton type="decrement"/> <xul:slider flex="1"> <xul:thumb/> </xul:slider> <xul:scrollbarbutton type="increment"/> </content> </binding> </bindings> this file contains a single binding, declared with the binding element.
...the result of using the above binding is that the line of xul below will be expanded as follows, assuming that the scrollbar is bound to the xbl above: <scrollbar/> expands to: <scrollbar> <xul:scrollbarbutton type="decrement"/> <xul:slider flex="1"> <xul:thumb/> </xul:slider> <xul:scrollbarbutton type="increment"/> </scrollbar> the elements within the content tag are added to the scroll bar anonymously.
...the resulting content would be: <menu class="dropbox"> <menupopup> <menuitem label="1000"/> <menuitem label="2000"/> </menupopup> <textbox flex="1"/> <button src="chrome://global/skin/images/dropbox.jpg"/> </menu> includes attribute in some cases, you may wish to only include specific types of content and not others.
...And 2 more matches
Document Object Model - Archive of obsolete content
obviously, it is this latter type of document used for xul.
... the three document types are very similar, in fact they all share the same base implementation.
... however, there are a few functions that are specific to one document type or the other.
...And 2 more matches
More Button Features - Archive of obsolete content
example 3 : source view <button label="left" image="happy.png"/> <button label="right" image="happy.png" dir="reverse"/> <button label="above" image="happy.png" orient="vertical"/> <button label="below" image="happy.png" orient="vertical" dir="reverse"/> the example here shows all four types of alignment of buttons.
...however, in this case you must set the type attribute to the value menu.
... example 5 : source view <button type="menu" label="device"> <menupopup> <menuitem label="printer"/> <menuitem label="mouse"/> <menuitem label="keyboard"/> </menupopup> </button> in this example, the user may click the button to pop up a menu containing three items.
...And 2 more matches
menubar - Archive of obsolete content
attributes grippyhidden, statusbar properties accessibletype, statusbar examples <menubar id="sample-menubar"> <menu id="action-menu" label="action"> <menupopup id="action-popup"> <menuitem label="new"/> <menuitem label="save" disabled="true"/> <menuitem label="close"/> <menuseparator/> <menuitem label="quit"/> </menupopup> </menu> <menu id="edit-menu" label="edit"> <menupopup id="edit-popup"> <men...
...uitem label="undo"/> <menuitem label="redo"/> </menupopup> </menu> </menubar> attributes grippyhidden seamonkey only type: boolean when set to true, the grippy will be hidden.
... 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.
...And 2 more matches
splitter - Archive of obsolete content
the vbox is used to hold the .png image that a user clicks on to resize the search bar.--> <splitter tooltiptext="resize the search box" oncommand="alert('the splitter was dragged')"> <vbox id="example_vbox" /> </splitter> attributes collapse type: one of the values below determines which side of the splitter is collapsed when its grippy is clicked.
... resizeafter type: one of the values below this attribute indicates which element to the right or below the splitter should be resized when the splitter is repositioned.
... resizebefore type: one of the values below this attribute indicates which element to the left or above the splitter should be resized when the splitter is repositioned.
...And 2 more matches
Dialogs in XULRunner - Archive of obsolete content
certain types of dialogs are used so frequently that the os can provide a default implementation.
...here is an example xul dialog: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <dialog id="mydialog" title="my dialog" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="window.sizetocontent();" buttons="accept,cancel" buttonlabelaccept="set favorite" buttonaccesskeyaccept="s" ondialogaccept="return dosave();" buttonlabelcancel="cancel" buttonaccesskeycancel="n" ...
... buttonlabelaccept label for the accept button; similar attributes exist for the other button types.
...And 2 more matches
XULRunner tips - Archive of obsolete content
the following prefs must also be set to make the xpinstall dialog, extension manager, and theme manager work: pref("xpinstall.dialog.confirm", "chrome://mozapps/content/xpinstall/xpinstallconfirm.xul"); pref("xpinstall.dialog.progress.skin", "chrome://mozapps/content/extensions/extensions.xul?type=themes"); pref("xpinstall.dialog.progress.chrome", "chrome://mozapps/content/extensions/extensions.xul?type=extensions"); pref("xpinstall.dialog.progress.type.skin", "extension:manager-themes"); pref("xpinstall.dialog.progress.type.chrome", "extension:manager-extensions"); pref("extensions.update.enabled", true); pref("extensions.update.interval", 86400); pref("extensions.dss.enabled", false); pr...
... window url window type extension manager chrome://mozapps/content/extensions/extensions.xul?type=extensions extension:manager-extensions theme manager chrome://mozapps/content/extensions/extensions.xul?type=themes extension:manager-themes javascript console chrome://global/content/console.xul global:console about:config chrome://global/content/config.xul ...
... developer extensions venkman need a custom build or a compatible extension need to edit compatibility in needs a method to start venkman (usually by overlaying the main xul file, similar to existing code for firefox, suite, etc.) the function toopenwindowbytype() needs to be defined.
...And 2 more matches
application/http-index-format specification - Archive of obsolete content
the syntax of data is defined by the syntax spec for every number type.
... content-type mime content type.
...the mime-type for a directory can be given as application/http-index-format.
...And 2 more matches
NPN_GetURL - Archive of obsolete content
can be of any type, such as http, ftp, news, or mailto.
... if the target is null, the browser creates a new stream and delivers the data to the current instance regardless of the mime type of the url.
... make sure that the target matches the url type sent to it.
...And 2 more matches
NPP_NewStream - Archive of obsolete content
syntax #include <npapi.h> nperror npp_newstream(npp instance, npmimetype type, npstream* stream, npbool seekable, uint16* stype); parameters the function has the following parameters: instance pointer to current plug-in instance.
... type pointer to mime type of the stream.
... stype out parameter.
...And 2 more matches
-ms-scroll-snap-x - Archive of obsolete content
the -ms-scroll-snap-x css shorthand property is a microsoft extension that specifies values for the -ms-scroll-snap-type and -ms-scroll-snap-points-x properties.
... initial valueas each of the properties of the shorthand:-ms-scroll-snap-type: none-ms-scroll-snap-points-x: snapinterval(0px, 100%)applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas each of the properties of the shorthand:-ms-scroll-snap-type: as specified-ms-scroll-snap-points-x: as specifiedanimation typediscrete syntax values the -ms-scroll-snap-x shorthand property is specified as one or both of the following values, in order and separated by spaces.
... -ms-scroll-snap-type the value of the -ms-scroll-snap-type property.
...And 2 more matches
-ms-scroll-snap-y - Archive of obsolete content
the -ms-scroll-snap-x css shorthand property is a microsoft extension that specifies values for the -ms-scroll-snap-type and -ms-scroll-snap-points-y properties.
... initial valueas each of the properties of the shorthand:-ms-scroll-snap-type: none-ms-scroll-snap-points-y: snapinterval(0px, 100%)applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas each of the properties of the shorthand:-ms-scroll-snap-type: as specified-ms-scroll-snap-points-y: as specifiedanimation typediscrete syntax values the -ms-scroll-snap-y shorthand property is specified as one or both of the following values, in order and separated by spaces.
... -ms-scroll-snap-type the value of the -ms-scroll-snap-type property.
...And 2 more matches
display-outside - Archive of obsolete content
the display-outside css property specifies the outer display type of the box generated by an element, dictating how the element participates in its parent formatting context.
... table-cell and table-caption are layout-specific leaf types; the rest are layout-specific internal types.
... ruby-base and ruby-text are layout-specific leaf types; ruby-base-container and ruby-text-container are layout-specific internal types.
...And 2 more matches
Processing XML with E4X - Archive of obsolete content
you can add an e4x=1 argument to your <script> tag to disable this restriction: <script type="text/javascript;e4x=1"> ...
...the first is to pass a string to the xml constructor: var languages = new xml('<languages type="dynamic"><lang>javascript</lang><lang>python</lang></languages>'); the second is to embed the xml directly in your script, as an xml literal: var languages = <languages type="dynamic"> <lang>javascript</lang> <lang>python</lang> </languages>; in both cases, the resulting object will be an e4x xml object, which provides convenient syntax for both accessing and updating the encapsulated data.
...this node has one attribute, type, which can be accessed and updated in a number of ways: alert(languages.@type); // alerts "dynamic" languages.@type = "agile"; alert(languages.@type); // alerts "agile" alert(languages.tostring()); /* alerts: <languages type="agile"><lang>javascript</lang><lang>python</lang></languages> */ note that if one wishes to make comparisons of retrieved attributes with other strings, it is ...
...And 2 more matches
JSException - Archive of obsolete content
getwrappedexceptiontype instance method getwrappedexceptiontype returns the int mapping of the type of the wrappedexception object.
...javascript can throw any type of value.
... use getwrappedexception() to determine what kind of value the object return type represents.
...And 2 more matches
Windows Media in Netscape - Archive of obsolete content
below, some of the salient points are illustrated in a code snippet: if (window.activexobject && navigator.useragent.indexof('windows') != -1) { // ie for windows object instantiation -- use of activexobject } else if(window.geckoactivexobject) { // netscape 7.1 object instantiation --use of geckoactivexobject } else if(navigator.mimetypes) { // plugin architecture, such as in netscape 4x - 7.02 and opera browsers } since ie for mac also exposes window.activexobject it is wise to determine if the browser in question is on windows.
...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["application/x-mplayer2"].enabledplugin; } } catch(e) { // handle error -- no wmp control // download: http://www.microsoft.com/windows/windowsmedia/download/default.asp } if (player) { // windows media player control exists } currently, dynamically writing out markup using document.write after using detection mechanisms won't work owing to a bug in n...
... <object id="playerex2" classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6" height="200" width="200"> <param name="uimode" value="full" /> <param name="autostart" value="true" /> <param name="url" value="preludesteel.wma" /> </object> <script type="text/javascript"> if(!document.playerex2.versioninfo) { // control not installed -- the versioninfo property returns null // redirect users to http://www.microsoft.com/windows/windowsmedia/download/default.asp } else { //control was correctly created //proceed with scripting calls, etc.
...And 2 more matches
Index - Game development
mozilla's a-frame framework provides a markup language allowing us to build 3d vr landscapes using a system familiar to web developers, which follows game development coding principles; this is useful for quickly and successfully building prototypes and demos, without having to write a lot of javascript or glsl.
...there are two types of shaders: vertex shaders and fragment (pixel) shaders.
... 41 tutorials canvas, games, javascript, web, workflows this page contains multiple tutorial series that highlight different workflows for effectively creating different types of web games.
...And 2 more matches
Building up a basic demo with A-Frame - Game development
mozilla's a-frame framework provides a markup language allowing us to build 3d vr landscapes using a system familiar to web developers, which follows game development coding principles; this is useful for quickly and successfully building prototypes and demos, without having to write a lot of javascript or glsl.
... html structure the first step is to create an html document — inside your project directory, create a new index.html file, and save the follow html inside it: <!doctype html> <html> <head> <meta charset="utf-8"> <title>mdn games: a-frame demo</title> <script src="aframe.min.js"></script> </head> <body> <!-- html goes here --> </body> </html> this contains some basic information like the document charset and <title>.
... adding lights the basic light types in a-frame are directional and ambient.
...And 2 more matches
GLSL Shaders - Game development
there are two types of shaders: vertex shaders and fragment (pixel) shaders.
...glsl is strongly typed and there is a lot of math involving vectors and matrices.
... shader types a shader is essentially a function required to draw something on the screen.
...And 2 more matches
IDL - MDN Web Docs Glossary: Definitions of Web-related terms
for example, the default type for <input> elements is "text", so if you set input.type="foobar", the <input> element will be of type text (in the appearance and the behavior) but the "type" content attribute's value will be "foobar".
... however, the type idl attribute will return the string "text".
...when using idl attributes, you read or set values of the desired type, so input.maxlength is always going to return a number and when you set input.maxlength ,it wants a number.
...And 2 more matches
Symbol - MDN Web Docs Glossary: Definitions of Web-related terms
a value having the data type symbol can be referred to as a "symbol value".
... symbol type is a new feature in ecmascript 2015.
... in some programming languages, the symbol data type is referred to as an "atom." symbols don't "auto-convert" to strings most values in javascript support implicit conversion to a string.
...And 2 more matches
MDN Web Docs Glossary: Definitions of Web-related terms
css css object model (cssom) css pixel css preprocessor d data structure decryption delta denial of service descriptor (css) deserialization developer tools dhtml digest digital certificate distributed denial of service dmz dns doctype document directive document environment dom (document object model) domain domain name domain sharding dominator dos attack dtls (datagram transport layer security) dtmf (dual-tone multi-frequency signaling) dynamic programming language dynamic typing e ecma ...
... ecmascript effective connection type element empty element encapsulation encryption endianness engine entity entity header event exception expando f fallback alignment falsy favicon fetch directive fetch metadata request header firefox os firewall first contentful paint first cpu idle first input delay first interactive first meaningful paint first paint first-class function flex flex container flex item flexbox forbidden header name forbidden response header name fork fragme...
...p lossless compression lossy compression ltr (left to right) m main axis main thread markup mathml media media (audio-visual presentation) media (css) metadata method microsoft edge microsoft internet explorer middleware mime mime type minification mitm mixin mobile first modem modern web apps modularity mozilla firefox mutable mvc n namespace nan nat native navigation directive netscape navigator network throttling nntp node node (dom...
...And 2 more matches
Images, media, and form elements - Learn web development
html5 also contains attributes that enable web developers to indicate which fields are required, and even the type of content that needs to be entered.
... styling text input elements elements that allow for text input, such as <input type="text">, specific types such as <input type="email">, and the <textarea> element are quite easy to style and tend to behave just like other boxes on your page.
...we are using attribute selectors to target the different input types.
...And 2 more matches
Legacy layout methods - Learn web development
this knowledge will be helpful to you if you need to create fallback code for browsers that do not support newer methods, in addition to allowing you to work on existing projects which use these types of systems.
...add the following to the bottom of your css: div:nth-of-type(1) { width: 48%; } div:nth-of-type(2) { width: 48%; } here we've set both to be 48% of their parent's width — this totals 96%, leaving us 4% free to act as a gutter between the two columns, giving the content some space to breathe.
... now we just need to float the columns, like so: div:nth-of-type(1) { width: 48%; float: left; } div:nth-of-type(2) { width: 48%; float: right; } putting this all together should give us a result like so: simple two-column layout <h1>2 column layout example</h1> <div> <h2>first column</h2> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit.
...And 2 more matches
Practical positioning examples - Learn web development
next, we'll style the horizontal tabs — the list items are all floated left to make them sit in a line together, their list-style-type is set to none to get rid of the bullets, and their width is set to 150px so they will comfortably fit across the info-box.
... add the following css: .info-box li { float: left; list-style-type: none; width: 150px; } .info-box li a { display: inline-block; text-decoration: none; width: 100%; line-height: 3; background-color: red; color: black; text-align: center; } finally for this section we'll set some styles on the link states.
...let's have a look at the html in the file: <label for="toggle">❔</label> <input type="checkbox" id="toggle"> <aside> ...
...And 2 more matches
How CSS is structured - Learn web development
you reference an external css stylesheet from an html <link> element: <!doctype html> <html> <head> <meta charset="utf-8"> <title>my css experiment</title> <link rel="stylesheet" href="styles.css"> </head> <body> <h1>hello world!</h1> <p>this is my first css example</p> </body> </html> the css stylesheet file might look like this: h1 { color: blue; background-color: yellow; border: 1px solid black; } p { color: red; } the href attribut...
... the html for an internal stylesheet might look like this: <!doctype html> <html> <head> <meta charset="utf-8"> <title>my css experiment</title> <style> h1 { color: blue; background-color: yellow; border: 1px solid black; } p { color: red; } </style> </head> <body> <h1>hello world!</h1> <p>this is my first css example</p> </body> </html> in some circumstances, internal styles...
...the implementation of an inline style in an html document might look like this: <!doctype html> <html> <head> <meta charset="utf-8"> <title>my css experiment</title> </head> <body> <h1 style="color: blue;background-color: yellow;border: 1px solid black;">hello world!</h1> <p style="color:red;">this is my first css example</p> </body> </html> avoid using css in this way when possible.
...And 2 more matches
Sending form data - Learn web development
iv> <div> <label for="to">who do you want to say it to?</label> <input name="to" id="to" value="mom"> </div> <div> <button>send my greetings</button> </div> </form> when the form is submitted using the post method, you get no data appended to the url, and the http request looks like so, with the data included in the request body instead: post / http/2.0 host: foo.com content-type: application/x-www-form-urlencoded content-length: 13 say=hi&to=mom the content-length header indicates the size of the body, and the content-type header indicates the type of resource sent to the server.
... the enctype attribute this attribute lets you specify the value of the content-type http header included in the request generated when the form is submitted.
... set the value of enctype to multipart/form-data because the data will be split into multiple parts, one for each file plus one for the text data included in the form body (if text is also entered into the form).
...And 2 more matches
How the Web works - Learn web development
when you type a web address in your browser, the browser looks at the dns to find the website's real address before it can retrieve the website.
...these files come in two main types: code files: websites are built primarily from html, css, and javascript, though you'll meet other technologies a bit later.
... when you type a web address into your browser (for our analogy that's like walking to the shop): the browser goes to the dns server, and finds the real address of the server that the website lives on (you find the address of the shop).
...And 2 more matches
Images in HTML - Learn web development
fortunately, it wasn't too long before the ability to embed images (and other more interesting types of content) inside web pages was added.
... there are other types of multimedia to consider, but it is logical to start with the humble <img> element, used to embed a simple image in a webpage.
... the browser doesn't support the image type.
...And 2 more matches
Drawing graphics - Learn web development
as you'll see below, canvas provides many useful tools for creating 2d animations, games, data visualizations, and other types of app, especially when combined with some of the other apis the web platform provides.
...this is done using the htmlcanvaselement.getcontext() method, which for basic usage takes a single string as a parameter representing the type of context you want to retrieve.
...the returned object is the same type as that which is returned when you grab a reference to an existing <img> element).
...And 2 more matches
Manipulating documents - Learn web development
the html source code looks like this: <!doctype html> <html> <head> <meta charset="utf-8"> <title>simple dom example</title> </head> <body> <section> <img src="dinosaur.png" alt="a red tyrannosaurus rex: a two legged dinosaur standing upright like a human, with small arms, and a large head with lots of sharp teeth."> <p>here we will add a link to the <a href="https://www.mozilla.org/">mozilla homepage</a></p...
...you will also encounter various terms used to describe the type of node, and their position in the tree in relation to one another: element node: an element, as it exists in the dom.
... document.getelementsbytagname(), which returns an array-like object containing all the elements on the page of a given type, for example <p>s, <a>s, etc.
...And 2 more matches
Handling text — strings in JavaScript - Learn web development
the following will return an error: let badquotes = 'what on earth?"; the browser will think the string has not been closed because the other type of quote you are not using to contain your strings can appear in the string.
...try the following (we are using the typeof operator to check whether the variable is a number or a string): let mydate = '19' + '67'; typeof mydate; if you have a numeric variable that you want to convert to a string but not change otherwise, or a string variable that you want to convert to a number but not change otherwise, you can use the following two constructs: the number object converts anything passed to it into a numb...
...try the following: let mystring = '123'; let mynum = number(mystring); typeof mynum; conversely, every number has a method called tostring() that converts it to the equivalent string.
...And 2 more matches
Solve common problems in your JavaScript code - Learn web development
(also see assignment operators) what data types can values have in javascript?
... what does 'loosely typed' mean?
... math what types of number do you have to deal with in web development?
...And 2 more matches
Adding features to our bouncing balls demo - Learn web development
remember to set the ball() constructor's prototype and constructor appropriately.
... 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.
...it will work in a very similar way, so you can start by copying the ball.prototype.draw definition.
...And 2 more matches
Object building practice - Learn web development
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 the screen, by calling a series of members of the 2d canvas context we defined earlier (ctx).
... type in the following to create a new ball instance: let testball = new ball(50, 100, 4, 4, 'blue', 10); try calling its members: testball.x testball.size testball.color testball.draw() when you enter the last line, you should see the ball draw itself somewhere on the canvas.
...add the following code at the bottom of your javascript file, to add an update() method to the ball()'s prototype: ball.prototype.update = function() { if ((this.x + this.size) >= width) { this.velx = -(this.velx); } if ((this.x - this.size) <= 0) { this.velx = -(this.velx); } if ((this.y + this.size) >= height) { this.vely = -(this.vely); } if ((this.y - this.size) <= 0) { this.vely = -(this.vely); } this.x += this.velx; this.y += this.vely; } the first four parts of the function check whether the ball has reached the edge of the canvas.
...And 2 more matches
Multimedia: Images - Learn web development
examples for these types of motifs are logos, illustrations, charts or icons (note: svgs are far better than icon fonts!).
...this can be done via the <picture> element with the help of a <source> element equipped with a type attribute.
... if all of this sounds a bit complicated or feels like too much work for your team then there is also online services that you can use as image cdns that will automate the serving of the correct image format on-the-fly, according to the type of device or browser requesting the image.
...And 2 more matches
Getting started with Ember - Learn web development
ember makes use of two main syntaxes: javascript (or optionally, typescript) ember's own templating language, which is loosely based on handlebars.
...this is where most of the "framework" parts come into play, as there are superclasses, where each type of thing has a different purpose and different expected location within your project.
... now type the following into your terminal to install ember-cli: npm install -g ember-cli this tool provides the ember program in your terminal, which is used to create, build, develop, test, and scaffold your application (run ember --help for a full list of commands and their options).
...And 2 more matches
Introduction to client-side frameworks - Learn web development
angular uses typescript, a superset of javascript that we’ll look at in a little more detail in the next chapter.
...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(textcontent); return button; } this button doesn't do anything yet, but it will later once we decide to implement our delete feature.
... by contrast, the following block of code illustrates the way you might use vue to describe our list of tasks: <ul> <li v-for="task in tasks" v-bind:key="task.id"> <span>{{task.name}}</span> <button type="button">delete</button> </li> </ul> that's it.
...And 2 more matches
Getting started with Vue - Learn web development
these options let you configure things like typescript, linting, vue-router, testing, and more.
...if you like these settings over the existing presets and want to use them again, type y , otherwise type n.
...this allows you to use tools like babel, typescript, scss and more to create more sophisticated components.
...And 2 more matches
Adding a new todo form: Vue events, methods, and models - Learn web development
</label> <input type="text" id="new-todo-input" name="new-todo" autocomplete="off" /> <button type="submit"> add </button> </form> </template> so we now have a form component into which we can enter the title of a new todo item (which will become a label for the corresponding todoitem when it is eventually rendered).
...v-model works across all the various input types, including check boxes, radios, and select inputs.
...do this now: <input type="text" id="new-todo-input" name="new-todo" autocomplete="off" v-model="label" /> note: you can also sync data with <input> values through a combination of events and v-bind attributes.
...And 2 more matches
Package management basics - Learn web development
type the following command, making sure you are inside the parcel-experiment directory: npm init you will now be asked some questions; npm will then create a default package.json file based on the answers: name: a name to identify the app.
...type in something really simple, like "a simple npm package to learn about using npm", then press return.
...type your own name, and press return.
...And 2 more matches
Accessibility/LiveRegionDevGuide
event types the table for web page mutation event types lists the two major event types associated with live regions, namely text-changed and object changed events.
...in iaccessible2, there are two separate event types, namely event_object_show and event_object_hide.
...the text changed event type in at-spi has a similar scheme as the object:children-changed events.
...And 2 more matches
Adding a new event
what type of event do you want?
... roughly, there are 3 types of event.
... first, you need to choose which type you need.
...And 2 more matches
Chrome registration
chrome providers a supplier of chrome for a given window type (e.g., for the browser window) is called a chrome provider.
... there are three basic types of chrome providers: content the main source file for a window description comes from the content provider, and it can be any file type viewable from within mozilla.
...the two main types of localizable files are dtd files and java-style properties files.
...And 2 more matches
Eclipse CDT Manual Setup
select "general > content types", expand "text > c source file > c++ source file", click "add" and add "*.mm".
... eclipse cdt will try to format c/c++ code that you add as you type.
...however, you may still want to tweak those settings if you'll be editing other file types in eclipse.) select "c/c++ > editor" and set "workspace default" to "doxygen".
...And 2 more matches
Storage access policy: Block cookies from trackers
thus, attempts to read and write using this object will throw a typeerror exception.
...to do so: type about:config in your address bar.
...depending on the type of integration, the user may have to take some action to interact with the social content provider before the provider is given access to their cookies.
...And 2 more matches
Addon
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.
...in updatelistener listener, in integer reason, in string appversion, in string platformversion) overview of optional methods void uninstall() void canceluninstall() boolean hasresource(in string path) nsiuri getresourceuri(in string path) void getdatadirectory(in datadirectorycallback callback) required properties attribute type description appdisabled read only boolean true if this add-on cannot be used in the application based on version compatibility, dependencies, and blocklisting.
...operations my be restricted based on system policies (e.g., the system administrator may not allow certain add-ons to be uninstalled), add-on type (e.g., themes may not be disabled), or add-on state (e.g., an incompatible add-on cannot be enabled).
...And 2 more matches
Widget Wrappers
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 window wrappers) of the widget.
... areatype the type of the widget's current area isgroup true, will be false for wrappers around single widget nodes source for api-provided widgets, whether they are built-in to firefox or add-on-provided disabled for api-provided widgets, whether the widget is currently disabled.
...And 2 more matches
JavaScript OS.Constants
this module is largely a companion to js-ctypes.
...useful, for instance, to access the platform code from javascript in conjunction with js-ctypes.
...useful mostly for using js-ctypes to interact with the following platforms: macos x; android; linux; other variants of unix.
...And 2 more matches
Date and Time
nspr provides types and constants for both representations, and functions to convert time values between the two.
...the nspr data type for clock/calendar time, called an exploded time, has the time zone information in it, so that its corresponding point in absolute time is uniquely specified.
... macros for time unit conversion types and constants time parameter callback functions functions macros for time unit conversion macros for converting between seconds, milliseconds, microseconds, and nanoseconds.
...And 2 more matches
PRIOMethods
syntax #include <prio.h> struct priomethods { prdesctype file_type; prclosefn close; prreadfn read; prwritefn write; pravailablefn available; pravailable64fn available64; prfsyncfn fsync; prseekfn seek; prseek64fn seek64; prfileinfofn fileinfo; prfileinfo64fn fileinfo64; prwritevfn writev; prconnectfn connect; pracceptfn accept; prbindfn bind; prlistenfn listen; prshutdownfn shutdown; prrecvfn recv; prsendfn send; prrecvfromfn recvfrom; prsendtofn sendto; prpollfn poll; pracceptreadfn acceptread; prtransmitfilefn transmitfile; prgetsocknamefn getsockname; prgetpeernamefn getpeername; prgetsockoptfn getsockopt; prsetsockoptfn setsockopt; }; typedef struct priomethods priomethods; p...
...arameters file_type type of file represented (tos).
... description you don't need to know the type declaration for each function listed in the method table unless you are implementing a layer.
...And 2 more matches
NSS 3.22 release notes
these functions take an explicit mechanism and parameters as arguments rather than inferring it from the key type using pk11_mapsignkeytype().
... the mechanism type ckm_rsa_pkcs_pss is now supported for rsa in addition to ckm_rsa_pkcs.
... the ck_rsa_pkcs_pss mechanism takes a parameter of type ck_rsa_pkcs_pss_params.
...And 2 more matches
Hashing - sample 1
*/ /* nspr headers */ #include <prprf.h> #include <prtypes.h> #include <plgetopt.h> #include <prio.h> /* nss headers */ #include <secoid.h> #include <secmodt.h> #include <sechash.h> #include <nss.h> typedef struct { const char *hashname; secoidtag oid; } nametagpair; /* the hash algorithms supported */ static const nametagpair hash_names[] = { { "md2", sec_oid_md2 }, { "md5", sec_oid_md5 }, { "sha1", sec_oid_sha1 }, { "sha256"...
... pr_fprintf(out, "%02x", data[i]); column += 2; break; } if (column > 76 || (i % 16 == limit)) { newline(out); column = level; limit = i % 16; } } if (column != level) { newline(out); } } /* * prints a usage message and exits */ static void usage(const char *progname) { int htype; int hash_algtotal = sizeof(hash_names) / sizeof(hash_names[0]); fprintf(stderr, "usage: %s -t type [ < input ] [ > output ]\n", progname); fprintf(stderr, "%-20s specify the digest method (must be one of\n", "-t type"); fprintf(stderr, "%-20s ", ""); for (htype = 0; htype < hash_algtotal; htype++) { fprintf(stderr, hash_names[htype].hashname); if...
... (htype == (hash_algtotal - 2)) fprintf(stderr, " or "); else if (htype != (hash_algtotal - 1)) fprintf(stderr, ", "); } fprintf(stderr, " (case ignored))\n"); fprintf(stderr, "%-20s define an input file to use (default is stdin)\n", "< input"); fprintf(stderr, "%-20s define an output file to use (default is stdout)\n", "> output"); exit(-1); } /* * check for the missing arguments */ static void printmsgandexit(const char *progname, char opt) { fprintf(stderr, "%s: option -%c requires an argument\n", progname, opt); usage(progname); } #define require_arg(opt,value) if (!(value)) printmsgandexit(progname, opt) /* * digests a file according to the specified algorithm.
...And 2 more matches
sample1
/* nspr headers */ #include <prprf.h> #include <prtypes.h> #include <plgetopt.h> #include <prio.h> #include <prprf.h> /* nss headers */ #include <secoid.h> #include <secmodt.h> #include <sechash.h> typedef struct { const char *hashname; secoidtag oid; } nametagpair; /* the hash algorithms supported */ static const nametagpair hash_names[] = { { "md2", sec_oid_md2 }, { "md5", sec_oid_md5 }, { "sha1", sec_oid_sha1 }, { "sha256", sec_oid_sha256 }, { "sha384", sec_oid_sha384 }, { "sha512", sec_oid_sha512 } }; /* maps a hash name to a secoidtag.
..._fprintf(out, "%02x", data[i]); column += 2; break; } if (column > 76 || (i % 16 == limit)) { newline(out); column = level; limit = i % 16; } } if (column != level) { newline(out); } } /* prints a usage message and exits */ static void usage(const char *progname) { int htype; int hash_algtotal = sizeof(hash_names) / sizeof(hash_names[0]); fprintf(stderr, "usage: %s -t type [ < input ] [ > output ]\n", progname); fprintf(stderr, "%-20s specify the digest method (must be one of\n", "-t type"); fprintf(stderr, "%-20s ", ""); for (htype = 0; htype < hash_algtotal; htype++) { fprintf(stderr, hash_names[htype].hashname); ...
... if (htype == (hash_algtotal - 2)) fprintf(stderr, " or "); else if (htype != (hash_algtotal - 1)) fprintf(stderr, ", "); } fprintf(stderr, " (case ignored))\n"); fprintf(stderr, "%-20s define an input file to use (default is stdin)\n", "< input"); fprintf(stderr, "%-20s define an output file to use (default is stdout)\n", "> output"); exit(-1); } /* check for the missing arguments */ static void printmsgandexit(const char *progname, char opt) { fprintf(stderr, "%s: option -%c requires an argument\n", progname, opt); usage(progname); } #define require_arg(opt,value) if (!(value)) printmsgandexit(progname, opt) /* digests a file according to the specified algorithm.
...And 2 more matches
NSS PKCS11 Functions
syntax #include <pk11pub.h> #include <prtypes.h> prbool pk11_ishw(pk11slotinfo *slot); parameters this function has the following parameter: slot a pointer to a slot info structure.
...syntax #include <pk11pub.h> #include <prtypes.h> prbool pk11_ispresent(pk11slotinfo *slot); parameters this function has the following parameter: slot a pointer to a slot info structure.
...syntax #include <pk11pub.h> #include <prtypes.h> prbool pk11_isreadonly(pk11slotinfo *slot); parameters this function has the following parameter: slot a pointer to a slot info structure.
...And 2 more matches
OLD SSL Reference
pkcs #11, and the default security databases setting up the certificate and key databases setting up the ca db and certificate setting up the server db and certificate setting up the client db and certificate verifying the server and client certificates building nss programs chapter 3 selected ssl types and structures this chapter describes some of the most important types and structures used with the functions described in the rest of this document, and how to manage the memory used for them.
... additional types are described with the functions that use them or in the header files.
... types and structures certcertdbhandle certcertificate pk11slotinfo secitem seckeyprivatekey secstatus managing secitem memory secitem_freeitem secitem_zfreeitem chapter 4 ssl functions this chapter describes the core ssl functions.
...And 2 more matches
pkfnc.html
syntax #include <pk11func.h> #include <prtypes.h> prbool pk11_ishw(pk11slotinfo *slot); parameters this function has the following parameter: slot a pointer to a slot info structure.
... syntax #include <pk11func.h> #include <prtypes.h> prbool pk11_ispresent(pk11slotinfo *slot); parameters this function has the following parameter: slot a pointer to a slot info structure.
... syntax #include <pk11func.h> #include <prtypes.h> prbool pk11_isreadonly(pk11slotinfo *slot); parameters this function has the following parameter: slot a pointer to a slot info structure.
...And 2 more matches
NSS Tools certutil
syntax to run the certificate database tool, type the command certutil option [arguments ] where options and arguments are combinations of the options and arguments listed in the following section.
... -k rsa|dsa|all specify the type of a key: rsa, dsa or both.
...by specifying the type of key you can avoid mistakes caused by duplicate nicknames.
...And 2 more matches
NSS tools : signtool
note that with netscape signing tool version 1.1 and later this option can appear multiple times on one command line, making it possible to specify multiple file types or classes to include.
...this special type of entry does not have to appear in the jar file itself.
...in all cases, the certificate is also output to a file named x509.cacert, which has the mime-type application/x-x509-ca-cert.
...And 2 more matches
Rhino overview
array.prototype.tostring and object.prototype.tostring version 1.2 only returns array or object literal notation ("[1]" or "{a:1, b:2}" for example).
... string.prototype.substring for version 1.2 only, the two arguments are not swapped if the first argument is less than the second one.
... string.prototype.split for version 1.2 only, split performs the perl4 special case when given a single space character as an argument (skips leading whitespace, and splits on whitespace).
...And 2 more matches
Rhino serialization
javascript objects contain references to prototypes and to parent scopes.
... default serialization would serialize the object or function we desired but would also serialize object.prototype or even possibly the entire top-level scope and everything it refers to!
... we want to be able to serialize a javascript object and then deserialize it into a new scope and have all of the references from the deserialized object to prototypes and parent scopes resolved correctly to refer to objects in the new scope.
...And 2 more matches
Hacking Tips
$ gdb --args js […] (gdb) b js::reportoverrecursed (gdb) r js> function f(i) { if (i % 2) f(i + 1); else f(i + 3); } js> f(0) breakpoint 1, js::reportoverrecursed (maybecx=0xfdca70) at /home/nicolas/mozilla/ionmonkey/js/src/jscntxt.cpp:495 495 if (maybecx) (gdb) call js::dumpbacktrace(maybecx) #0 (nil) typein:2 (0x7fffef1231c0 @ 0) #1 (nil) typein:2 (0x7fffef1231c0 @ 24) #2 (nil) typein:3 (0x7fffef1231c0 @ 47) #3 (nil) typein:2 (0x7fffef1231c0 @ 24) #4 (nil) typein:3 (0x7fffef1231c0 @ 47) […] #25157 0x7fffefbbc250 typein:2 (0x7fffef1231c0 @ 24) #25158 0x7fffefbbc1c8 typein:3 (0x7fffef1231c0 @ 47) #25159 0x7fffefbbc140 typein:2 (0x7fffef1231c0 @ 24)...
... #25160 0x7fffefbbc0b8 typein:3 (0x7fffef1231c0 @ 47) #25161 0x7fffefbbc030 typein:5 (0x7fffef123280 @ 9) note, you can do the exact same exercise above using lldb (necessary on osx after apple removed gdb) by running lldb -f js then following the remaining steps.
... $ gdb --args out/dist/bin/js ./foo.js […] spidermonkey unwinder is disabled by default, to enable it type: enable unwinder .* spidermonkey (gdb) b js::math_cos (gdb) run […] #0 js::math_cos (cx=0x14f2640, argc=1, vp=0x7fffffff6a88) at js/src/jsmath.cpp:338 338 callargs args = callargsfromvp(argc, vp); (gdb) enable unwinder .* spidermonkey (gdb) backtrace 10 #0 0x0000000000f89979 in js::math_cos(jscontext*, unsigned int, js::value*) (cx=0x14f2640, argc=1, vp=0x7fffffff6a88) at js/src/jsmath.cpp:338 #1 0x0000000000ca9c6e in js::calljsnative(jscontext*, bool (*)(jscontext*, unsigned int, js::value*), js::...
...And 2 more matches
JS::IdentifyStandardInstance
this article covers features introduced in spidermonkey 31 determine if the given object is an instance/prototype/constructor for a standard class.
... syntax jsprotokey js::identifystandardinstance(jsobject *obj); jsprotokey js::identifystandardprototype(jsobject *obj); jsprotokey js::identifystandardinstanceorprototype(jsobject *obj); jsprotokey js::identifystandardconstructor(jsobject *obj); // added in spidermonkey 38 name type description obj jsobject * pointer to the instance/prototype/constructor object to determine.
... js::identifystandardprototype determines if the given object is a prototype for a standard class.
...And 2 more matches
JS::Rooted
this article covers features introduced in spidermonkey 17 local variable of type t whose value is always rooted.
... syntax js::rooted<t> var(cx); js::rooted<t> var(cx, initial); js::rooted<t> var(rt); js::rooted<t> var(rt, initial); name type description cx jscontext * the context in which to add the root.
... methods here, ptr represents the private member of js::rooted<t>, typed with t.
...And 2 more matches
JS::ToPrimitive
syntax bool js::toprimitive(jscontext *cx, js::handleobject obj, jstype hint, js::mutablehandlevalue vp); name type description cx jscontext * the context in which to perform the conversion.
... hint jstype the hint to pass to the toprimitive and @@toprimitive method when converting the object.
... hint must be jstype_string or jstype_number to pass the corresponding type as a hint, or jstype_void to pass no hint.
...And 2 more matches
JSErrorFormatString
this article covers features introduced in spidermonkey 17 represent error message and type.
... syntax typedef struct jserrorformatstring { const char *format; uint16_t argcount; int16_t exntype; } jserrorformatstring; name type description format const char * the error format string in ascii.
... exntype int16_t one of the jsexntype constants.
...And 2 more matches
JSExtendedClass.wrappedObject
syntax typedef jsobject * (*jsobjectop)(jscontext *cx, jsobject *obj); name type description cx jscontext * the context in which the object is being unwrapped.
... in typeof expressions and in js_typeofvalue, the type of the wrapped object is returned.
... object.prototype.eval unwraps.
...And 2 more matches
JSHasInstanceOp
jshasinstanceop is the type of jsclass.hasinstance.
... syntax typedef bool (* jshasinstanceop)(jscontext *cx, js::handleobject obj, js::mutablehandlevalue vp, bool *bp); name type description cx jscontext * the js context in which the type check is occurring.
... obj js::handleobject the "type" in the type check.
...And 2 more matches
JSNewResolveOp
jsnewresolveop is the type of the jsclass.resolve callback when the jsclass_new_resolve bit is set in the jsclass.flags field.
... syntax typedef bool (* jsnewresolveop)(jscontext *cx, js::handleobject obj, js::handleid id, js::mutablehandleobject objp); name type description cx jscontext * pointer to the js context in which the property access is taking place.
...on success, the callback must set the *objp out parameter to null if id was not resolved; or non-null, referring to obj or one of its prototypes, if id was resolved; and return js_true.
...And 2 more matches
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.
...And 2 more matches
JS_GetLocaleCallbacks
syntax jslocalecallbacks * js_getlocalecallbacks(jsruntime *rt); void js_setlocalecallbacks(jsruntime *rt, jslocalecallbacks *callbacks); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... callback functions struct jslocalecallbacks { jslocaletouppercase localetouppercase; jslocaletolowercase localetolowercase; jslocalecompare localecompare; // not used #if expose_intl_api jslocaletounicode localetounicode; }; typedef bool (* jslocaletouppercase)(jscontext *cx, js::handlestring src, js::mutablehandlevalue rval); typedef bool (* jslocaletolowercase)(jscontext *cx, js::handlestring src, js::mutablehandlevalue rval); typedef bool (* jslocalecompare)(jscontext *cx, js::handlestring src1, js::handlestring src2, js::mutablehandlevalue rval); typedef bool (* jslocaletounicode)(jscontext *cx,...
... const char *src, js::mutablehandlevalue rval); type description jslocaletouppercase implementation of string.prototype.tolocaleuppercase() function.
...And 2 more matches
JS_InstanceOf
syntax bool js_instanceof(jscontext *cx, js::handle<jsobject*> obj, const jsclass *clasp, js::callargs *args); // added in spidermonkey 38 bool js_instanceof(jscontext *cx, js::handle<jsobject*> obj, const jsclass *clasp, jsval *argv); // obsolete since jsapi 32 name type description cx jscontext * pointer to a js context from which to derive runtime information.
...if non-null, report an error if obj is not of type clasp.
...if non-null, report an error if obj is not of type clasp.
...And 2 more matches
JS_ReportErrorNumber
flags, jserrorcallback errorcallback, void *userref, const unsigned errornumber, ...); void js_reporterrornumberucarray(jscontext *cx, jserrorcallback errorcallback, void *userref, const unsigned errornumber, const char16_t **args); // added in spidermonkey 19 name type description cx jscontext * the context in which to report the error.
...these arguments must be of type char * for js_reporterrornumber or js_reporterrorflagsandnumber, or char16_t * for js_reporterrornumberuc or js_reporterrorflagsandnumberuc.
... callback syntax typedef const jserrorformatstring * (* jserrorcallback)(void *userref, const unsigned errornumber); name type description userref void * the userref pointer that was passed to the reporterrornumber api.
...And 2 more matches
Property attributes
the jsapi expresses property attributes as a value of type unsigned, the bitwise or of zero or more of the jsprop flags described below.
...(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; the prototype's .x is not shared with its children.
...And 2 more matches
History Service Design
this involves storing informations on all of the user's visits, including visit time, type of visit and meta data.
...this table has common attributes for a page like typed, hidden and frecency.
...typed means the page as a typed visit, hidden means the page should not be shown in autocomplete, while frecency is the relevance the page will have in locationbar queries.
...And 2 more matches
Creating a Python XPCOM component
pay special attention to types here - python and javascript are both loosely-typed, so it's fairly easy to pass information from one to the other.
...see here for info on describing interfaces, and on which types can be used.
... registering the interface in the "components" directory, execute : ../xpidl -m typelib -w -v -i /usr/share/idl/mozilla/ nsipysimple.idl on windows you must point to the idl directory as part of your mozilla build.
...And 2 more matches
XPCOM changes in Gecko 2.0
however, it's very easy to do, and you can actually support both types of registration for backward compatibility.
...for example, in your component's javascript code : components.utils.import("resource://gre/modules/xpcomutils.jsm"); function mycomponent() { } mycomponent.prototype = { // this must match whatever is in chrome.manifest!
...each component prototype // must have a .classid which is used to create it.
...And 2 more matches
Setting up the Gecko SDK
application name description of functionality regxpcom.exe registers or unregisters components with xpcom xpidl.exe generates typelib and c++ headers from xpidl xpt_dump.exe prints out information about a given typelib xpt_link.exe combines multiple typelibs into a single typelib library name description of functionality xpcomglue.lib xpcom glue library to be used by xpcom components.
...in the win32 dynamic-link library dialog that displays (see below), you can choose the default selection "an empty dll project" as the type of dll.
... xpidl -m header ispecialthing.idl xpidl -m typelib ispecialthing.idl the code add the main code, the real work horse.
...And 2 more matches
XPCOM hashtable guide
any type: almost any datatype can be used as key, including strings, integers, xpcom interface pointers, iids, and almost anything else.
... the appropriate hashtable class to use depends solely on the data type.
... the template specialization to use depends on the data type and the key type.
...And 2 more matches
Introduction to XPCOM for the DOM
the argument list and return type are turned into correct c++ types according to rules not described here.
...the argument is a pointer to an object of type prbool, automatically generated by xpidl.
... then type "make" in dom/ to build the interface.
...And 2 more matches
mozIStorageConnection
method overview void asyncclose([optional] in mozistoragecompletioncallback acallback); void begintransaction(); void begintransactionas(in print32 transactiontype); mozistoragestatement clone([optional] in boolean areadonly); void close(); void committransaction(); void createaggregatefunction(in autf8string afunctionname, in long anumarguments, in mozistorageaggregatefunction afunction); mozistorageasyncstatement createasyncstatement(in autf8string asqlstatement); void createfunction(in autf8string...
... mozistorageprogresshandler removeprogresshandler(); void rollbacktransaction(); void setgrowthincrement(in print32 aincrement, in autf8string adatabasename); mozistorageprogresshandler setprogresshandler(in print32 agranularity, in mozistorageprogresshandler ahandler); boolean tableexists(in autf8string atablename); attributes attribute type description connectionready boolean indicates if the connection is open and ready to use.
... begintransactionas() this method starts a new transaction of the given transaction type.
...And 2 more matches
nsIContentSniffer
components implementing this interface can determine a mime type from a chunk of bytes.
...method overview acstring getmimetypefromcontent(in nsirequest arequest, [const,array,size_is(alength)] in octet adata, in unsigned long alength); methods getmimetypefromcontent() given a chunk of data, determines a mime type.
...especially, they should not attempt to set the content type property that subclasses of nsirequest might offer.
...And 2 more matches
nsICryptoHash
this method may be called multiple times with different algorithm types.
... exceptions thrown ns_error_invalid_arg indicates that an unsupported algorithm type was passed initwithstring() initialize the hashing object.
... this method may be called multiple times with different algorithm types.
...And 2 more matches
nsIDOMSimpleGestureEvent
1.0 66 introduced gecko 1.9.1 inherits from: nsidommouseevent last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) the nsidomsimplegestureevent interface is the datatype for all mozilla-specific simple gesture events in the document object model.
... method overview void initsimplegestureevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in unsigned long directionarg, in double deltaarg); ...
... attributes attribute type description delta double the delta value indicating how far the gesture moved.
...And 2 more matches
nsIExternalHelperAppService
uriloader/exthandler/nsiexternalhelperappservice.idlscriptable the external helper app service is used for finding and launching platform specific external applications for a given mime content type.
...to access this service, use: var externalhelperappservice = components.classes["@mozilla.org/uriloader/external-helper-app-service;1"] .getservice(components.interfaces.nsiexternalhelperappservice); method overview boolean applydecodingforextension(in autf8string aextension, in acstring aencodingtype); nsistreamlistener docontent(in acstring amimecontenttype, in nsirequest arequest, in nsiinterfacerequestor awindowcontext, in boolean aforcesave); methods applydecodingforextension() determines whether or not data whose filename has the specified extension should be decoded from the specified encoding type before being saved or delivered to helper applications.
... boolean applydecodingforextension( in autf8string aextension, in acstring aencodingtype ); parameters aextension the filename extension to check.
...And 2 more matches
nsIFilePicker
rfaces.nsifilepicker); method overview void appendfilter(in astring title, in astring filter); void appendfilters(in long filtermask); void init(in nsidomwindow parent, in astring title, in short mode); void open(in nsifilepickershowncallback afilepickershowncallback); short show(); obsolete since gecko 57.0 attributes attribute type description addtorecentdocs boolean if true, the file is added to the operating system's "recent documents" list (if the operating system has one; nothing happens if there is no such concept on the user's platform).
... defaultextension astring the extension for the type of files you want to work with.
... constants mode constants these constants are used to specify the type of file picker to create when calling init().
...And 2 more matches
nsIFileView
to create an instance, use: var fileview = components.classes["@mozilla.org/filepicker/fileview;1"] .createinstance(components.interfaces.nsifileview); method overview void setdirectory(in nsifile directory); void setfilter(in astring filterstring); void sort(in short sorttype, in boolean reversesort); attributes attribute type description reversesort boolean if true results will be sorted in ascending order.
... sorttype short the current sort type in effect.
...void sort( in short sorttype, in boolean reversesort ); parameters sorttype one of the sort* constants.
...And 2 more matches
nsIFrameLoader
method overview void activateframeevent(in astring atype, in boolean capture); void activateremoteframe(); void destroy(); void loadframe(); void loaduri(in nsiuri auri); void sendcrossprocesskeyevent(in astring atype, in long akeycode, in long acharcode, in long amodifiers, [optional] in boolean apreventdefault); void sendcrossprocessmouseevent(in astring atype, in float ax, in float ay, in lon...
... attributes attribute type description delayremotedialogs boolean depthtoogreat boolean find out whether the loader's frame is at too great a depth in the frame tree.
... void activateframeevent( in astring atype, in boolean capture ); parameters atype the event type for which to enable forwarding.
...And 2 more matches
nsIHttpHeaderVisitor
void visitheader( in acstring aheader, in acstring avalue ); parameters aheader a string containing the key for a header such as "content-type" avalue the header's value field such as "text/html".
...it implements the nsihttpheadervisitor interface in javascript and uses it to evaluate the mime type of a http response.
...when the observer fires, the visitor interface is used to walk through the response headers and evaluate the mime type.
...And 2 more matches
nsIMemoryReporter
attributes attribute type description amount print64 the numeric value reported by the memory reporter, specified in the units indicated by the units attribute.
... note: this attribute was called memoryused prior to gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4), and its type was long long.
... units print32 the units used by the amount attribute; this will be one of the unit type constants.
...And 2 more matches
nsIProxyInfo
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports attributes attribute type description failoverproxy nsiproxyinfo this attribute specifies the proxy to failover to when this proxy fails.
... flags unsigned long this attribute specifies flags that modify the proxy type.
... type acstring this attribute specifies the type of the proxy server as a case insensitive ascii string.
...And 2 more matches
nsISHEntry
.createinstance(components.interfaces.nsishentry); method overview void addchildshell(in nsidocshelltreeitem shell); nsidocshelltreeitem childshellat(in long index); void clearchildshells(); nsishentry clone(); void create(in nsiuri uri, in astring title, in nsiinputstream inputstream, in nsilayouthistorystate layouthistorystate, in nsisupports cachekey, in acstring contenttype, in nsisupports owner, in unsigned long long docshellid, in boolean dynamiccreation); native code only!
... void syncpresentationstate(); attributes attribute type description cachekey nsisupports set and get the cache key for the entry.
... contenttype acstring indicates the content-type of the document that this is a session history entry for.
...And 2 more matches
nsISocketTransport
unsigned long gettimeout(in unsigned long atype); boolean isalive(); void settimeout(in unsigned long atype, in unsigned long avalue); attributes attribute type description connectionflags unsigned long a bitmask that can be used to modify underlying behavior of the socket connection.
... constants timeout type this constants are used by gettransport() and settransport() to specify socket timeouts constant value description timeout_connect 0 connecting timeout.
...unsigned long gettimeout( in unsigned long atype ); parameters atype the timeout type, who's associated value should be retrieved.
...And 2 more matches
nsISupports proxies
about xpcom proxies a proxy, in this context, is a stub object which enables a method of any class which is derived from nsisupports and has a typelib to be called on any in-process thread.
...it has two entry points: ns_imethod getproxyforobject(nsieventqueue *destqueue, const nsiid & iid, nsisupports *object, print32 proxytype, void * *result); ns_imethod getproxy(nsieventqueue *destqueue, const nsiid & cid, nsisupports *aouter, const nsiid & iid, print32 proxytype, void * *result); the two apis are essentially the same.
... the iid that you are requesting must be in the typelib.
...And 2 more matches
nsITreeColumn
nsitreecolumn getnext(); nsitreecolumn getprevious(); void invalidate(); attributes attribute type description atom nsiatom the atom attribute of nsitreecolumn which returns an nsiatom for the column, making it fast to do comparisons.
... type short the type of the column, see constants.
... constants constant value description type_text 1 text column type.
...And 2 more matches
nsITreeView
; void performactiononrow(in wstring action, in long row); void selectionchanged(); void setcelltext(in long row, in nsitreecolumn col, in astring value); void setcellvalue(in long row, in nsitreecolumn col, in astring value); void settree(in nsitreeboxobject tree); void toggleopenstate(in long index); attributes attribute type description rowcount long the total number of rows in the tree (including the offscreen rows).
...this method is only called for columns of type other than text.
...this method is only called for columns of type progressmeter.
...And 2 more matches
nsIXPCScriptable
erate(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in pruint32 enum_op, in jsvalptr statep, out jsid idp); prbool newresolve(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in jsval id, in pruint32 flags, out jsobjectptr objp); prbool convert(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in pruint32 type, in jsvalptr vp); void finalize(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); prbool checkaccess(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in jsval id, in pruint32 mode, in jsvalptr vp); prbool call(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in pruint32 argc, in jsvalptr argv, in jsvalptr...
...native wrapper, in jstracerptr trc, in jsobjectptr obj); prbool equality(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in jsval val); jsobjectptr outerobject(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); jsobjectptr innerobject(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); void postcreateprototype(in jscontextptr cx, in jsobjectptr proto); attributes attribute type description classname string scriptableflags pruint32 the bitwise or'd set of flags (define below) that indicate the behavior of this object.
... 14 want_hasinstance 1 << 15 want_trace 1 << 16 use_jsstub_for_addproperty 1 << 17 use_jsstub_for_delproperty 1 << 18 use_jsstub_for_setproperty 1 << 19 dont_enum_static_props 1 << 20 dont_enum_query_interface 1 << 21 dont_ask_instance_for_scriptable 1 << 22 classinfo_interfaces_only 1 << 23 allow_prop_mods_during_resolve 1 << 24 allow_prop_mods_to_prototype 1 << 25 dont_share_prototype 1 << 26 dont_reflect_interface_names 1 << 27 want_equality 1 << 28 want_outer_object 1 << 29 want_inner_object 1 << 30 reserved 1 << 31 the high order bit is reserved for consumers of these flags.
...And 2 more matches
nsIXmlRpcClient
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void init(in string serverurl); void setauthentication(in string username, in string password); void clearauthentication(in string username, in string password); void setencoding(in string encoding); void setencoding(in unsigned long type, out nsiidref uuid, out nsqiresult result); void asynccall (in nsixmlrpcclientlistener listener, in nsisupports ctxt, in string methodname, in nsisupports arguments, in pruint32 count); attributes attribute type description serverurl readonly nsiurl the url of the xml-rpc server inprogress readonly boolean whether or not a call is in progress fault readonly nsixmlrpcfault the most r...
... constants constant type description int unsigned long nsisupportsprint32 boolean unsigned long nsisupportsprbool string unsigned long nsisupportscstring double unsigned long nsisupportsdouble datetime unsigned long nsisupportsprtime array readonly unsigned long nsisupportsarray struct readonly unsigned long nsisupportsdictionary methods init() set server url.
...isupportspruint8, nsisupportspruint16, nsisupportsprint16, nsisupportsprint32: i4, nsisupportsprbool: boolean, nsisupportschar, nsisupportscstring: string, nsisupportsfloat, nsisupportsdouble: double, nsisupportsprtime: datetime.iso8601, nsiinputstream: base64, nsisupportsarray: array, nsidictionary: struct note that both nsisupportsarray and nsidictionary can only hold any of the supported input types.
...And 2 more matches
Using the clipboard
for other types of data, such as urls or images, you will need to use a more complex method.
...you can use them to copy and paste any type of data from your application to the clipboard.
... tell the transferring object about the type of data being copied.
...And 2 more matches
nsCOMPtr versus RefPtr
general rule of thumb for nscomptr versus refptr the general rule of thumb is to use nscomptr<t> when t is an interface type, and refptr<t> when t is a concrete type.
... nscomptr<t> also requires that you can queryinterface to type t.
...it also requires that the argument singly inherit from nsisupports (since the type of the argument is nsisupports*).
...And 2 more matches
XPIDL Syntax
MozillaTechXPIDLSyntax
idl_file = 1*definition definition = [type_decl / const_decl / interface] ";" interface = [prop_list] "interface" ident [[inheritance] "{" *(ifacebody) "}"] inheritance = ":" *(scoped_name ",") scoped_name] ifacebody = [type_decl / op_decl /attr_decl / const_decl] ";" / codefrag type_decl = [prop_list] "typedef" type_spec *(ident ",") ident type_decl /= [prop_list] "native" ident [parens] const_decl = "const" type_spec ident "=" e...
...xpr op_decl = [prop_list] (type_spec / "void") parameter_decls raise_list parameter_decls = "(" [*(param_decl ",") param_decl] ")" param_decl = [prop_list] ("in" / "out" / "inout") type_spec ident attr_decl = [prop_list] ["readonly"] "attribute" type_spec *(ident ",") ident ; descending order of precedence expr /= expr ("|" / "^" / "&") expr ; unequal precedence "|" is lowest expr /= expr ("<<" / ">>") expr expr /= expr ("+" / "-") expr expr /= expr ("*" / "/" / "%") expr expr /= ["-" / "+" / "~"] (scoped_name / literal / "(" expr ")" ) ; numeric literals: quite frankly, i'm sure you know how these kinds of ; literals work, and these are annoying to specify in abnf.
... string_literal = 1*(%x22 *(any char except %x22 or %x0a) (%x22 / %x0a)) ; same as above, but s/"/'/g char_literal = 1*(%x27 *(any char except %x27 or %x0a) (%x27 / %x0a)) type_spec = "float" / "double" / "string" / "wstring" type_spec /= ["unsigned"] ("short" / "long" / "long" "long") type_spec /= "char" / "wchar" / "boolean" / "octet" type_spec /= scoped_name prop_list = "[" *(property ",") property "]" property = ident [parens] raise_list = "raises" "(" *(scoped_name) ",") scoped_name ")" scoped_name = *(ident "::") ident / "::" ident ; in regex: [a-za-z_][a-za-z0-9_]*; id...
...And 2 more matches
pyxpidl
the pyxpidl tool suite has been built to replace the older xpidl tool which, in the past, was used to turn xpidl files into c++ headers and xpcom typelibs (xpt files).
...unlike xpidl, which combined all the functions into a single utility, pyxpidl is comprised of two utilities: header.py, which generates c++ headers from idl, and typelib.py, which generates xpt files.
... generating c++ headers to generate c++ headers, use the header.py utility: sdkdir/sdk/bin/header.py --cachedir=<path> -o <outputfilename.h> <filename.idl> generating typelibs generating typelib files is done using the typelib.py utility: sdkdir/sdk/bin/typelib.py --cachedir=<path> -o <outputfilename.xpt> <filename.idl> comparing pyxpidl to xpidl this table provides a mapping of old xpidl options to pyxpidl.
...And 2 more matches
Filelink Providers
the account setup dialog the account setup dialog allows the user to select what account type they would like to create from a menulist.
... example: <form id="provider-form" onsubmit="return false;"> <label for="username">username:</label> <input id="username" type="text" required="true" /> <label for="server">server:</label> <input id="server" type="text" required="true" /> <label for="port">port:</label> <input id="port" pattern="[0-9]+" required="true" /> </form> the form is expected to use html5 form validation.
...providers need only provide an extraargs function in the iframe content which returns an object specifying the name, type, and value to save.
...And 2 more matches
The libmime module
there is a class for each mime type, and each class is responsible for parsing itself, and/or handing the input data off to one of its child objects.
... there is one header file and one source file for each class (for example, the mimeinlinetext class is defined in "mimetext.h" and "mimetext.c".) each header file follows the following boiler-plate form: typedefs these come first to avoid circular dependencies.
... typedef struct foobarclass foobarclass; typedef struct foobar foobar; class declaration theis structure defines the callback routines and other per-class data of the class defined in this module.
...And 2 more matches
Waterfall - Firefox Developer Tools
it's based on the idea that the things a browser does when running a site can be divided into various types - running javascript, updating layout, and so on - and that at any given point in time, the browser is doing one of those things.
...this includes the marker's duration and some more information that's specific to the marker type.
... event type for example, "click" or "message".
...And 2 more matches
Web Console Helpers - Firefox Developer Tools
for example, if you type "2+2 <enter>", then "$_ <enter>", the console will print 4.
... $x(xpath, element, resulttype) evaluates the xpath xpath expression in the context of element and returns an array of matching nodes.
...the resulttype parameter specifies the type of result to return; it can be an xpathresult constant, or a corresponding string: "number", "string", "bool", "node", or "nodes"; if not provided, any_type is used.
...And 2 more matches
Attr - Web APIs
WebAPIAttr
in most dom methods, you will directly retrieve the attribute as a string (e.g., element.getattribute()), but certain functions (e.g., element.getattributenode()) or means of iterating return attr types.
... nodetype this property now always returns 2 (attribute_node).
... schematypeinfo read only the type information associated with this attribute.
...And 2 more matches
CanvasRenderingContext2D.setTransform() - Web APIs
syntax ctx.settransform(a, b, c, d, e, f); ctx.settransform(matrix); the transformation matrix is described by: [acebdf001]\left[ \begin{array}{ccc} a & c & e \\ b & d & f \\ 0 & 0 & 1 \end{array} \right] parameters settransform() has two types of parameter that it can accept.
... the older type consists of several parameters representing the individual components of the transformation matrix to set: a (m11) horizontal scaling.
... the newer type consists of a single parameter, matrix, representing a 2d transformation matrix to set (technically, a dommatrixinit object; any object will do as long as it contains the above components as properties).
...And 2 more matches
DOMError - Web APIs
WebAPIDOMError
properties domerror.name read only returns a domstring representing one of the error type names (see below).
... domerror.message read only returns a domstring representing a message or description associated with the given error type name.
... error types type description indexsizeerror the index is not in the allowed range (e.g.
...And 2 more matches
DOMHighResTimeStamp - Web APIs
the domhighrestimestamp type is a double and is used to store a time value in milliseconds.
... this type can be used to describe a discrete point in time or a time interval (the difference in time between two discrete points in time).
... properties this type has no properties.
...And 2 more matches
DataTransfer.items - Web APIs
example this example shows the use of the items and types properties.
... <!doctype html> <html lang=en> <title>examples of datatransfer.{types,items} properties</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #target { border: 1px solid black; } </style> <script> function dragstart_handler(ev) { console.log("dragstart: target.id = " + ev.target.id); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree ev.datatransfer.setdata("text/plain", ev.target.id); ev.datatransfer.effectallowed = "move"; } function drop_handler(ev) { console.log("drop: target.id = " + ev.target.id); ev.preventdefault(); // get the id of the target and add the moved element to the target's dom var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document...
....getelementbyid(data)); // print each format type if (ev.datatransfer.types != null) { for (var i=0; i < ev.datatransfer.types.length; i++) { console.log("...
...And 2 more matches
Document.createEvent() - Web APIs
creates an event of the type specified.
... syntax var event = document.createevent(type); event is the created event object.
... type is a string that represents the type of event to be created.
...And 2 more matches
Traversing an HTML table with JavaScript and DOM Interfaces - Web APIs
example: creating an html table dynamically (sample1.html) html <input type="button" value="generate a table." onclick="generate_table()"> javascript function generate_table() { // get the reference for the body var body = document.getelementsbytagname("body")[0]; // creates a <table> element and a <tbody> element var tbl = document.createelement("table"); var tblbody = document.createelement("tbody"); // creating all cells for (var i = 0; i < 2; i++) ...
... html <body> <input type="button" value="set paragraph background color" onclick="set_background()"> <p>hi</p> <p>hello</p> </body> javascript function set_background() { // get a list of all the body elements (there will only be one), // and then select the zeroth (or first) such element mybody = document.getelementsbytagname("body")[0]; // now, get all the p elements that are descendants of the body my...
... mytextnode = document.createtextnode("world"); this means that you have created a node of the type text_node (a piece of text) whose text data is "world", and mytextnode is your reference to this node object.
...And 2 more matches
Document Object Model (DOM) - Web APIs
dom interfaces attr cdatasection characterdata childnode comment customevent document documentfragment documenttype domerror domexception domimplementation domstring domtimestamp domstringlist domtokenlist element event eventtarget htmlcollection mutationobserver mutationrecord namednodemap node nodefilter nodeiterator nodelist nondocumenttypechildnode parentnode processinginstruction selection range text textdecoder textencoder timeranges treewalker url window worker xm...
... be reintroduced in the future or not, but for the time being they should be considered obsolete and should be avoided: documenttouch domconfiguration domerrorhandler domimplementationlist domimplementationregistry domimplementationsource domlocator domobject domsettabletokenlist domuserdata elementtraversal entity entityreference namelist notation typeinfo userdatahandler html dom a document containing html is described using the document interface, which is extended by the html specification to include various html-specific features.
...radialgradientelement svgrectelement svgscriptelement svgsetelement svgsolidcolorelement svgstopelement svgstyleelement svgsvgelement svgswitchelement svgsymbolelement svgtextcontentelement svgtextelement svgtextpathelement svgtextpositioningelement svgtitleelement svgtrefelement svgtspanelement svguseelement svgunknownelement svgviewelement svgvkernelement svg data type interfaces here are the dom apis for data types used in the definitions of svg properties and attributes.
...And 2 more matches
FetchEvent.respondWith() - Web APIs
for security reasons, there are a few global rules: you can only return response objects of type "opaque" if the fetchevent.request object's mode is "no-cors".
... you can only return response objects of type "opaqueredirect" if the fetchevent.request object's mode is "manual".
... you cannot return response objects of type "cors" if the fetchevent.request object's mode is "same-origin".
...And 2 more matches
FileList - Web APIs
WebAPIFileList
an object of this type is returned by the files property of the html <input> element; this lets you access the list of files selected with the <input type="file"> element.
... using the file list all <input> element nodes have a files attribute of type filelist on them which allows access to the items in this list.
... for example, if the html includes the following file input: <input id="fileitem" type="file"> the following line of code fetches the first file in the node's file list as a file object: var file = document.getelementbyid('fileitem').files[0]; method overview file item(index); properties attribute type description length integer a read-only value indicating the number of files in the list.
...And 2 more matches
HTMLCanvasElement.toDataURL() - Web APIs
the htmlcanvaselement.todataurl() method returns a data uri containing a representation of the image in the format specified by the type parameter (defaults to png).
... if the requested type is not image/png, but the returned value starts with data:image/png, then the requested type is not supported.
... chrome also supports the image/webp type.
...And 2 more matches
HTMLInputElement.stepUp() - Web APIs
the htmlinputelement.stepup() method increments the value of a numeric type of <input> element by the value of the step attribute, or the default step value if the step attribute is not explicitly set.
... input type default step value example step declaration date 1 (day) 7 day (one week) increments: <input type="date" min="2019-12-25" step="7"> month 1 (month) 12 month (one year) increments: <input type="month" min="2019-12" step="12"> week 1 (week) two week increments: <input type="week" min="2019-w23" step="2"> time 60 (seconds) 900 second (15 minute) increments: <input type="time" min="09:00" step="900"> datetime-local 1 (day) same day of the week: <input type="datetime-local" min="019-12-25t19:30" step="7"> ...
... number 1 0.1 increments <input type="number" min="0" step="0.1" max="10"> range 1 increments by 2: <input type="range" min="0" step="2" max="10"> the method, when invoked, changes the form control's value by the value given in the step attribute, multiplied by the parameter, within the constraints set on the form control.
...And 2 more matches
HTMLObjectElement - Web APIs
htmlobjectelement.codetype is a domstring that reflects the codetype html attribute, specifying the content type of the data.
... htmlobjectelement.type is a domstring that reflects the type html attribute, specifying the mime type of the resource.
... htmlobjectelement.typemustmatch is a boolean that reflects the typemustmatch html attribute, indicating if the resource specified by data must only be played if it matches the type attribute.
...And 2 more matches
HTMLParamElement - Web APIs
htmlparamelement.type is a domstring containing the type of the parameter when valuetype has the "ref" value.
... it reflects the type attribute.
... htmlparamelement.valuetype is a domstring containing the type of the value.
...And 2 more matches
Ajax navigation example - Web APIs
first_page.php: <?php $page_title = "first page"; $as_json = false; if (isset($_get["view_as"]) && $_get["view_as"] == "json") { $as_json = true; ob_start(); } else { ?> <!doctype html> <html> <head> <?php include "include/header.php"; echo "<title>" .
...ragraph is shown only when the navigation starts from <strong>first_page.php</strong>.</p> <?php include "include/after_content.php"; echo "</body>\n</html>"; } ?> second_page.php: <?php $page_title = "second page"; $as_json = false; if (isset($_get["view_as"]) && $_get["view_as"] == "json") { $as_json = true; ob_start(); } else { ?> <!doctype html> <html> <head> <?php include "include/header.php"; echo "<title>" .
...this content is stored into a php variable.</p>"; if (isset($_get["view_as"]) && $_get["view_as"] == "json") { echo json_encode(array("page" => $page_title, "content" => $page_content)); } else { ?> <!doctype html> <html> <head> <?php include "include/header.php"; echo "<title>" .
...And 2 more matches
LocalFileSystem - Web APIs
(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.
... //taking care of the browser-specific prefix window.requestfilesystem = window.requestfilesystem || window.webkitrequestfilesystem; // the first parameter defines the type of storage: persistent or temporary // next, set the size of space needed (in bytes) // initfs is the success callback // and the last one is the error callback // for denial of access and other errors.
... window.requestfilesystem(window.persistent, 1024*1024,oninitfs,errorhandler); method overview void requestfilesystem (in unsigned short type, in unsigned long long size, in filesystemcallback successcallback, in optional errorcallback errorcallback); void resolvelocalfilesystemurl (in domstring url, in entrycallback successcallback, in optional errorcallback errorcallback); constants constant value description temporary 0 transient storage that can be be removed by the browser at its discretion.
...And 2 more matches
MediaRecorder() - Web APIs
the object can optionally be configured to record using a specific media container (file type), and, further, can specify the exact codec and codec configuration(s) to use by specifying the codecs parameter.
... 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 supported by the user agent by calling mediarecorder.istypesupported().
...And 2 more matches
MediaRecorder - Web APIs
options are available to do things like set the container's mime type (such as "video/webm" or "video/mp4") and the bit rates of the audio and video tracks or a single overall bit rate.
... properties mediarecorder.mimetype read only returns the mime type that was selected as the recording container for the mediarecorder object when it was created.
... static methods mediarecorder.istypesupported() a static method which returns a boolean value indicating if the given mime media type is supported by the current user agent.
...And 2 more matches
PerformanceEntry.name - Web APIs
the name property of the performanceentry interface returns a value that further specifies the value returned by the performanceentry.entrytype property.
... syntax var name = entry.name; return value the return value depends on the subtype of the performanceentry object and the value of performanceentry.entrytype, as shown by the table below.
... value subtype entrytype values description url performanceframetiming, performancenavigationtiming frame, navigation the document's address.
...And 2 more matches
PerformanceEventTiming - Web APIs
the performanceeventtiming interface of the event timing api provides timing information for the event types listed below.
...observer.observe({entrytypes: ["event"]}); we can also directly query the first input delay.
... (navigator.sendbeacon && navigator.sendbeacon('/analytics', body)) || fetch('/analytics', {body, method: 'post', keepalive: true}); } // use a try/catch instead of feature detecting `first-input` // support, since some browsers throw when using the new `type` option.
...And 2 more matches
RTCIceCandidate.protocol - Web APIs
these values are defined by the enumerated type rtciceprotocol: tcp the candidate, if selected, would use tcp as the transport protocol for its data.
... the tcptype property provides additional information about the kind of tcp candidate represented by the object.
... usage notes here's an example candidate a-line from an ice transaction: a=candidate:4234997325 1 udp 2043278322 192.168.0.56 44323 typ host the third field, "udp", is the protocol type, indicating that the candidate would use the udp transport protocol.
...And 2 more matches
RTCIceCandidateStats - Web APIs
candidatetype optional a string matching one of the values in the rtcicecandidatetype enumerated type, indicating what kind of candidate the object provides statistics for.
... networktype optional a string from the rtcnetworktype enumerated type which indicates the type of interface used for a local candidate.
... example this example features a function, isusablenetworktype(), whose job it is to look at an rtcicecandidatestats object's networktype and determine whether or not the type of network is acceptable for use.
...And 2 more matches
RTCRtpCodecParameters - Web APIs
in addition to being the type of the rtcrtpparameters.codecs property, it's used when calling rtcrtptransceiver.setcodecpreferences() to configure a transceiver's codecs before beginning the offer/answer process to establish a webrtc peer connection.
... properties payloadtype optional the rtp payload type used to identify this codec.
... mimetype optional the codec's mime media type and subtype specified as a domstring of the form "type/subtype".
...And 2 more matches
Request.destination - Web APIs
the destination read-only property of the request interface returns a string describing the type of content being requested.
... the string must be one of those found in the requestdestination enumerated type or the empty string, which is the default value.
... the destination is used by the user agent to, for example, help determine which set of rules to follow for cors purposes, or how to navigate any complicated code paths that affect how specific types of request get handled.
...And 2 more matches
SVGGradientElement - Web APIs
f4f7f8" stroke="#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">svggradientelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_spreadmethod_unknown 0 the type is not one of predefined types.
... it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
...takes one of the constants defined in svgunittypes.
...And 2 more matches
SVGPathSeg - Web APIs
interface overview also implement none methods none properties unsigned short pathsegtype domstring pathsegtypeasletter constants pathseg_unknown = 0 pathseg_closepath = 1 pathseg_moveto_abs = 2 pathseg_moveto_rel = 3 pathseg_lineto_abs = 4 pathseg_lineto_rel = 5 pathseg_curveto_cubic_abs = 6 pathseg_curveto_cubic_rel ...
...atic_smooth_abs = 18 pathseg_curveto_quadratic_smooth_rel = 19 normative document svg 1.1 (2nd edition) constants name value description pathseg_unknown 0 the unit type is not one of predefined types.
... it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
...And 2 more matches
Screen Capture API - Web APIs
mediatrackconstraints.displaysurface a constraindomstring indicating what type of display surface is to be captured.
... mediatracksettings.displaysurface a string indicating what type of display surface is currently being captured.
... cursorcaptureconstraint an enumerated string type used to provide the value for the cursor property for the settings and constraints.
...And 2 more matches
Streams API concepts - Web APIs
there are two types of underlying source: push sources constantly push data at you when you’ve accessed them, and it is up to you to start, pause, or cancel access to the stream.
...a chunk can be a single byte, or it can be something larger such as a typed array of a certain size.
... a single stream can contain chunks of different sizes and types.
...And 2 more matches
TextDecoder - Web APIs
examples representing text with typed arrays this example shows how to decode a chinese/japanese character , as represented by five different typed arrays: uint8array, int8array, uint16array, int16array, and int32array.
... textdecoder.prototype.encodingread only is a domstring containing the name of the decoder, that is a string describing the method the textdecoder will use.
... textdecoder.prototype.fatalread only is a boolean indicating whether the error mode is fatal.
...And 2 more matches
WebGL2RenderingContext.texImage3D() - Web APIs
syntax void gl.teximage3d(target, level, internalformat, width, height, depth, border, format, type, glintptr offset); void gl.teximage3d(target, level, internalformat, width, height, depth, border, format, type, htmlcanvaselement source); void gl.teximage3d(target, level, internalformat, width, height, depth, border, format, type, htmlimageelement source); void gl.teximage3d(target, level, internalformat, width, height, depth, border, format, type, htmlvideoelement source); void gl.teximage3d(target, level, internalformat, width, height, depth, border, format, type, imagebitmap source); void gl.teximage3d(target, level, internalformat, width, height, depth, border, format,...
... type, imagedata source); void gl.teximage3d(target, level, internalformat, width, height, depth, border, format, type, arraybufferview?
... srcdata); void gl.teximage3d(target, level, internalformat, width, height, depth, border, format, type, arraybufferview srcdata, srcoffset); parameters target a glenum specifying the binding point (target) of the active texture.
...And 2 more matches
WebGLRenderingContext.getFramebufferAttachmentParameter() - Web APIs
possible values: gl.framebuffer_attachment_object_type: the type which contains the attached image.
... when using a webgl 2 context, the following values are available additionally: gl.framebuffer_attachment_alpha_size gl.framebuffer_attachment_blue_size gl.framebuffer_attachment_color_encoding gl.framebuffer_attachment_component_type gl.framebuffer_attachment_depth_size gl.framebuffer_attachment_green_size gl.framebuffer_attachment_red_size gl.framebuffer_attachment_stencil_size gl.framebuffer_attachment_texture_layer when using the ovr_multiview2 extension: ext.framebuffer_attachment_texture_num_views_ovr: the number of views of the framebuffer object attachment.
... pname parameter return value gl.framebuffer_attachment_object_type a glenum indicating the type of the texture.
...And 2 more matches
WebRTC connectivity - Web APIs
each protocol supports a few types of candidate, with the candidate types defining how the data makes its way from peer to peer.
... udp candidate types udp candidates (candidates with their protocol set to udp) can be one of these types: host a host candidate is one for which its ip address is the actual, direct ip address of the remote peer.
... tcp candidate types tcp candidates (that is, candidates whose protocol is tcp) can be of these types: active the transport will try to open an outbound connection but won't receive incoming connection requests.
...And 2 more matches
Web Video Text Tracks Format (WebVTT) - Web APIs
webvtt files the mime type of webvtt is text/vtt.
... the first line of webvtt is standardized similar to the way some other languages require you to put headers as the file starts to indicate the file type.
... css pseudo-classes css pseudo classes allow us to classify the type of object which we want to differentiate from other types of objects.
...And 2 more matches
Lighting a WebXR setting - Web APIs
this is the foundation for much of what's involved in shading a scene, and comes into play in terms of how different types of light source behave.
... components of a light source a light source has three major components; each component is in essence a type of light there are three kinds of light that can affect the color and brightness of objects and their pixels as displayed on the viewer's screen or headset.
... types of light source there are four fundamental types of light source.
...And 2 more matches
How to check the security state of an XMLHTTPRequest over SSL - Web APIs
const {cc,ci} = require("chrome"); function createtcperrorfromfailedxhr(xhr) { let status = xhr.channel.queryinterface(ci.nsirequest).status; let errtype; if ((status & 0xff0000) === 0x5a0000) { // security module const nsinsserrorsservice = ci.nsinsserrorsservice; let nsserrorsservice = cc['@mozilla.org/nss_errors_service;1'].getservice(nsinsserrorsservice); let errorclass; // geterrorclass will throw a generic ns_error_failure if the error code is // somehow not in the set of covered errors.
... try { errorclass = nsserrorsservice.geterrorclass(status); } catch (ex) { //catching security protocol exception errorclass = 'securityprotocol'; } if (errorclass == nsinsserrorsservice.error_class_bad_cert) { errtype = 'securitycertificate'; } else { errtype = 'securityprotocol'; } // nss_sec errors (happen below the base value because of negative vals) if ((status & 0xffff) < math.abs(nsinsserrorsservice.nss_sec_error_base)) { // the bases are actually negative, so in our positive numeric space, we // need to subtract the base off our value.
...et sslerr = math.abs(nsinsserrorsservice.nss_ssl_error_base) - (status & 0xffff); switch (sslerr) { case 3: // ssl_error_no_certificate, ssl(3) errname = 'securitynocertificateerror'; break; case 4: // ssl_error_bad_certificate, ssl(4) errname = 'securitybadcertificateerror'; break; case 8: // ssl_error_unsupported_certificate_type, ssl(8) errname = 'securityunsupportedcertificatetypeerror'; break; case 9: // ssl_error_unsupported_version, ssl(9) errname = 'securityunsupportedtlsversionerror'; break; case 12: // ssl_error_bad_cert_domain, ssl(12) errname = 'securitycertificatedomainmismatcherror'; break; default: errname = 'securit...
...And 2 more matches
XMLHttpRequest.responseXML - Web APIs
if the responsetype is set to "document" and the request was made asynchronously, instead the response is parsed as "text/html".
... responsexml is null for any other types of data, as well as for data: urls.
... if the server doesn't specify the content-type as "text/xml" or "application/xml", you can use xmlhttprequest.overridemimetype() to parse it as xml anyway.
...And 2 more matches
XMLHttpRequest - Web APIs
y="1" width="140" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="511" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">xmlhttprequest</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} despite its name, xmlhttprequest can be used to retrieve any type of data, not just xml.
... xmlhttprequest.response read only returns an arraybuffer, blob, document, javascript object, or a domstring, depending on the value of xmlhttprequest.responsetype, that contains the response entity body.
... xmlhttprequest.responsetype is an enumerated value that defines the response type.
...And 2 more matches
XRPermissionDescriptor.requiredFeatures - Web APIs
currently, all features are members of the xrreferencespacetype enumerated type, indicating the reference space types that your app would like permission to use, but can operate without.
... the permitted values are: the types of reference space are listed in the table below, with brief information about their use cases and which interface is used to implement them.
... xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object.
...And 2 more matches
XRPermissionStatus.granted - Web APIs
currently, all of these strings come from the xrreferencespacetype enumerated type.
... the types of reference space are listed in the table below, with brief information about their use cases and which interface is used to implement them.
... xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object.
...And 2 more matches
ARIA: button role - Accessibility
<div id="savechanges" tabindex="0" role="button" aria-pressed="false">save</div> the above example creates a simple button which is first in the focus order, though <button> or <input> with type="button" should be used for buttons: <button id="savechanges">save</button> note: if using role="button" instead of the semantic <button> or <input type="button"> elements, you will need to make the element focusable and have to define event handlers for click and keydown events, including the enter and space keys, in order to process the user's input.
... space activates the button following button activation, focus is set depending on the type of action the button performs.
... html <h1>aria button example</h1> <ul id="namelist"></ul> <label for="newname">enter your name: </label> <input type="text" id="newname"> <span role="button" tabindex="0" onclick="handlecommand()" onkeydown="handlecommand()">add name</span> css [role="button"] { padding: 2px; background-color: navy; color: white; cursor: default; } [role="button"]:hover, [role="button"]:focus, [role="button"]:active { background-color: white; color: navy; } ul { list-style: none; } javascript functi...
...And 2 more matches
@font-face - CSS: Cascading Style Sheets
font-feature-settings allows control over advanced typographic features in opentype fonts.
... font-variation-settings allows low-level control over opentype or truetype font variations, by specifying the four letter axis names of the features to vary, along with their variation values.
... to provide the browser with a hint as to what format a font resource is — so it can select a suitable one — it is possible to include a format type inside a format() function: src: url(ideal-sans-serif.woff) format("woff"), url(basic-sans-serif.ttf) format("truetype"); the available types are: "woff", "woff2", "truetype", "opentype", "embedded-opentype", and "svg".
...And 2 more matches
Using CSS gradients - CSS: Cascading Style Sheets
css gradients are represented by the <gradient> data type, a special type of <image> made of a progressive transition between two or more colors.
... you can choose between three types of gradients: linear (created with the linear-gradient() function), radial (created with radial-gradient()), and conic (created with the conic-gradient() function).
... we'll start by introducing linear gradients, then introduce features that are supported in all gradient types using linear gradients as the example, then move on to radial, conic and repeating gradients using linear gradients a linear gradient creates a band of colors that progress in a straight line.
...And 2 more matches
Basic Shapes - CSS: Cascading Style Sheets
css shapes can be defined using the <basic-shape> type, and in this guide i’ll explain how each of the different values accepted by this type work.
... before looking at the shapes, it is worth understanding two pieces of information that go together to make these shapes possible: the <basic-shape> type the reference box the <basic-shape> type the <basic-shape> type is used as the value for all of our basic shapes.
... this type uses functional notation: the type of shape is followed by brackets, inside of which are additional values used to describe the shape.
...And 2 more matches
Specificity - CSS: Cascading Style Sheets
specificity is a weight that is applied to a given css declaration, determined by the number of each selector type in the matching selector.
... selector types the following list of selector types increases by specificity: type selectors (e.g., h1) and pseudo-elements (e.g., ::before).
... class selectors (e.g., .example), attributes selectors (e.g., [type="radio"]) and pseudo-classes (e.g., :hover).
...And 2 more matches
<custom-ident> - CSS: Cascading Style Sheets
the <custom-ident> css data type denotes an arbitrary user-defined string used as an identifier.
... @counter-style list-style-type forbids the global css values (unset, initial, and inherit), as well as the values none, inline, and outside.
... css counter styles level 3the definition of '<custom-ident> for list-style-type' in that specification.
...And 2 more matches
Adapting to the new two-value syntax of display - CSS: Cascading Style Sheets
what grid and flexbox demonstrate, however, is that an element has both an outer and an inner display type.
... the outer display type describes whether the element is block-level or inline-level.
... the inner display type describes how the children of that box behave.
...And 2 more matches
font-synthesis - CSS: Cascading Style Sheets
the font-synthesis css property controls which missing typefaces, bold or italic, may be synthesized by the browser.
... values none indicates that neither bold nor italic typeface may be synthesized.
... weight indicates that a bold typeface may be synthesized if needed.
...And 2 more matches
font-variant-east-asian - CSS: Cascading Style Sheets
this keyword corresponds to the opentype values ruby.
...possible values are: keyword standard defining the glyphs opentype equivalent jis78 jis x 0208:1978 jp78 jis83 jis x 0208:1983 jp83 jis90 jis x 0208:1990 jp90 jis04 jis x 0213:2004 jp04 simplified none, use the simplified chinese glyphs smpl traditional none, use the traditional chinese glyphs trad <east-asian-width-values> these values control the sizing of figures used for east asian characters.
...it corresponds to the opentype values pwid.
...And 2 more matches
list-style - CSS: Cascading Style Sheets
constituent properties this property is a shorthand for the following css properties: list-style-image list-style-position list-style-type syntax /* type */ list-style: square; /* image */ list-style: url('../img/shape.png'); /* position */ list-style: inside; /* type | position */ list-style: georgian inside; /* type | image | position */ list-style: lower-roman url('../img/shape.png') outside; /* keyword value */ list-style: none; /* global values */ list-style: inherit; list-style: initial; list-style: unset; the list-...
...if list-style-type and list-style-image are both set, then list-style-type is used as a fallback if the image is unavailable.
... values list-style-type see list-style-type.
...And 2 more matches
shape-outside - CSS: Cascading Style Sheets
if list values are not one of those types but are identical (such as finding nonzero in the same list position in both lists), those values do interpolate.
... if both shapes are the same type, that type is ellipse() or circle(), and none of the radii use the closest-side or farthest-side keywords, interpolate between each value in the shape functions.
... if both shapes are of type inset(), interpolate between each value in the shape functions.
...And 2 more matches
Event reference
event name event type specification fired when...
... non-standard events event name event type specification fired when...
... xul events event name event type specification fired when...
...And 2 more matches
Rich-Text Editing in Mozilla - Developer guides
once designmode has been set to "on", the document becomes a rich-text editing area and the user can type into it as if it were a textarea.
... figure 4 : executing rich editing commands html: <button onclick="doricheditcommand('bold')" style="font-weight:bold;">b</button> javascript: function doricheditcommand(aname, aarg){ getiframedocument('editorwindow').execcommand(aname,false, aarg); document.getelementbyid('editorwindow').contentwindow.focus() } example: a simple but complete rich text editor <!doctype html> <html> <head> <title>rich text editor</title> <script type="text/javascript"> var odoc, sdeftxt; function initdoc() { odoc = document.getelementbyid("textbox"); sdeftxt = odoc.innerhtml; if (document.compform.switchmode.checked) { setdocmode(true); } } function formatdoc(scmd, svalue) { if (validatemode()) { document.execcommand(scmd, false, svalue); odoc.focus(); } } function va...
...ontent.selectnodecontents(odoc.firstchild); odoc.innerhtml = ocontent.tostring(); } odoc.contenteditable = true; } odoc.focus(); } function printdoc() { if (!validatemode()) { return; } var oprntwin = window.open("","_blank","width=450,height=470,left=400,top=100,menubar=yes,toolbar=no,location=no,scrollbars=yes"); oprntwin.document.open(); oprntwin.document.write("<!doctype html><html><head><title>print<\/title><\/head><body onload=\"print();\">" + odoc.innerhtml + "<\/body><\/html>"); oprntwin.document.close(); } </script> <style type="text/css"> .intlink { cursor: pointer; } img.intlink { border: 0; } #toolbar1 select { font-size:10px; } #textbox { width: 540px; height: 200px; border: 1px #000000 solid; padding: 12px; overflow: scroll; } #textbox #sour...
...And 2 more matches
Index - Developer guides
WebGuideIndex
you can find compatibility information in the guide to media types and formats on the web.
... 17 event developer guide dom, event, guide, needsupdate, events events refers both to a design pattern used for the asynchronous handling of various incidents which occur in the lifetime of a web page and to the naming, characterization, and use of a large number of incidents of different types.
... 24 overview of events and handlers beginner, dom, example, javascript, needsbeginnerupdate, needsupdate, events this overview of events and event handling explains the code design pattern used to react to incidents occurring when a browser accesses a web page, and it summarizes the types of such incidents modern web browsers can handle.
...And 2 more matches
HTML attribute: capture - HTML: Hypertext Markup Language
the capture attribute specifies that, optionally, a new file should be captured, and which device should be used to capture that new media of a type defined by the accept attribute.
...the capture attribute is supported on the file input type.
... the capture attribute takes as it's value a string that specifies which camera to use for capture of image or video data, if the accept attribute indicates that the input should be of one of those types.
...And 2 more matches
<command>: The HTML Command element - HTML: Hypertext Markup Language
WebHTMLElementcommand
must be omitted unless the type attribute is checkbox or radio.
... radiogroup this attribute gives the name of the group of commands, with a type of radio, that will be toggled when the command itself is toggled.
... this attribute must be omitted unless the type attribute is radio.
...And 2 more matches
<spacer> - HTML: Hypertext Markup Language
WebHTMLElementspacer
type this attribute determines type of spacer.
... size this attribute can be used for defining size of spacer in pixels when type is horizontal or vertical.
... width this attribute can be used for defining width of spacer in pixels when type is block.
...And 2 more matches
<ul>: The Unordered List element - HTML: Hypertext Markup Language
WebHTMLElementul
type this attribute sets the bullet style for the list.
... the values defined under html3.2 and the transitional version of html 4.0/4.01 are: circle disc square a fourth bullet type has been defined in the webtv interface, but not all browsers support it: triangle.
... if not present and if no css list-style-type property applies to the element, the user agent selects a bullet type depending on the nesting level of the list.
...And 2 more matches
HTML elements reference - HTML: Hypertext Markup Language
WebHTMLElement
browsers typically render the contents in bold type.
... <noscript> the html <noscript> element defines a section of html to be inserted if a script type on the page is unsupported or if scripting is currently turned off in the browser.
... <input> the html <input> element is used to create interactive controls for web-based forms in order to accept data from the user; a wide variety of types of input data and control widgets are available, depending on the device and user agent.
...And 2 more matches
inputmode - HTML: Hypertext Markup Language
the inputmode global attribute is an enumerated attribute that hints at the type of data that might be entered by the user while editing the element or its contents.
...inputs that require a telephone number should typically use <input type="tel">instead.
...inputs that require a search query should typically use <input type="search"> instead.
...And 2 more matches
itemid - HTML: Hypertext Markup Language
an itemid attribute can only be specified for an element that has both itemscope and itemtype attributes.
... also, itemid can only be specified on elements that possess an itemscope attribute whose corresponding itemtype refers to or defines a vocabulary that supports global identifiers.
... the exact meaning of an itemtype's global identifier is provided by the definition of that identifier within the specified vocabulary.
...And 2 more matches
Using the application cache - HTML: Hypertext Markup Language
a cache manifest file can have any file extension, but it must be served with the mime type text/cache-manifest.
... note: on apache servers, the mime type for manifest (.appcache) files can be set by adding addtype text/cache-manifest .appcache to a .htaccess file within either the root directory, or the same directory as the application.
... structure of a cache manifest file cache manifest files must be served with the text/cache-manifest mime type.
...And 2 more matches
Data URLs - HTTP
syntax data urls are composed of four parts: a prefix (data:), a mime type indicating the type of data, an optional base64 token if non-textual, and the data itself: data:[<mediatype>][;base64],<data> the mediatype is a mime type string, such as 'image/jpeg' for a jpeg image file.
... if omitted, defaults to text/plain;charset=us-ascii if the data is textual, you can simply embed the text (using the appropriate entities or escapes based on the enclosing document's type).
...you can find more info on mime types here and here.
...And 2 more matches
Content Security Policy (CSP) - HTTP
WebHTTPCSP
content security policy (csp) is an added layer of security that helps to detect and mitigate certain types of attacks, including cross site scripting (xss) and data injection attacks.
... writing a policy a policy is described using a series of policy directives, each of which describes the policy for a certain resource type or policy area.
... your policy should include a default-src policy directive, which is a fallback for other resource types when they don't have policies of their own (for a complete list, see the description of the default-src directive).
...And 2 more matches
Content-Disposition - HTTP
the subpart is delimited by the boundary defined in the content-type header.
... header type response header (for the main body) general header (for a subpart of a multipart body) forbidden header name no syntax as a response header for the main body the first parameter in the http context is either inline (default value, indicating it can be displayed inside the web page, or as the web page) or attachment (indicating it should be downloaded; most browsers presenting a 'save as' dialog, pref...
...when dealing with multiple files in the same field (for example, the multiple attribute of an <input type="file"> element), there can be several subparts with the same name.
...And 2 more matches
HTTP headers - HTTP
WebHTTPHeaders
entity headers contain information about the body of the resource, like its content length or mime type.
... content negotiation accept informs the server about the types of data that can be sent back.
... content-type indicates the media type of the resource.
...And 2 more matches
Link prefetching FAQ - HTTP
the browser looks for either an html <link> or an http link: header with a relation type of either next or prefetch.
... no, only <link> tags with a relation type of next or prefetch are prefetched.
... however, if there is sufficient interest, we may expand link prefetching support to include prefetching <a> tags, which include a relation type of next or prefetch in the future.
...And 2 more matches
HTTP Messages - HTTP
WebHTTPMessages
there are two types of messages: requests sent by the client to trigger an action on the server, and responses, the answer from the server.
... request headers, like user-agent, accept-type, modify the request by specifying it further (like accept-language), by giving context (like referer), or by conditionally restricting it (like if-none).
... bodies can be broadly divided into two categories: single-resource bodies, consisting of one single file, defined by the two headers: content-type and content-length.
...And 2 more matches
206 Partial Content - HTTP
WebHTTPStatus206
if there is only one range, the content-type of the whole response is set to the type of the document, and a content-range is provided.
... if several ranges are sent back, the content-type is set to multipart/byteranges and each fragment covers one range, with content-range and content-type describing it.
... status 206 partial content examples a response containing one single range: http/1.1 206 partial content date: wed, 15 nov 2015 06:25:24 gmt last-modified: wed, 15 nov 2015 04:58:08 gmt content-range: bytes 21010-47021/47022 content-length: 26012 content-type: image/gif ...
...And 2 more matches
Enumerability and ownership of properties - JavaScript
ownership of properties is determined by whether the property belongs to the object directly and not to its prototype chain.
... property enumerability and ownership - built-in methods of detection, retrieval, and iteration functionality own object own object and its prototype chain prototype chain only detection enumerable nonenumerable enumerable and nonenumerable propertyisenumerable hasownproperty hasownproperty – filtered to exclude enumerables using propertyisenumerable hasownproperty ...
...just this: return object.keys(obj); }, getownnonenumerables: function(obj) { return this._getpropertynames(obj, true, false, this._notenumerable); }, getownenumerablesandnonenumerables: function(obj) { return this._getpropertynames(obj, true, false, this._enumerableandnotenumerable); // or just use: return object.getownpropertynames(obj); }, getprototypeenumerables: function(obj) { return this._getpropertynames(obj, false, true, this._enumerable); }, getprototypenonenumerables: function(obj) { return this._getpropertynames(obj, false, true, this._notenumerable); }, getprototypeenumerablesandnonenumerables: function(obj) { return this._getpropertynames(obj, false, true, this._enumerableandnotenumerable); ...
...And 2 more matches
Keyed collections - JavaScript
an object has a prototype, so there are default keys in the map.
... (this can be bypassed using map = object.create(null).) these three tips can help you to decide whether to use a map or an object: use maps over objects when keys are unknown until run time, and when all keys are the same type and all values are the same type.
...everything exposed on the instance and prototype is public; everything else is inaccessible from the outside world because privates is not exported from the module.
...And 2 more matches
Text formatting - JavaScript
strings javascript's string type is used to represent textual data.
... see also string.fromcodepoint() or string.prototype.codepointat().
... '\u{2f804}' // the same with simple unicode escapes '\ud87e\udc04' string objects the string object is a wrapper around the string primitive data type.
...And 2 more matches
Public class fields - JavaScript
as such, unlike their private counterparts, they participate in prototype inheritance.
... class classwithstaticfield { static staticfield } console.assert(classwithstaticfield.hasownproperty('staticfield')) console.log(classwithstaticfield.staticfield) // expected output: "undefined" public static fields are not reinitialized on subclasses, but can be accessed via the prototype chain.
...just as in public instance methods, if you're in a subclass you can access the superclass prototype using super.
...And 2 more matches
Deprecated and obsolete features - JavaScript
string methods html wrapper methods like string.prototype.fontsize and string.prototype.big.
... string.prototype.quote is removed from firefox 37.
... non standard flags parameter in string.prototype.search, string.prototype.match, and string.prototype.replace are deprecated.
...And 2 more matches
The arguments object - JavaScript
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 to a real array: let args = array.from(arguments); // or let args = [...arguments]; the arguments object is useful for functions called ...
... 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.
... function myconcat(separator) { let args = array.prototype.slice.call(arguments, 1); return args.join(separator); } you can pass as many arguments as you like to this function.
...And 2 more matches
Atomics.add() - JavaScript
syntax atomics.add(typedarray, index, value) parameters typedarray an integer typed array.
... index the position in the typedarray to add a value to.
... return value the old value at the given position (typedarray[index]).
...And 2 more matches
Atomics.and() - JavaScript
syntax atomics.and(typedarray, index, value) parameters typedarray an integer typed array.
... index the position in the typedarray to compute the bitwise and.
... return value the old value at the given position (typedarray[index]).
...And 2 more matches
Atomics.compareExchange() - JavaScript
syntax atomics.compareexchange(typedarray, index, expectedvalue, replacementvalue) parameters typedarray an integer typed array.
... index the position in the typedarray to exchange a value.
... return value the old value at the given position (typedarray[index]).
...And 2 more matches
Atomics.exchange() - JavaScript
syntax atomics.exchange(typedarray, index, value) parameters typedarray an integer typed array.
... index the position in the typedarray to exchange a value.
... return value the old value at the given position (typedarray[index]).
...And 2 more matches
Atomics.load() - JavaScript
syntax atomics.load(typedarray, index) parameters typedarray an integer typed array.
... index the position in the typedarray to load from.
... return value the value at the given position (typedarray[index]).
...And 2 more matches
Atomics.or() - JavaScript
syntax atomics.or(typedarray, index, value) parameters typedarray an integer typed array.
... index the position in the typedarray to compute the bitwise or.
... return value the old value at the given position (typedarray[index]).
...And 2 more matches
Atomics.sub() - JavaScript
syntax atomics.sub(typedarray, index, value) parameters typedarray an integer typed array.
... index the position in the typedarray to subtract a value from.
... return value the old value at the given position (typedarray[index]).
...And 2 more matches
Atomics.xor() - JavaScript
syntax atomics.xor(typedarray, index, value) parameters typedarray an integer typed array.
... index the position in the typedarray to compute the bitwise xor.
... return value the old value at the given position (typedarray[index]).
...And 2 more matches
Function - JavaScript
instance methods function.prototype.apply(thisarg [, argsarray]) calls a function and sets its this to the provided thisarg.
... function.prototype.bind(thisarg[, arg1[, arg2[, ...argn]]]) creates a new function which, when called, has its this set to the provided thisarg.
... function.prototype.call(thisarg[, arg1, arg2, ...argn]) calls a function and sets its this to the provided value.
...And 2 more matches
Intl.DateTimeFormat - JavaScript
instance methods intl.datetimeformat.prototype.format() getter function that formats a date according to the locale and formatting options of this datetimeformat object.
... intl.datetimeformat.prototype.formattoparts() returns an array of objects representing the date string in parts that can be used for custom locale-aware formatting.
... intl.datetimeformat.prototype.resolvedoptions() returns a new object with properties reflecting the locale and formatting options computed during initialization of the object.
...And 2 more matches
Object.getOwnPropertyDescriptor() - JavaScript
the object.getownpropertydescriptor() method returns an object describing the configuration of a specific property on a given object (that is, one directly present on an object and not in the object's prototype chain).
...further information about property descriptor types and their attributes can be found in 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.
...And 2 more matches
handler.set() - JavaScript
but a set() handler can also be called indirectly, via the prototype chain or various other ways.
... for example: suppose a script does obj.name = "jen", and obj is not a proxy, and has no own property .name, but it has a proxy on its prototype chain.
... if the set() method returns false, and the assignment happened in strict-mode code, a typeerror will be thrown.
...And 2 more matches
SharedArrayBuffer - JavaScript
the structured clone algorithm accepts sharedarraybuffers and typedarrays mapped onto sharedarraybuffers.
...calling a sharedarraybuffer constructor as a function without new will throw a typeerror.
... var sab = sharedarraybuffer(1024); // typeerror: calling a builtin sharedarraybuffer constructor // without new is forbidden var sab = new sharedarraybuffer(1024); constructor sharedarraybuffer() creates a new sharedarraybuffer object.
...And 2 more matches
WebAssembly.Global() constructor - JavaScript
syntax new webassembly.global(descriptor, value); parameters descriptor a globaldescriptor dictionary object, which contains two properties: value: a usvstring representing the data type of the global.
...this can be any value, as long as its type matches the variable's data type.
... if no value is specified, a typed 0 value is used, as specified by the defaultvalue algorithm.
...And 2 more matches
WebAssembly.Table - JavaScript
instance properties table.prototype.length returns the length of the table, i.e.
... instance methods table.prototype.get() accessor function — gets the element stored at a given index.
... table.prototype.grow() increases the size of the table instance by a specified number of elements.
...And 2 more matches
undefined - JavaScript
it is one of javascript's primitive types.
...(even when this is not the case, avoid overriding it.) a variable that has not been assigned a value is of type undefined.
... // don't do this // logs "foo string" (function() { var undefined = 'foo'; console.log(undefined, typeof undefined); })(); // logs "foo string" (function(undefined) { console.log(undefined, typeof undefined); })('foo'); examples strict equality and undefined you can use undefined and the strict equality and inequality operators to determine whether a variable has a value.
...And 2 more matches
Lexical grammar - JavaScript
keywords reserved keywords as of ecmascript 2015 break case catch class const continue debugger default delete do else export extends finally for function if import in instanceof new return super switch this throw try typeof var void while with yield future reserved keywords the following are reserved as future keywords by the ecmascript specification.
... true false numeric literals the number and bigint types use numeric literals.
... 0xfffffffffffffffff // 295147905179352830000 0x123456789abcdef // 81985529216486900 0xa // 10 bigint literal the bigint type is a numeric primitive in javascript that can represent integers with arbitrary precision.
...And 2 more matches
var - JavaScript
'use strict'; var x = 1; globalthis.hasownproperty('x'); // true delete globalthis.x; // typeerror in strict mode.
... so you can just type: function foo() { string('s') // note the function `string` is implicitly visible } ...because globalthis.hasownproperty('string') // true so the global object will ultimately be searched for unqualified identifiers.
... you don't have to type globalthis.string, you can just type the unqualified string.
...And 2 more matches
JavaScript
javascript is a prototype-based, multi-paradigm, single-threaded, dynamic language, supporting object-oriented, imperative, and declarative (e.g.
... javascript building blocks continues our coverage of javascript's key fundamental features, turning our attention to commonly-encountered types of code blocks such as conditional statements, loops, functions, and events.
... advanced inheritance and the prototype chain explanation of the widely misunderstood and under-estimated prototype-based inheritance.
...And 2 more matches
Authoring MathML - MathML
using mathml mathml in html pages you can use presentation mathml inside html5 documents: <!doctype html> <html> <head> <title>mathml in html5</title> </head> <body> <h1>mathml in html5</h1> <p> square root of two: <math> <msqrt> <mn>2</mn> </msqrt> </math> </p> </body> </html> content mathml is not supported by browsers.
... mathml in xml documents (xhtml, epub, etc) if for some reason you need to use mathml in xml documents, be sure to satisfy the usual requirements: well-formed document, use of correct mime type, mathml namespace "http://www.w3.org/1998/math/mathml" on <math> roots.
... for example, the xhtml version of the previous example looks like this: <?xml version="1.0" encoding="utf-8"?> <!doctype html public "-//w3c//dtd xhtml 1.1 plus mathml 2.0//en" "http://www.w3.org/math/dtd/mathml2/xhtml-math11-f.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>xhtml+mathml example</title> </head> <body> <h1>xhtml+mathml example</h1> <p> square root of two: <math xmlns="http://www.w3.org/1998/math/mathml"> <msqrt> <mn>2</mn> </msqrt> </math> </p> </body> </html> mathml in email and instant messaging clients modern mail clients may send and receive emails in the html5 format and thus can use mathml expressions.
...And 2 more matches
begin - SVG: Scalable Vector Graphics
WebSVGAttributebegin
examples offset example <svg width="120" height="120" viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg" version="1.1"> <!-- animated rectangles --> <rect x="10" y="35" height="15" width="0"> <animate attributetype="xml" attributename="width" to="100" begin="0s" dur="8s" fill="freeze" /> </rect> <rect x="35" y="60" height="15" width="0"> <animate attributetype="xml" attributename="width" to="75" begin="2s" dur="6s" fill="freeze" /> </rect> <rect x="60" y="85" height="15" width="0"> <animate attributetype="x...
...".5" /> <line x1="10" y1="105" x2="110" y2="105" stroke="grey" stroke-width=".5" /> </svg> begin-1-offset.svg syncbase example <svg width="120" height="120" viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- animated rectangles --> <rect x="10" y="35" height="15" width="0"> <animate attributetype="xml" attributename="width" to="50" id="first" begin="0s;third.end" dur="4s" /> </rect> <rect x="60" y="60" height="15" width="0"> <animate attributetype="xml" attributename="width" to="25" id="second" begin="first.end" dur="2s" /> </rect> <rect x="85" y="85" height="15" width="0"> <animate attributetype="xml" attributename="widt...
...h=".5" /> <line x1="10" y1="105" x2="110" y2="105" stroke="grey" stroke-width=".5" /> </svg> begin-2-syncbase.svg event example <svg width="120" height="120" viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- animated rectangle --> <rect x="10" y="35" height="15" width="0"> <animate attributetype="xml" attributename="width" from="0" to="100" begin="startbutton.click" dur="8s" fill="freeze" /> </rect> <!-- trigger --> <rect id="startbutton" style="cursor:pointer;" x="19.5" y="62.5" rx="5" height="25" width="80" fill="#efefef" stroke="black" stroke-width="1" /> <text x="60" y="80" text-anchor="middle" style="p...
...And 2 more matches
SVG Attribute reference - SVG: Scalable Vector Graphics
WebSVGAttribute
svg attributes a to z a accent-height accumulate additive alignment-baseline allowreorder alphabetic amplitude arabic-form ascent attributename attributetype autoreverse azimuth b basefrequency baseline-shift baseprofile bbox begin bias by c calcmode cap-height class clip clippathunits clip-path clip-rule color color-interpolation color-interpolation-filters color-profile color-rendering contentscripttype contentstyletype cursor cx cy d d decelerate descent diffuseconstant direction display divisor dominan...
...tiles stop-color stop-opacity strikethrough-position strikethrough-thickness string stroke stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width style surfacescale systemlanguage t tabindex tablevalues target targetx targety text-anchor text-decoration text-rendering textlength to transform transform-origin type u u1 u2 underline-position underline-thickness unicode unicode-bidi unicode-range units-per-em v v-alphabetic v-hanging v-ideographic v-mathematical values vector-effect version vert-adv-y vert-origin-x vert-origin-y viewbox viewtarget visibility w width widths word-spacing writing-mode x x x-height x1 x2 xchannelselector xlink:actuate xlink:arcrole...
... xlink:href xlink:role xlink:show xlink:title xlink:type xml:base xml:lang xml:space y y y1 y2 ychannelselector z z zoomandpan svg attributes by category generic attributes core attributes id, lang, tabindex, xml:base, xml:lang, xml:space style attributes class, style conditional processing attributes externalresourcesrequired, requiredextensions, requiredfeatures, systemlanguage.
...And 2 more matches
<ellipse> - SVG: Scalable Vector Graphics
WebSVGElementellipse
value type: <length>|<percentage> ; default value: 0; animatable: yes cy the y position of the ellipse.
... value type: <length>|<percentage> ; default value: 0; animatable: yes rx the radius of the ellipse on the x axis.
... value type: auto|<length>|<percentage> ; default value: auto; animatable: yes ry the radius of the ellipse on the y axis.
...And 2 more matches
<line> - SVG: Scalable Vector Graphics
WebSVGElementline
value type: <length>|<percentage>|<number> ; default value: 0; animatable: yes x2 defines the x-axis coordinate of the line ending point.
... value type: <length>|<percentage>|<number> ; default value: 0; animatable: yes y1 defines the y-axis coordinate of the line starting point.
... value type: <length>|<percentage>|<number> ; default value: 0; animatable: yes y2 defines the y-axis coordinate of the line ending point.
...And 2 more matches
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
<image>; bug 1240357) rendering model change notes svg root and <foreignobject> not overflow:hidden in ua style sheet implementation status unknown allow overflow: auto; to clip and show scroll bars implementation status unknown allow overflow: scroll; to show scroll bars on <svg> elements implementation status unknown basic data types and interfaces change notes dommatrix or dommatrixreadonly instead of svgmatrix implementation status unknown domrect or domrectreadonly instead of svgrect implementation status unknown dompoint or dompointreadonly instead of svgpoint implementation status unknown members of svgstylable and svglangspace available in svgelement impl...
... svgexternalresourcesrequired removed never implemented svgelement.viewportelement and svgelement.ownersvgelement nullable implementation status unknown svgelement.getpresentationattribute() removed never implemented (prototype removed in bug 921456) svgcolor and svgicccolor removed never implemented svgelement.focus(), svgelement.blur() not implemented (bug 778654) svgelement.tabindex implemented (bug 778654) document.activeelement implementation status unknown globaleventhandlers on svgelement implementation status unknown options dictionary attribut...
...implementation status unknown made <use> element shadow trees consistent with shadow dom spec implementation status unknown role mapping of <a> element depending on whether it is a valid link implementation status unknown aria state and property attributes animatable implementation status unknown styling change notes contentstyletype attribute removed implementation status unknown linkstyle on svgstyleelement implemented (bug 1239128 (firefox 46.0 / thunderbird 46.0 / seamonkey 2.43)) inner <svg>s and <foreignobjects>s not overflow: hidden; in ua style sheet implementation status unknown overflow: hidden; on <hatch> in ua style sheet implementation status unknown 0 0 as default ...
...And 2 more matches
Getting started - SVG: Scalable Vector Graphics
(firefox users: click here) the rendering process involves the following: we start with the <svg> root element: a doctype declaration as known from (x)html should be left off because dtd based svg validation leads to more problems than it solves before svg 2, to identify the version of the svg for other types of validation the version and baseprofile attributes should always be used instead.
... svg files on the web can be displayed directly in the browser or embedded in html files via several methods: if the html is xhtml and is delivered as type application/xhtml+xml, the svg can be directly embedded in the xml source.
... the svg file can be referenced with an object element: <object data="image.svg" type="image/svg+xml" /> likewise an iframe element can be used: <iframe src="image.svg"></iframe> an img element can theoretically be used too.
...And 2 more matches
XML introduction - XML: Extensible Markup Language
document must conform to semantic rules, which are usually set in an xml schema or a dtd (document type definition).
...that you should know: entity character description &lt; < less than sign &gt; > greater than sign &amp; & ampersand &quot; " one double-quotation mark &apos; ' one apostrophe (or single-quotation mark) even though there are only 5 declared entities, more can be added using the document's document type definition.
... for example, to create a new &warning; entity, you can do this: <?xml version="1.0" encoding="utf-8"?> <!doctype body [ <!entity warning "warning: something bad happened...
...And 2 more matches
<xsl:output> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementoutput
syntax <xsl:output method="xml" | "html" | "text" version=string encoding=string omit-xml-declaration="yes" | "no" standalone="yes" | "no" doctype-public=string doctype-system=string cdata-section-elements=list-of-names indent="yes" | "no" media-type=string /> required attributes none.
... doctype-public specifies the value of the public attribute of the doctype declaration in the output document.
... doctype-system specifies the value of the system attribute of the doctype declaration in the output document.
...And 2 more matches
Index - XSLT: Extensible Stylesheet Language Transformations
WebXSLTIndex
2 common xslt errors xslt your server needs to send both the source and the stylesheet with a xml mime type, text/xml or application/xml.
... to find out the current type, load the file in mozilla and look at the page info.
... or use a download tool, those usually tell the mime type.
...And 2 more matches
Compiling from Rust to WebAssembly - WebAssembly
navigate to wherever you keep your personal projects, and type this: $ cargo new --lib hello-wasm created library `hello-wasm` project this creates a new library in a subdirectory named hello-wasm with everything you need to get going: +-- cargo.toml +-- src +-- lib.rs first, we have cargo.toml; this is the file that we use to configure our build.
... wasm-pack uses wasm-bindgen, another tool, to provide a bridge between the types of javascript and rust.
...open this file, and change its contents to look like this: [package] name = "hello-wasm" version = "0.1.0" authors = ["your name <you@example.com>"] description = "a sample project with wasm-pack" license = "mit/apache-2.0" repository = "https://github.com/yourgithubusername/hello-wasm" [lib] crate-type = ["cdylib"] [dependencies] wasm-bindgen = "0.2" fill in your own repository and use the same info that git uses for the authors field.
...And 2 more matches
Communicating With Other Scripts - Archive of obsolete content
finally, "listen.html" uses window.addeventlistener() to listen for messages from the content script: <!doctype html> <html> <head></head> <body> <script> window.addeventlistener('message', function(event) { window.alert(event.data); // message from content script }, false); </script> </body> </html> messaging from page script to content script sending messages from the page script to the content script is just the same, but in reverse.
..." creates a page-mod that attaches "listen.js" to the web page: var data = require("sdk/self").data; var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "http://my-domain.org/talk.html", contentscriptfile: data.url("listen.js") }); the web page "talk.html" embeds a script that uses window.postmessage() to send the content script a message when the user clicks a button: <!doctype html> <html> <head></head> <body> <script> function sendmessage() { window.postmessage("message from page script", "http://my-domain.org/"); } </script> <button onclick="sendmessage()">send message</button> </body> </html> finally, the content script "listen.js" uses window.addeventlistener() to listen for messages from the page script: // listen.js window...
...e-mod"); var self = require("sdk/self"); var pageurl = self.data.url("page.html") var pagemod = mod.pagemod({ include: pageurl, contentscriptfile: self.data.url("content-script.js"), contentscriptwhen: "ready" }) tabs.open(pageurl); the target web page "page.html" includes a button and a page script: <html> <head> <meta charset="utf-8"> </head> <body> <input id="message" type="button" value="send a message"/> <script type="text/javascript" src="page-script.js"></script> </body> </html> the content script "content-script.js" adds an event listener to the button, that sends a custom event containing a message: var messenger = document.getelementbyid("message"); messenger.addeventlistener("click", sendcustomevent, false); function sendcustomevent() { var greet...
..."main.js" creates a page-mod to target the page we are interested in: var data = require("sdk/self").data; var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "http://my-domain.org/talk.html", contentscriptfile: data.url("listen.js") }); the web page "talk.html" creates and dispatches a custom dom event, using initcustomevent()'s detail parameter to supply the payload: <!doctype html> <html> <head></head> <body> <script> function sendmessage() { var event = document.createevent('customevent'); event.initcustomevent("addon-message", true, true, { hello: 'world' }); document.documentelement.dispatchevent(event); } </script> <button onclick="sendmessage()">send message</button> </body> </html> finally, the content scrip...
Private Properties - Archive of obsolete content
to make a private property readable/writable from any function, it's common to define getter/setter functions for the property, respectively: point.prototype.getx = function () { return this._x; }; point.prototype.setx = function (x) { this._x = x; }; point.prototype.gety = function () { return this._y; }; point.prototype.sety = function (y) { this._y = y; }; the above technique is simple and clearly expresses intent.
... function point(_x, _y) { this.getx = function () { return _x; }; this.setx = function (x) { _x = x; }; this.gety = function () { return _y; }; this.sety = function (y) { _y = y; }; } note that this technique requires member functions that need access to private properties to be defined on the object itself, instead of its prototype.
...using namespaces, the earlier example can be rewritten as: let map = new weakmap(); let internal = function (object) { if (!map.has(object)) map.set(object, {}); return map.get(object); } function point(x, y) { internal(this).x = x; internal(this).y = y; } point.prototype.getx = function () { return internal(this).x; }; point.prototype.setx = function (x) { internal(this).x = x; }; point.prototype.gety = function () { return internal(this).y; }; point.prototype.sety = function (y) { internal(this).y = y; }; the only way for a function to access the properties x and y, is if it has a reference to an instance of point and its internal namespace.
...to illustrate this, the following reimplements the class point using namespaces: const { ns } = require("sdk/core/namespace"); var internal = ns(); function point(x, y) { internal(this).x = x; internal(this).y = y; } point.prototype.getx = function () { return internal(this).x; }; point.prototype.setx = function (x) { internal(this).x = x; }; point.prototype.gety = function () { return internal(this).y; }; point.prototype.sety = function () { internal(this).y = y; }; as a final note, the function ns returns a namespace that uses the namespace associated with the prototype of the object as its prototype.
stylesheet/style - Archive of obsolete content
parameters options : object required options: name type uri string,array a string, or an array of strings, that represents local uri to stylesheet.
... optional options: name type type string the type of the sheet.
... type the type of the sheet.
... if no type is provided in constructor's option, it returns the default value, "author".
system/runtime - Archive of obsolete content
processtype the type of the caller's process, which will be one of these constants: constant value description process_type_default 0 the default (chrome) process.
... process_type_plugin 1 a plugin subprocess.
... process_type_content 2 a content subprocess.
... process_type_ipdlunittest 3 an ipdl unit testing subprocess.
HTML in XUL for rich tooltips - Archive of obsolete content
this example is what the final xul overlay could look like, assuming a javascript overlay titled overlay.js: <?xml version="1.0" encoding="utf-8"?> <overlay id="htmltip-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml"> <script type="application/x-javascript" src="overlay.js"/> <popup id="contentareacontextmenu"> <menuitem id="htmltip1" label="foo1" onmouseover="htmltip.onmousetooltip(event)" tooltip="myhtmltip" /> <menuitem id="htmltip2" label="foo2" onmouseover="htmltip.onmousetooltip(event)" tooltip="myhtmltip" /> </popup> <popupset id="mainpopupset"> ...
... <tooltip id="myhtmltip"> <html:div id="myhtmltipdiv" type="content"/> </tooltip> </popupset> </overlay> insert your version of the following into the javascript overlay.
...our enhanced xul tooltip is an element that is written ahead of time, and it contains an html div element whose type attribute lowers its privileges to being that content element, although it is an element of chrome.
... <?xml version="1.0" encoding="utf-8"?> <overlay id="htmltip-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml"> <script type="application/x-javascript" src="overlay.js"/> <popup id="contentareacontextmenu"> <menuitem id="htmltip3" label="foo3" tooltip="mytip3html" /> </popup> <popupset id="mainpopupset"> <tooltip id="mytip3html"> <html:div type="content"> <html:b>bold foo</html:b> </html:div> </tooltip> </popupset> </overlay> ...
LookupNamespaceURI - Archive of obsolete content
/*globals document, htmldocument */ (function () { 'use strict'; var doc = typeof document !== 'undefined' ?
... addlookupnamespaceuri(doc); addlookupnamespaceuri(element); function addlookupnamespaceuri (type) { if (!type.prototype.lookupnamespaceuri) { type.prototype.lookupnamespaceuri = lookupnamespaceuri; } function lookupnamespaceuri (prefix) { return lookupnamespaceurihelper(this, prefix); } function lookupnamespaceurihelper (node, prefix) { // adapted directly from http://www.w3.org/tr/dom-level-3-core/namespaces-algorithms.html#lookupnamespaceurialgo var i, att, htmlmode = document.contenttype, // mozilla only xmlnspattern = /^xmlns:(.*)$/; switch (node.nodetype) { case 1: //...
... if (att.name === 'xmlns' && prefix == null) { // default namespace if (att.value) { return att.value; } return null; // unknown } } } if (node.parentnode && node.parentnode.nodetype !== 9) { // entityreferences may have to be skipped to get to it return lookupnamespaceurihelper(node.parentnode, prefix); } return null; case 9: // document_node return lookupnamespaceurihelper(node.documentelement, prefix); case 6: // entity_node case 12: // notation_node ...
... case 10: // document_type_node case 11: // document_fragment_node return null; // unknown case 2: // attribute_node if (node.ownerelement) { return lookupnamespaceurihelper(node.ownerelement, prefix); } return null; // unknown default: // text_node (3), cdata_section_node (4), entity_reference_node (5), // processing_instruction_node (7), comment_node (8) if (node.parentnode) { // entityreferences may have to be skipped to get to it return lookupnamespaceurihelper(node.parentnode, prefix); } return null; // unknown } }; } }()); ...
Interaction between privileged and non-privileged pages - Archive of obsolete content
something.send_request({firefox: 4}, something.callback)">send {firefox: 4} with callback</button> </body> </html> overlay on browser.xul in your extension: var something = { listen_request: function(callback) { // analogue of chrome.extension.onrequest.addlistener document.addeventlistener("something-query", function(event) { var node = event.target; if (!node || node.nodetype != node.text_node) return; var doc = node.ownerdocument; callback(json.parse(node.nodevalue), doc, function(response) { node.nodevalue = json.stringify(response); var event = doc.createevent("htmlevents"); event.initevent("something-response", true, false); return node.dispatchevent(event); }); }, false, true); }, callback: func...
...rm of e4x xml var stuff = {}; stuff.id = sanitize.integer(uc.@id); stuff.name = sanitize.label(uc.@name); } function sendsomethingtopage (something) { var somethingxml = <something/>; // |something| object as e4x xml somethingxml.@id = something.id; somethingxml.@weight = something.weight; sendmsg("sendsomething", somethingxml); } /** * send msgs from chrome to the page * @param type {string} the event type.
... the receiver needs to use that * when doing addeventlistener(type, ...) * @param dataxml {e4x} the data or detail */ function sendmsg(type, dataxml) { var el = targetdoc.body; el.setattribute("eventdatatopage", dataxml ?
... dataxml.tostring() : ""); var event = targetdoc.createevent("event") event.initevent(type, true, true); el.dispatchevent(event); } /** * verifies that the event is indeed coming from our page * as expected, and returns the data for that event.
Appendix: What you should know about open-source software licenses - Archive of obsolete content
in this chapter, i’ll explain some of the basics: what open-source software (oss) licenses are, what types of licenses exist, and when they’re appropriate.
... types of oss licenses and their characteristics the details of oss licenses vary from one license to the next.
... can you change the type of license?
... depending on what type of license you choose in the first place, you can change it as follows: gpl → gpl lgpl → gpl or lgpl mpl → mpl modified bsd → other license dual license → either one or both sides of a dual license beware of mixed licenses when using existing source code, check to see whether there is a different license mixed in the source.
Supporting search suggestions in search plugins - Archive of obsolete content
firefox supports search suggestions in opensearch plugins; as the user types in the search bar, firefox queries the url specified by the search plugin to fetch live search suggestions.
...if the user continues to type, a new set of suggestions is requested from the search engine, and the displayed list is refreshed.
... implementing suggestion support in the search plugin to support search suggestions, a search plugin needs to define an extra <url> element with its type attribute set to "application/x-suggestions+json".
... (this means that a suggestion-supporting engine plugin will have two <url> elements, the other one being the main text/html search url.) for example, the yahoo search plugin has this <url> entry: <url type="application/x-suggestions+json" template="http://ff.search.yahoo.com/gossip?output=fxjson&command={searchterms}"/> if the user types "fir" into the search bar, then pauses, firefox inserts "fir" in place of {searchterms} and queries that url: <url type="application/x-suggestions+json" template="http://ff.search.yahoo.com/gossip?output=fxjson&command=fir"/> the results are used to construct the suggestion list box.
ActiveX Control for Hosting Netscape Plug-ins in IE - Archive of obsolete content
assuming you have cvs somewhere in your path, type this from a command prompt: c:\> set cvsroot=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot c:\> set home=\temp c:\> cvs login (logging in to anonymous@cvs-mirror.mozilla.org) cvs password: anonymous c:\> cvs -z3 co mozilla/embedding/browser/activex/src/pluginhostctrl this fetches the source for the control into mozilla\embedding\browser\activex\src\pluginhostctrl.
... usage insert some html like this into your content: <object classid="clsid:dbb2de32-61f1-4f7f-beb8-a37f5bc24ee2" width="500" height="300"> <param name="type" value="video/quicktime"/> <param name="src" value="http://www.foobar.com/some_movie.mov"/> <!-- custom arguments --> <param name="loop" value="true"/> </object> the classid attribute tells ie to create an instance of the plug-in hosting control, the width and height specify the dimensions in pixels.
...the following <embed> attributes have <param> tag equivalents: <param name="type" ...> is equivalent to typespecifies the mime type of the plug-in.
...if you havent't specified a "type" param, the control will attempt to use the mime type of this stream to create the correct plug-in.
Bookmark Keywords - Archive of obsolete content
once that's done, all it takes to go to the cnn home page would be to type <tt>cnn</tt> into the address bar.
...for example, a keyworded bookmark could be set up so that a user could type <tt>google spam and eggs</tt> and thereby trigger a google search for the words "spam and eggs." because these tools require bookmarks with specific keywords in order to work, they will be referred to hereafter as keymarks, as distinct from regular bookmarks.
... with that done, all you have to do in the future is type <tt>bz</tt> followed by a space and the bug's number into mozilla's address bar, and the browser will jump right to the bug with that number.
...thus we could type any of the following into the address bar and get back useful results: <tt>google geitost</tt> <tt>google mozilla keyword bookmark</tt> <tt>google bookmark site:developer.netscape.com</tt> <tt>google netscape xml support -site:netscape.com</tt> a few examples in the course of writing this article, a number of potentially useful bookmarks were considered as possible examples.
Creating a Firefox sidebar extension - Archive of obsolete content
chrome/content/emptysidebar.xul <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css" ?> <?xml-stylesheet href="chrome://browser/skin/browser.css" type="text/css" ?> <!doctype page system "chrome://emptysidebar/locale/emptysidebar.dtd"> <page id="sbemptysidebar" title="&emptysidebar.title;" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" > <vbox flex="1"> <label id="atest" value="&emptysidebar.title;" /> </vbox> </page> new ext...
...chrome/content/firefoxoverlay.xul <?xml version="1.0"?> <!doctype overlay system "chrome://emptysidebar/locale/emptysidebar.dtd"> <overlay id="emptysidebaroverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <menupopup id="viewsidebarmenu"> <menuitem key="key_openemptysidebar" observes="viewemptysidebar" /> </menupopup> <keyset id="mainkeyset"> <key id="key_openemptysidebar" command="viewemptysidebar" key="&openemptysidebar.commandkey;" modifiers="&opene...
...mptysidebar.modifierskey;" /> </keyset> <broadcasterset id="mainbroadcasterset"> <broadcaster id="viewemptysidebar" label="&emptysidebar.title;" autocheck="false" type="checkbox" group="sidebar" sidebarurl="chrome://emptysidebar/content/emptysidebar.xul" sidebartitle="&emptysidebar.title;" oncommand="togglesidebar('viewemptysidebar');" /> </broadcasterset> </overlay> the overlay file consists of three entries, the menu definition, shortcut keys and the broadcaster.
...the chrome manifest creates a lookup for all the resource types used by the extension.
Drag and Drop JavaScript Wrapper - Archive of obsolete content
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.
...the type of data being dragged is stored as a set of flavors.
...a flavor object has a name, which is a formatted like a mime type, such as 'text/unicode'.
...var textobserver = { ondrop : function (event, transferdata, session) { event.target.setattribute("value",transferdata.data); } } the flavour system used allows multiple objects of various types to be dragged at once and also allows alternative forms of the data to be dragged.
Table Layout Regression Tests - Archive of obsolete content
a typical beginning of a dump (*.rgd file) looks like: <frame va="15022440" type="viewport(-1)" state="270340" parent="0"> <view va="47171904"> </view> <stylecontext va="15022232"> <font serif 240 240 0 /> <color data="-16777216"/> <background data="0 2 3 -1 0 0 "/> <spacing data="left: null top: null right: null bottom: null left: null top: null right: null bottom: null left: 1[0x1]enum top: 1[0x1]enum right: 1[0x1]enum bottom: 1[0x1]enum left: null...
...data="0 1 0 0 0 0 0 0 0 0 0 0 " /> <visibility data="0 1 1.000000" /> <table data="0 0 4 -1 1 " /> <tableborder data="1 null null 0 2 " /> <content data="0 0 0 null " /> <quotes data="0 " /> <ui data="3 0 0 1 " /> <uireset data="7 0 4" /> <xul data="0 0 0 0 0 1 <svg data="0 1.000000 1.000000 0 1.000000" /> </stylecontext> the baseline log will look like: type manifest file: e:\moz_src\mozilla\obj-i586-pc-msvc\dist\bin\components\xpti.dat +++ javascript debugging hooks installed.
...a typical part of the verify log would look like: type manifest file: e:\moz_src\mozilla\obj-i586-pc-msvc\dist\bin\components\xpti.dat +++ javascript debugging hooks installed.
... additional notes there is a special type of frame dumps - the printing regression tests, they are invoked by the -prt command line argument to the viewer and include first a display then a frame dump taking into account the printer pages.
Anonymous Content - Archive of obsolete content
a sample xbl binding for the file widget might look as follows: <binding id="fileupload"> <content> <html:input type="text"/> <html:input type="button"/> </content> </binding> because this content is not visible to its parent element, it is said to be anonymous content.
... <xbl:binding id="fileuploadcontrol"> <xbl:content> <html:input type="text" xbl:inherits="value"/> <html:input type="button" value="browse..."/> </xbl:content> </xbl:binding> each entry in the inherits list can either simply list an attribute (such as value in the example above), or it can specify an = separated pair consisting of the attribute on the anonymous content that should be tied to the attribute on the bound element.
... there are two types of insertion points: explicit and inherited.
...stop) is specific to the event type.
XML in Mozilla - Archive of obsolete content
mozilla will read internal (dtd) subsets, and in special circumstances external dtds as explained above and will use this information to recognize id type attributes, default attribute values, and general entities.
...we treat xhtml documents differently depending on the mime type (or file suffix if files are loaded from local discs).
... mime type file suffix code path text/xml application/xml application/xhtml+xml xml xht xhtml xml text/html html htm html the entire document need not be xhtml.
...the correct xhtml namespace is http://www.w3.org/1999/xhtml please note that the xhtml entities, like &auml;, work only in conforming xhtml documents that have a valid xhtml formal public identifier (or in other words, a doctype section with a public identifier).
WinRegValue - Archive of obsolete content
syntax winregvalue ( int datatype, byte[] regdata); parameters the winregvalue constructor takes the following parameter: datatype an integer indicating the type of the data encapsulated by this object.
... returns a new winregvalue object, with the data members type and data set to the values passed to this constructor.
...an object of this type has two fields: the type of the data and the value.
... for information on the possible data types for a registry value, see your windows api documentation.
Uploading and Downloading Files - Archive of obsolete content
the exact method depends on the type of upload that you wish to perform.
...this is done by using an html <input> element using the file type from within a form.
... a formdata object will automatically generate request data with mime type multipart/form-data that existing servers can process.
... function uploadput(posturl, filepath) { var req = new xmlhttprequest(); req.open("put", posturl); req.setrequestheader("content-type", "text/plain"); req.onload = function(event) { alert(event.target.responsetext); } req.send(new file(filepath)); } in this example, a new input stream is created for a file, and is passed to the xmlhttprequest's send method.
openWindow - Archive of obsolete content
« xul reference home openwindow( windowtype, url, features, params ) return type: window open a child window.
... the windowtype is a string specifying a window type.
... if a window with that type is already open, this method will just switch that window to the front and focus it instead of opening another window.
... if a window of the type is not open, a new one is opened displaying the supplied url.
OpenClose - Archive of obsolete content
the openpopup method regardless of the type of popup, you may wish to open the popup programatically.
...this method may be used for any type of popup, either a menupopup, a panel, or a tooltip, including ones that can be opened via other means, for instance, a popup attached via the context attribute.
... for other types of popups, the state property may be examined to determine whether a popup is open or not.
... this property is available for all types of popups, including menus, panels and tooltips.
currentIndex - Archive of obsolete content
« xul reference currentindex type: integer set to the row index of the tree caret in the tree.
... you cannot rely on this property to change or determine a tree selection, except for trees with seltype="single".
... (all trees have seltype="multiple" by default.) to reliably change or determine a selection, instead use the nsitreeselection interface methods available via tree.view.selection.
...<script language ="javascript"> function treerowclicked(){ var tree = document.getelementbyid("my-tree"); var selection = tree.view.selection; var celltext = tree.view.getcelltext(tree.currentindex, tree.columns.getcolumnat(0)); alert(celltext); } </script> <tree id="my-tree" seltype="single" onselect="treerowclicked()"> <treecols> <treecol label="title" flex="1"/><treecol label="url" flex="1"/> </treecols> <treechildren> <treeitem> <treerow> <treecell label="joe@somewhere.com"/> <treecell label="top secret plans"/> </treerow> </treeitem> <treeitem> <treerow> <treecell label="mel@whereever.com"/> <treecell label="let's do lunch"/> </treer...
Property - Archive of obsolete content
« xul reference accessible accessibletype accesskey align allnotifications allowevents alwaysopenpopup amindicator applocale autocheck autofill autofillaftermatch boxobject browsers builder builderview buttons canadvance cangoback cangoforward canrewind checked checkstate child children classname clickselectsall clientheight clientwidth collapsed color columns command commandmanager completedefaultindex container contentdocument contentprincipal contenttitle contentview contentvieweredit contentviewerfile contentwindow contextmenu control controller controllers crop current currentindex currentitem currentnotification currentpage currentpane currentset currenturi custom...
...toolbarcount database datasources date dateleadingzero datevalue decimalplaces decimalsymbol defaultbutton defaultvalue description dir disableautocomplete disableautocomplete disableautoselect disabled disablekeynavigation dlgtype docshell documentcharsetinfo editable editingcolumn editingrow editingsession editor editortype emptytext deprecated since gecko 2 enablecolumndrag eventnode firstordinalcolumn firstpermanentchild flex focused focuseditem forcecomplete group handlectrlpageupdown handlectrltab hasuservalue height hidden hideseconds highlightnonmatches homepage hour hourleadingzero id ignoreblurwhilesearching image increment inputfield inverted is24hourclock ispm issearching ...
...nly readonly ref resource resultspopup scrollboxobject scrollincrement scrollheight scrollwidth searchbutton searchcount searchlabel searchparam searchsessions second secondleadingzero securityui selected selectedbrowser selectedcount selectedindex selecteditem selecteditems selectedpanel selectedtab selectionend selectionstart selstyle seltype sessioncount sessionhistory showcommentcolumn showpopup size smoothscroll spinbuttons src state statusbar statustext stringbundle strings style subject suppressonselect tabcontainer tabindex tabs tabscrolling tabpanels tag textlength textvalue timeout title toolbarname toolbarset tooltip tooltiptext top treeboxobject type uri u...
...t.children dom:element.clientheight dom:element.clientleft dom:element.clienttop dom:element.clientwidth dom:element.clonenode dom:element.firstchild dom:element.firstelementchild dom:element.lastchild dom:element.lastelementchild dom:element.localname dom:element.namespaceuri dom:element.nextelementsibling dom:element.nextsibling dom:element.nodename dom:element.nodetype dom:element.nodevalue dom:element.ownerdocument dom:element.parentnode dom:element.prefix dom:element.previouselementsibling dom:element.previoussibling dom:element.scrollheight dom:element.scrollleft dom:element.scrolltop dom:element.scrollwidth dom:element.tagname dom:element.textcontent ...
Building Trees - Archive of obsolete content
but moreover, it uses a subtype of the main builder called the tree builder.
... note: while a tree builder can only be used with trees, a content builder can be used with any type of content.
...here is an example of a tree using an sqlite datasource: <tree datasources="profile:messages.sqlite" ref="*" querytype="storage" flags="dont-build-content"> <treecols> <treecol id="subject" label="subject" flex="3"/> <treecol id="sender" label="sender" flex="2"/> <treecol id="date" label="date" flex="1"/> </treecols> <template> <query> select subject, sender, date from messages </query> <action> <treechildren> <treeitem uri="?"> <treerow> <tr...
...whether a cell is a normal labeled value, a progress meter or a checkbox is determined by the type attribute on the column the cell is in.
Multiple Rules - Archive of obsolete content
in this situtation, you would want to use different output for each type.
...here is another example for an xml source: <radiogroup datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="person"/> <rule> <where subject="?gender" rel="equals" value="male"/> <action> <radio uri="?" label="?name is male"/> </action> </rule> <rule> <action> <radio uri="?" label="?name is female" disabled="true"/> </action> </rule> </template> </radiogroup> in this example, all male people are matched...
...this would be useful for comparing a field that identified the type of a result.
...a value comes before another alphabetically aftermatch if a value comes after another alphabetically startswithmatch if a value starts with a specific string endswithmatch if a value ends with a specific string containsmatch if a value contains a substringto highlight results that contain a search term here is an example using the 'contains' operator: <vbox datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="person"> <assign var="?letters" expr="string-length(@name) - 1"/> </query> <rule> <where subject="?name" rel="contains" value=" "/> <action> <label uri="?" value="?name has two names for a total length of ?letters"/> </action> </rule> </template> </vbox> this example contains only one rule with a condition which c...
Box Model Details - Archive of obsolete content
the following is an outline of both types of boxes: horizontal boxes lay out their elements next to each other horizontally.
...remember that flexibility only has meaning for elements that are directly inside a box or an element that is a type of box.
...a find text dialog example 5 : source view <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findtext" title="find text" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <vbox flex="3"> <label control="t1" value="search text:"/> <textbox id="t1" style="min-width: 100px;" flex="1"/> </vbox> <vbox style="min-width: 150px;" flex="1" align="start"> <checkbox id="c1" label="ignore case"/> <spac...
...next, we will learn about a more specialized type of box, the groupbox.
Input Controls - Archive of obsolete content
textbox.type you can set this attribute to the special value password to create a textbox that hides what it types.
... note that while in html, several different kinds of fields can be created with the input element, in xul there are separate elements for each type.
... the following example shows some textboxes: example 1 : source view <label control="some-text" value="enter some text"/> <textbox id="some-text"/> <label control="some-password" value="enter a password"/> <textbox id="some-password" type="password" maxlength="8"/> multiline textbox the textbox examples above will create text inputs that can only be used for entering one line of text.
...the textbox is fully functional and you can type into it and select text.
More Menu Features - Archive of obsolete content
this involves the use of two attributes: type to indicate the type of check, and name to group commands together.
...example 2 : source view <toolbox> <menubar id="options-menubar"> <menu id="options_menu" label="options"> <menupopup> <menuitem id="backups" label="make backups" type="checkbox"/> <menuitem id="email" label="email administrator" type="checkbox" checked="true"/> </menupopup> </menu> </menubar> </toolbox> the type attribute has been added which is used to make the menu item checkable.
...menu with radios in addition to standard checks, you can create the radio style of checks by setting the type to a value of radio.
...the example below demonstrates this: example 3 : source view <toolbox> <menubar id="planets-menubar"> <menu id="planet-menu" label="planet"> <menupopup> <menuitem id="jupiter" label="jupiter" type="radio" name="ringed"/> <menuitem id="saturn" label="saturn" type="radio" name="ringed" checked="true"/> <menuitem id="uranus" label="uranus" type="radio" name="ringed"/> <menuseparator/> <menuitem id="earth" label="earth" type="radio" name="inhabited" checked="true"/> <menuitem id="moon" label="moon" type="radio" name="inhabited"/> </menupopup> <...
Stacks and Decks - Archive of obsolete content
there are a number of elements that are specialized types of boxes, such as toolbars and tabbed panels.
...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.
...a scroll bar is just a special type of box that creates its own elements if you don't provide them.
...they are all special types of boxes and allow all of the attributes of boxes on them.
Using the Editor from XUL - Archive of obsolete content
the xul contains an <editor> tag, e.g.: <editor type="content-primary" id="content-frame" src="about:blank" flex="1"/> the attribute type="content-primary" identifies this as the window content element, i.e.
... now we set up the editorshell by calling its init() method, telling it what type of editor we want (text or html), pointing it at the webshellwindow to use, and telling it the content node that it lives on: editorshell.init(); editorshell.seteditortype(editortype); editorshell.webshellwindow = window; editorshell.contentwindow = window._content; the webshellwindow (a settable attribute on nsieditorshell) points to the top-level window element, from which the editorshell...
...these get installed for all types of editor (i.e.
... nshtmleditor::editorkeypress() gets the character code from the key event, puts that into a string, and calls nshtmleditor::typedtext(), which simply calls nshtmleditor::inserttext().
Accessibility/XUL Accessibility Reference - Archive of obsolete content
this table is designed to show how to expose text properly for various xul element types.
...ontrol="butwrap2" value="<!--this-->" /> <label control="butwrap2" value="is" /> <label control="butwrap2" value="a" /> <label control="butwrap2" value="button" /> </button> <button image="images/img.xbm" tooltiptext="<!--button text-->"/> note that in the third example, only the first label is read browser jaws 7.10 issues to use a browser element with html, the type="content" attribute should be specified.
...therefore, with jaws 7.10, to use xul inside of a browser, the type attribute cannot not be used.
... caption see groupbox checkbox <checkbox label='<!--label text-->' /> colorpicker <colorpicker type="button" palettename="standard" /> colorpicker appears to read color values out if the colorpicker can get focus in the first place.
command - Archive of obsolete content
ng code will send a paste command (cmd_paste) to the currently focused element: // first include chrome://global/content/globaloverlay.js godocommand("cmd_paste"); example with two buttons <commandset><command id="cmd_openhelp" oncommand="alert('help');"/></commandset> <button label="help" command="cmd_openhelp"/> <button label="more help" command="cmd_openhelp"/> attributes disabled type: boolean indicates whether the element is disabled or not.
... label type: string the label that will appear on the element.
... oncommand type: script code this event handler is called when the command is activated.
... reserved type: string this attribute applies to a command element.
commandset - Archive of obsolete content
attributes commandupdater, events, oncommandupdate, targets example <commandset> <command id="cmd_open" oncommand="alert('open!');"/> <command id="cmd_help" oncommand="alert('help!');"/> </commandset> attributes commandupdater type: boolean if true, the commandset is used for updating commands.
... events type: comma-separated list a comma-separated list of event names that the command updater will update upon.
... oncommandupdate type: script code this event occurs when a command update occurs.
... targets type: comma-separated list of element ids a comma-separated list of element ids that the command updater will update upon.
rule - Archive of obsolete content
ArchiveMozillaXULrule
attributes iscontainer, isempty, parent, parsetype examples (example needed) attributes iscontainer type: boolean indicates whether rules match based on containment.
... isempty type: boolean indicates whether rules match based on emptyness.
... parent type: element tag name if set, the rule will only match the corresponding tag.
... parsetype type: string if this attribute is set to integer, the rule will only match rdf nodes with a parse type of integer.
scrollbar - Archive of obsolete content
attributes curpos, increment, maxpos, pageincrement examples <scrollbar curpos="5" maxpos="50"/> attributes curpos type: integer the current position of the scrollbar, which ranges from 0 to the value of the maxpos attribute.
... increment type: integer the amount by which the curpos (for scroll bars) or value (for number boxes and scale) attribute changes when the arrows are clicked(or scales are dragged).
... maxpos type: integer the maximum position of the scrollbar.
... 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.
tabpanels - Archive of obsolete content
attributes selectedindex properties selectedindex, selectedpanel examples (example needed) attributes selectedindex type: integer gets and sets the index of the currently selected panel.
... from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessible type: nsiaccessible returns the accessibility object for the element.
... selectedindex type: integer returns the index of the currently selected item.
...returns -1 if no items are selected selectedpanel type: element holds a reference to the currently selected panel within a <tabbox> element.
treeitem - Archive of obsolete content
attributes container, empty, label, open, uri examples (example needed) attributes container type: boolean set to true if the element is to act as a container which can have child elements.
... empty type: boolean set to true if the element is a container that contains no children.
... open type: boolean for the menu type buttons, the open attribute is set to true when the menu is open.
... uri type: string for template-generated content, the attribute should be placed on the element where content generation should begin.
triple - Archive of obsolete content
attributes object, predicate, subject examples (example needed) attributes object type: string the object of the element.
... predicate type: uri the predicate or property to match.
... subject type: string the subject of the element.
... from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
CommandLine - Archive of obsolete content
an nsicommandline object is passed as the first argument of the launched window: example var cmdline = window.arguments[0]; cmdline = cmdline.queryinterface(components.interfaces.nsicommandline); alert(cmdline.handleflagwithparam("test", false)); see also: chrome: command line for single instance applications of course, for a single instance application (see toolkit.singletonwindowtype for more information), the last example still applies the first time your application is launched.
...e) || aiid.equals(nsisupports)) return this; throw components.results.ns_error_no_interface; }, /* nsimodule */ getclassobject : function mod_gch(acompmgr, acid, aiid) { if (acid.equals(class_id)) return apphandler.queryinterface(aiid); throw components.results.ns_error_failure; }, registerself : function mod_regself(acompmgr, afilespec, alocation, atype) { var compreg = acompmgr.queryinterface(nsicomponentregistrar); compreg.registerfactorylocation(class_id, class_name, contract_id, afilespec, alocation, atype); var catman = components.classes["@mozilla.org/categorymanager;1"] .getservice(nsicategorymanager); catman.addcategoryentry("command-line-handler", ...
... cld_category, contract_id, true, true); }, unregisterself : function mod_unreg(acompmgr, alocation, atype) { var compreg = acompmgr.queryinterface(nsicomponentregistrar); compreg.unregisterfactorylocation(class_id, alocation); var catman = components.classes["@mozilla.org/categorymanager;1"] .getservice(nsicategorymanager); catman.deletecategoryentry("command-line-handler", cld_category); }, canunload : function (acompmgr) { return true; } }; function nsgetmodule(acompmgr, afilespec) { return apphandlermodule; } create an observer that will get notified when arguments change: chrome/content/cmdline.js function commandlineobserver() { this.register(); } commandlineobserver.prototype = { observe: funct...
... .getservice(components.interfaces.nsiobserverservice); observerservice.notifyobservers(window.arguments[0], "commandline-args-changed", null); addeventlistener("unload", observer.unregister, false); finally, add a reference in your application window to the observer: chrome/content/window.xul <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="main" title="&window.title;" windowtype="xulmine" style="width: 300px; height: 350px;" persist="screenx screeny width height sizemode"> <script type="application/javascript" src="cmdline.js" /> ...
NPN NewStream - Archive of obsolete content
syntax #include <npapi.h> nperror npn_newstream(npp instance, npmimetype type, const char* target, npstream** stream); parameters the function has the following parameters: instance pointer to current plug-in instance.
... type mime type of the stream.
...the mime parameter is the mime type of the plug-in to create.
... a plug-in can create another instance of itself by specifying its own mime type and a new target name in a call to npn_newstream.
NPN_PostURL - Archive of obsolete content
if null, pass the new stream back to the current plug-in instance regardless of mime type.
...if the target parameter is null, the new stream is passed to the plug-in regardless of mime type.
...the file-type url prefix "file://" is optional.
... possible url types include http (similar to an html form submission), mail (sending mail), news (posting a news article), and ftp (upload a file).
NPWindow - Archive of obsolete content
syntax typedef struct _npwindow { void* window; /* platform specific handle */ uint32_t x; /* coordinates of top left corner */ uint32_t y; /* relative to a netscape page */ uint32_t width; /* maximum window size */ uint32_t height; nprect cliprect; /* clipping rectangle coordinates */ #ifdef xp_unix void * ws_info; /* platform-dependent additional data */ #endif /* xp_unix */ npwindowtype type; /* window or drawable target */ } npwindow; fields the data structure has the following fields: window platform-specific handle to a native window element in the net...
... type npwindowtype value that specifies whether the npwindow instance represents a window or a drawable.
... values: npwindowtypewindow: indicates that the window field holds a platform-specific handle to a window (as in navigator 2.0 and navigator 3.0).
... npwindowtypedrawable: indicates that the plugin is windowless.
Adobe Flash - Archive of obsolete content
<script type="text/javascript">identifyflash();</script> typically, javascript code that determines what version of the plugin is installed looks at the mimetypes array that is part of the navigator object.
...an algorithmic approach to detecting flash plugin version might be: var plugin = navigator.mimetypes["application/x-shockwave-flash"].enabledplugin; var description = plugin.description; // 1.
...the example below shows both types of communication in action: example 3: javascript to flash communication and fscommands -- flash to javascript communication the example is missing.
...4553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id="myflash" width="250" height="150" viewastext> <param name="movie" value="js2flash.swf" /> <param name="quality" value="high"></param> <embed src="js2flash.swf" width="250" height="150" swliveconnect="true" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="myflash"> </embed> </object> .....
Table Reflow Internals - Archive of obsolete content
absolutely positioned elements) reflows reflowee and passes a reflow state (in) and a reflow metrics (in/out) review of reflow the reflow state: is a node in a tree structurally equivalent to the frame tree of reflow participants contains: reflow type, avail size, various computed values, resolved style structs possible request for preferred size and more.
... kinds of reflows initial - reflowee's first reflow must be of this type (reflower's responsibility).
...incremental - has a reflow path (tree) where each node has a command with a target frame, reflow command types are: dirty - something changed inside a target (e.g.
...nly used for fixed positioned frames kinds of reflows incremental reflow (continued) reflower not allowed to change available size of reflowee reflow commands get coalesced to streamline processing style change a target changed stylistic if there is a target, otherwise every frame may need to respond parent of target usually turns it into an incremental reflow with a style changed command type table frames nstableouter frame ↙ ↘ nstable frame nstablecaption frame ↙ ↘ ↓ nstablecol groupframe nstablerow groupframe nsblockframe ↓ ↓ nstablecol frame nstablerow frame ↓ nstablecell frame ↓ nsblock frame table reflow outer table reflows tabl...
-ms-content-zoom-snap - Archive of obsolete content
the -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.
... initial valueas each of the properties of the shorthand:-ms-content-zoom-snap-type: none-ms-content-zoom-snap-points: snapinterval(0%, 100%)applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas each of the properties of the shorthand:-ms-content-zoom-snap-type: as specified-ms-content-zoom-snap-points: as specifiedanimation typediscrete syntax the -ms-content-zoom-snap shorthand property is specified as one or both of the following content zoom snap values, in order, separated by spaces.
... values -ms-content-zoom-snap-type value of the -ms-content-zoom-snap-type property.
... formal syntax <'-ms-content-zoom-snap-type'> | <'-ms-content-zoom-snap-points'> specifications not part of any specification.
::-ms-clear - Archive of obsolete content
the ::-ms-clear css pseudo-element creates a clear button at the edge of an <input type="text"> text control that clears the current value.
...this includes inputs that appear text-like or fall back to type="text".
... such inputs include: <input type="color"> <input type="date"> <input type="datetime"> <input type="datetime-local"> <input type="email"> <input type="month"> <input type="number"> <input type="search"> <input type="tel"> <input type="time"> <input type="url"> <input type="week"> allowable properties only the following css properties can be used in a rule with ::-ms-clear in its selector.
...es block, inline-block, none) @font-face font-size font-style font-weight height margin-bottom margin-left margin-right margin-top opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin visibility width syntax ::-ms-clear example html <form> <label for="firstname">first name:</label> <input type="text" id="firstname" name="firstname" placeholder="first name"> <br> <label for="lastname">last name:</label> <input type="text" id="lastname" name="lastname" placeholder="second name"> </form> css input, label { display: block; } input[type=text]::-ms-clear { color: red; /* this sets the cross color as red.
E4X for templating - Archive of obsolete content
security and escaping function e (str) { if (typeof str === 'xml') {str = str.tostring();} return str; } function quot (s) { // useful for placing user input within inline javascript; may be combined with escape function above as well if (typeof s === 'string') { return s.replace(/"/g, '&quot;').replace(/'/g, '&apos;'); } if (typeof s === 'xml') { return s.tostring().replace(/"/g, '&quot;').replace(/'/g, '&apos;'...
... createbundle('chrome://myeext/locale/myext.properties'); if (args){ args = array.prototype.slice.call(arguments, 1); return strs.formatstringfromname(msg,args,args.length); } return strs.getstringfromname(msg); } for example, <toolbarbutton label={$s('mytoolbar.label')}/> conditionals function _if (cond, h, _else) { if (cond && cond != undefined) { // we need undefined condition for e4x return h(cond); } else if (_else) { return _else(cond)...
... /* the first two arguments are optional: (h is a handler with an explicit argument v only, or beginning with k, v) lev is optional argument to note recursive depth (if part of recursion) */ function foreach (min, max, arr, h, lev) { var k, ret=<></>, it = 1; lev = lev || 0; if (typeof min === 'number') { if (typeof max !== 'number') { lev = h; h = arr; arr = max; max = min; min = 1; } } else { lev = arr; h = max; arr = min; max = number.positive_infinity; min = 1; } if (h.length === 1) { for (k in arr) { if (it < min) { ...
...image src="chrome://myext/skin/images/fillerrow.jpg" /></row> </>)} sorting /* @param {xmllist} xmllist the xmllist to sort @param {function} h the sorting handler */ function sort (xmllist, h) { var k, arr=[], ret = <></>; for (k in xmllist) { if (xmllist.hasownproperty(k)) { arr.push(xmllist[k]); } } arr.sort(h).foreach(function (item) { if (typeof item === 'xml') { ret += item; } else if (typeof item === 'string') { ret += new xml(item); } else { var ser = (new xmlserializer()).serializetostring(item); ret += new xml(ser); } }); return ret; } example: var fruits = <fruits> <item>pear</item> <item>banana</item> <item>grapes</item>...
The global XML object - Archive of obsolete content
extending xml.prototype xml.prototype and xmllist.prototype (xmllist.prototype is actually just xml.prototype) cannot be extended in the same conventional way as other constructors such as object.
... you can only define methods in xml.prototype and not fields.
... to add a method to xml.prototype, define xml.prototype.function::methodname or xml.prototype.function::[methodnamestring].
... the following example defines the foocount() method, which returns the amount of <foo> elements in the xml: xml.prototype.function::foocount = function foocount() { return this..foo.length(); }; <foobar><foo/><foo/><foo/></foobar>.foocount() // returns 3 ignorecomments true by default.
ActiveXObject - Archive of obsolete content
syntax let newobj = new activexobject(servername.typename[, location]) parameters servername the name of the application providing the object.
... typename the type or class of the object to create.
... remarks automation servers provide at least one type of object.
... you may be able to identify servername.typename values on a host pc in the hkey_classes_root registry key.
New in JavaScript 1.2 - Archive of obsolete content
arguments new properties function.arity new methods array.prototype.concat() array.prototype.slice() string.prototype.charcodeat() string.prototype.concat() string.fromcharcode() string.prototype.match() string.prototype.replace() string.prototype.search() string.prototype.slice() string.prototype.substr() new operators delete equality operators (== and !=) new statements labeled statements switch do...while import export other new featu...
... array.prototype.sort() now works on all platforms.
... string.prototype.split() it can take a regular expression argument, as well as a fixed string, by which to split the object string.
... string.prototype.substring(): no longer swaps index numbers when the first index is greater than the second.
JavaObject - Archive of obsolete content
summary core object the type of a wrapped java object accessed from within javascript code.
... created by any java method which returns an object type.
... any java data brought into javascript is converted to javascript data types.
...see the core javascript 1.5 guide for more information about data type conversions.
XForms Alert Element - Archive of obsolete content
type restrictions the alert element can be bound to any simple content.
... examples <xforms:model> <xforms:instance> <data xmlns=""> <x>10</x> </data> </xforms:instance> <xforms:bind id="x" nodeset="x" type="xsd:integer"/> </xforms:model> <style> @namespace xforms url("http://www.w3.org/2002/xforms"); xforms|input:invalid xforms|alert.inline { display: inline; font-style: italic; width: 40%; } } </style> <xforms:input bind="x"> <xforms:label>you can type only numbers (validation happens on blur): </xforms:label> <xforms:alert>wrong value!
... you should type only numbers!</xforms:alert> </xforms:input> <xforms:input bind="x"> <xforms:label>you can type only numbers (validation happens on blur): </xforms:label> <xforms:alert class="inline">wrong value!
... you should type only numbers!</xforms:alert> </xforms:input> ...
Describing microformats in JavaScript - Archive of obsolete content
datatype the type of data contained by the property.
...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 property indicates the type of address represented by the object (work, home, and so forth).
... since the plural property is true, multiple types can be specified.
Building up a basic demo with Three.js - Game development
html structure here's the html structure we will use: <!doctype html> <html> <head> <meta charset="utf-8"> <title>mdn games: three.js demo</title> <style> body { margin: 0; padding: 0; } canvas { width: 100%; height: 100%; } </style> </head> <body> <script src="three.min.js"></script> <script> var width = window.innerwidth; var height = window.innerheight; /* all our javascript code goes here */ </script> </body> </html> it contains some basic in...
... there are other types of camera available (cube, orthographic), but the simplest is perspective.
... lights there are various types of light sources available in three.js.
...you should check the documentation for other types of lights, like ambient, directional, hemisphere, or spot.
Tiles and tilemaps overview - Game development
visual grid: includes indices showing what type of tile should be placed on each position in the grid.
... logic grid: this can be a collision grid, a path-finding grid, etc., depending on the type of game.
...for instance, a rock that could appear on top of several terrain types (like grass, sand or brick) could be included on it's own separate tile which is then rendered on a new layer, instead of several rock tiles, each with a different background terrain.
... the following screenshot shows an example of both points: a character appearing behind a tile (the knight appearing behind the top of a tree) and a tile (the bush) being rendered over different terrain types.
Visual-js game engine - Game development
( + server engine tools + server part of web apps ) -3d part : webgl based on three.js engine -3d part : webgl2 based on glmatrix 2.0 -2d part (new): this is typescript based game engine (client part ts).
... add->new game object (form dialog for define type of new game object ) add->quick code (make your work faster - add usually code blocks) resources - explorer view for images and audios , you can drag or edit also need to execute node build_resources for creating resources object for engine.
... online demo examples at : https://jsfiddle.net/user/zlatnaspirala/fiddles/ demo slot mashine basic demo at : https://jsfiddle.net/zlatnaspirala/7d0d8v6d/ help about new 2d part - implementation of matter.js based typescript .
... npm install typescript npm i clean-webpack-plugin --save-dev npm i html-webpack-plugin --save-dev possible fix : npm i webpack --save-dev npm i extract-text-webpack-plugin --save-dev fix code format : tslint -c tslint.json 'src/**/*.ts' --fix download project link : download link from bitbucket.
Primitive - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript, a primitive (primitive value, primitive data type) is data that is not an object and has no methods.
... there are 6 primitive data types: string, number, bigint, boolean, undefined, and symbol.
... there also is null, which is seemingly primitive, but indeed is a special case for every object: and any structured type is derived from null by the prototype chain.
... learn more general knowledge introduction to javascript data types primitive data type on wikipedia ...
HTML: A good basis for accessibility - Learn web development
<a href="#" align="center">home</a> </td> <td width="200"> <a href="#" align="center">our team</a> </td> <td width="200"> <a href="#" align="center">projects</a> </td> <td width="200"> <a href="#" align="center">contact</a> </td> <td width="300"> <form width="300"> <input type="search" name="q" placeholder="search query" width="300"> </form> </td> <td width="100"> <button width="100">go!</button> </td> </tr> <!-- spacer row --> <tr id="spacer" height="10"> <td> </td> </tr> <!-- main content and aside row --> <tr id="main"> <td id="content" colspan="4" bgcolor="#ffff...
...veloper.mozilla.org">mozilla developer network</a>.</p> <h2>buttons</h2> <p> <button data-message="this is from the first button">click me!</button> <button data-message="this is from the second button">click me too!</button> <button data-message="this is from the third button">and me!</button> </p> <h2>form</h2> <form> <div> <label for="name">fill in your name:</label> <input type="text" id="name" name="name"> </div> <div> <label for="age">enter your age:</label> <input type="text" id="age" name="age"> </div> <div> <label for="mood">choose your mood:</label> <select id="mood" name="mood"> <option>happy</option> <option>sad</option> <option>angry</option> <option>worried</option> </select> </div> </form> this means usin...
...the following seems like a reasonable enough example: fill in your name: <input type="text" id="name" name="name"> however, this is not so useful for disabled users.
...if you access this with some screen readers, you may only be given a description along the lines of "edit text." the following is a much better example: <div> <label for="name">fill in your name:</label> <input type="text" id="name" name="name"> </div> with code like this, the label will be clearly associated with the input; the description will be more like "fill in your name: edit text." as an added bonus, in most browsers associating a label with a form input means that you can click the label to select or activate the form element.
HTML: A good basis for accessibility - Learn web development
<a href="#" align="center">home</a> </td> <td width="200"> <a href="#" align="center">our team</a> </td> <td width="200"> <a href="#" align="center">projects</a> </td> <td width="200"> <a href="#" align="center">contact</a> </td> <td width="300"> <form width="300"> <input type="search" name="q" placeholder="search query" width="300"> </form> </td> <td width="100"> <button width="100">go!</button> </td> </tr> <!-- spacer row --> <tr id="spacer" height="10"> <td> </td> </tr> <!-- main content and aside row --> <tr id="main"> <td id="content" colspan="4" bgcolor="#ffff...
...veloper.mozilla.org">mozilla developer network</a>.</p> <h2>buttons</h2> <p> <button data-message="this is from the first button">click me!</button> <button data-message="this is from the second button">click me too!</button> <button data-message="this is from the third button">and me!</button> </p> <h2>form</h2> <form> <div> <label for="name">fill in your name:</label> <input type="text" id="name" name="name"> </div> <div> <label for="age">enter your age:</label> <input type="text" id="age" name="age"> </div> <div> <label for="mood">choose your mood:</label> <select id="mood" name="mood"> <option>happy</option> <option>sad</option> <option>angry</option> <option>worried</option> </select> </div> </form> this means usin...
...the following seems like a reasonable enough example: fill in your name: <input type="text" id="name" name="name"> however, this is not so useful for disabled users.
...if you access this with some screen readers, you may only be given a description along the lines of "edit text." the following is a much better example: <div> <label for="name">fill in your name:</label> <input type="text" id="name" name="name"> </div> with code like this, the label will be clearly associated with the input; the description will be more like "fill in your name: edit text." as an added bonus, in most browsers associating a label with a form input means that you can click the label to select or activate the form element.
Cascade and inheritance - Learn web development
it is basically a measure of how specific a selector's selection will be: an element selector is less specific — it will select all elements of that type that appear on a page — so will get a lower score.
...essentially a value in points is awarded to different types of selectors, and adding these up gives you the weight of that particular selector, which can then be assessed against other potential matches.
...in actuality, each selector type has its own level of specificity that cannot be overwritten by selectors with a lower specificity level.
... overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Flexbox - Learn web development
now add the following rule below the previous one: article:nth-of-type(3) { flex: 2; } now when you refresh, you'll see that the third <article> takes up twice as much of the available width as the other two — there are now four proportion units available in total (since 1 + 1 + 2 = 4).
...try updating your existing article rules like so: article { flex: 1 200px; } article:nth-of-type(3) { flex: 2 200px; } this basically states "each flex item will first be given 200px of the available space.
... article { flex: 1 200px; } article:nth-of-type(3) { flex: 3 200px; display: flex; flex-flow: column; } next, we select the first <div>.
... article:nth-of-type(3) div:first-child { flex:1 100px; display: flex; flex-flow: row wrap; align-items: center; justify-content: space-around; } finally, we set some sizing on the button, but more interestingly we give it a flex value of 1 auto.
Introduction to CSS layout - Learn web development
the methods that can change how elements are laid out in css are as follows: the display property — standard values such as block, inline or inline-block can change how elements behave in normal flow, for example making a block-level element behave like an inline element (see types of css boxes for more information).
...by understanding the nature of each layout task, you will soon find that when you look at a particular component of your design the type of layout best suited to it will often be clear.
... there are five types of positioning you should know about: static positioning is the default that every element gets — it just means "put the element into its normal position in the document layout flow — nothing special to see here".
... <form> <p>first of all, tell us your name and age.</p> <div> <label for="fname">first name:</label> <input type="text" id="fname"> </div> <div> <label for="lname">last name:</label> <input type="text" id="lname"> </div> <div> <label for="age">age:</label> <input type="text" id="age"> </div> </form> now, the css for our example.
Styling links - Learn web development
tarea> <h2>css input</h2> <textarea id="code" class="css-input" style="width: 90%;height: 10em;padding: 10px;border: 1px solid #0095dd;">a { } a:link { } a:visited { } a:focus { } a:hover { } a:active { }</textarea> <h2>output</h2> <div class="output" style="width: 90%;height: 10em;padding: 10px;border: 1px solid #0095dd;"></div> <div class="controls"> <input id="reset" type="button" value="reset" style="margin: 10px 10px 0 0;"> <input id="solution" type="button" value="show solution" style="margin: 10px 0 0 10px;"> </div> </div> var htmlinput = document.queryselector(".html-input"); var cssinput = document.queryselector(".css-input"); var reset = document.getelementbyid("reset"); var htmlcode = htmlinput.value; var csscode = cssinput.value; var output = docu...
... <li> elements are normally block by default (see types of css boxes for a refresher), meaning that they will sit on their own lines.
...you can find an assessment to verify that you've retained this information at the end of the module — see typesetting a community school homepage.
... previous overview: styling text next in this module fundamental text and font styling styling lists styling links web fonts typesetting a community school homepage ...
Example - Learn web development
a payment form html content <form method="post"> <h1>payment form</h1> <p>required fields are followed by <strong><abbr title="required">*</abbr></strong>.</p> <section> <h2>contact information</h2> <fieldset> <legend>title</legend> <ul> <li> <label for="title_1"> <input type="radio" id="title_1" name="title" value="a"> ace </label> </li> <li> <label for="title_2"> <input type="radio" id="title_2" name="title" value="k" > king </label> </li> <li> <label for="title_3"> <input type="radio" id="title_3" name="title" value="q"> queen ...
... </label> </li> </ul> </fieldset> <p> <label for="name"> <span>name: </span> <strong><abbr title="required">*</abbr></strong> </label> <input type="text" id="name" name="username"> </p> <p> <label for="mail"> <span>e-mail: </span> <strong><abbr title="required">*</abbr></strong> </label> <input type="email" id="mail" name="usermail"> </p> <p> <label for="pwd"> <span>password: </span> <strong><abbr title="required">*</abbr></strong> </label> <input type="password" id="pwd" name="password"> </p> </section> <section> <h2>payment information</h2> <p> <label for="card"> <span>card type:</span> </label> <select id="card...
..." name="usercard"> <option value="visa">visa</option> <option value="mc">mastercard</option> <option value="amex">american express</option> </select> </p> <p> <label for="number"> <span>card number:</span> <strong><abbr title="required">*</abbr></strong> </label> <input type="tel" id="number" name="cardnumber"> </p> <p> <label for="date"> <span>expiration date:</span> <strong><abbr title="required">*</abbr></strong> <em>formatted as mm/dd/yyyy</em> </label> <input type="date" id="date" name="expiration"> </p> </section> <section> <p> <button type="submit">validate the payment</button> </p> </section> </form> css content h1 { margin-top: 0; } ul { ma...
...padding: 0; list-style: none; } form { margin: 0 auto; width: 400px; padding: 1em; border: 1px solid #ccc; border-radius: 1em; } div+div { margin-top: 1em; } label span { display: inline-block; width: 120px; text-align: right; } input, textarea { font: 1em sans-serif; width: 250px; box-sizing: border-box; border: 1px solid #999; } input[type=checkbox], input[type=radio] { width: auto; border: none; } input:focus, textarea:focus { border-color: #000; } textarea { vertical-align: top; height: 5em; resize: vertical; } fieldset { width: 250px; box-sizing: border-box; margin-left: 136px; border: 1px solid #999; } button { margin: 20px 0 0 124px; } label { position: relative; } label em {...
What is JavaScript? - Learn web development
the updatename() code block (these types of reusable code blocks are called "functions") asks the user for a new name, and then inserts that name into the paragraph to update the display.
... if you swapped the order of the first two lines of code, it would no longer work — instead, you'd get an error returned in the browser developer console — typeerror: para is undefined.
... there are advantages to both types of language, but we won't discuss them right now.
...there are two types: a single line comment is written after a double forward slash (//), e.g.
Web performance resources - Learn web development
to load css asynchronously one can simpy set the media type to print and then change to all once loaded.
... <style type="text/css"> // insert your css here </style> javascript avoid javascript blocking by using the async or defer attributes, or link javascript assets after the page's dom elements.
...apply compression such as gzip or brotli for these file types.
... test your page's speed using webpagetest.org, where you can use different real device types and locations.
Multimedia: video - Learn web development
objective: to learn about the various video formats, their impact on performance, and how to reduce video impact on overall page load time while serving the smallest video file size based on each browsers file type support.
... for example, given video compressions in three different formats at 10mb, 12mb, and 13mb, declare the smallest first and the largest last: <video width="400" height="300" controls="controls"> <!-- webm: 10 mb --> <source src="video.webm" type="video/webm" /> <!-- mpeg-4/h.264: 12 mb --> <source src="video.mp4" type="video/mp4" /> <!-- ogg/theora: 13 mb --> <source src="video.ogv" type="video/ogv" /> </video> the browser downloads the first format it understands.
... see caniuse.com for current browser support of video and other media types.
... <video autoplay="" loop="" muted="true" playsinline="" id="hero-video"> <source src="banner_video.webm" type='video/webm; codecs="vp8, vorbis"'> <source src="web_banner.mp4" type="video/mp4"> </video> this hero-video code (above) is common to conference websites and corporate home pages.
Introduction to the server side - Learn web development
web frameworks are collections of functions, objects, rules and other code constructs designed to solve common problems, speed up development, and simplify the different types of tasks faced in a particular domain.
... server-side programming allows us to instead store the information in a database and dynamically construct and return html and other types of files (e.g.
...the content can even be targeted for the type of client device that is receiving it.
... note: the most common type of notification is a "confirmation of registration".
Website security - Learn web development
note: xss vulnerabilities have been historically more common than any other type of security threat.
... sql injection types include error-based sql injection, sql injection based on boolean errors, and time-based sql injection.
... this type of attack is best explained by example.
... one way to prevent this type of attack is for the server to require that post requests include a user-specific site-generated secret.
Getting started with Svelte - Learn web development
note: recently svelte has added official typescript support, one of its most requested features.
...currently should only contain setuptypescript.js, a script that sets up typescript support in svelte.
... finally the file public/index.html includes the generated bundle.css and bundle.js files: <!doctype html> <html lang="en"> <head> <meta charset='utf-8'> <meta name='viewport' content='width=device-width,initial-scale=1'> <title>svelte app</title> <link rel='icon' type='image/png' href='/favicon.png'> <link rel='stylesheet' href='/global.css'> <link rel='stylesheet' href='/build/bundle.css'> <script defer src='/build/bundle.js'></script> </head> <body> </body> </html> the mini...
... 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 svelte deployment and next steps ...
Vue conditional rendering: editing existing todos - Learn web development
copy the following code into that file: <template> <form class="stack-small" @submit.prevent="onsubmit"> <div> <label class="edit-label">edit name for &quot;{{label}}&quot;</label> <input :id="id" type="text" autocomplete="off" v-model.lazy.trim="newlabel" /> </div> <div class="btn-group"> <button type="button" class="btn" @click="oncancel"> cancel <span class="visually-hidden">editing {{label}}</span> </button> <button type="submit" class="btn btn__primary"> save <span class="visually-hidden">edit for {{label}}</span> </button> ...
... </div> </form> </template> <script> export default { props: { label: { type: string, required: true }, id: { type: string, required: true } }, data() { return { newlabel: this.label }; }, methods: { onsubmit() { if (this.newlabel && this.newlabel !== this.label) { this.$emit("item-edited", this.newlabel); } }, oncancel() { this.$emit("edit-cancelled"); } } }; </script> <style scoped> .edit-label { font-family: arial, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; color: #0b0c0c; display: block; margin-bottom: 5px; } input { display: inline-block; margin-top: 0.4rem; width: 100%; min-height: 4.4rem; padding: 0.4rem 0.8rem; ...
... <template> <div class="stack-small"> <div class="custom-checkbox"> <input type="checkbox" class="checkbox" :id="id" :checked="isdone" @change="$emit('checkbox-changed')" /> <label :for="id" class="checkbox-label">{{label}}</label> </div> <div class="btn-group"> <button type="button" class="btn" @click="toggletoitemeditform"> edit <span class="visually-hidden">{{label}}</span> </button> <button type="button" class="btn bt...
... 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 svelte deployment and next steps ...
Understanding client-side JavaScript frameworks - Learn web development
typescript support in svelte we will now learn how to use typescript in svelte applications.
... first we'll learn what typescript is and what benefits it can bring us.
... then we'll see how to configure our project to work with typescript files.
... finally we will go over our app and see what modifications we have to make to fully take advantage of typescript features.
Implementing feature detection - Learn web development
generally, such tests are done via one of the following common patterns: summary of javascript feature detection techniques feature detection type explanation example if member in object check whether a certain method or property (typically an entry point into using the api or other feature you are detecting for) exists in its parent object.
... see dive into html5 <input> types detection test.
...we first use the media attribute to only apply the brick css to the page if the page width is 480px or less: <link href="dist/brick.css" type="text/css" rel="stylesheet" media="all and (max-width: 480px)"> we then use matchmedia() in the javascript several times, to only run brick navigation functions if we are on the small screen layout (in wider screen layouts, everything can be seen at once, so we don't need to navigate between different views).
...lly, add another <script> element at the bottom of the html body (just before the </body> tag), and put the following script inside the tags: if (modernizr.geolocation) { navigator.geolocation.getcurrentposition(function(position) { let latlng = new google.maps.latlng(position.coords.latitude,position.coords.longitude); let myoptions = { zoom: 8, center: latlng, maptypeid: google.maps.maptypeid.terrain, disabledefaultui: true } let map = new google.maps.map(document.getelementbyid("map_canvas"), myoptions); }); } else { const para = document.createelement('p'); para.textcontent = 'argh, no geolocation!'; document.body.appendchild(para); } try your example out!
Handling common JavaScript problems - Learn web development
in the search packages text field, type "jslint" and press enter/return to search for linting-related packages.
... if you look at the console, you'll see the error message "uncaught typeerror: can't access property "length", heroes is undefined", and the referenced line number is 49.
... typed arrays allow javascript code to access and manipulate raw binary data, which is necessary as browser apis for example start to manipulate streams of raw video and audio data.
...jquery for example provides its own fully-featured selectors and dom manipuation libraries, to allow css-selector type selecting of elements in javascript and easier dom building.
Command line crash course - Learn web development
to change directory, you type cd into your terminal, followed by the directory you want to move to.
... note: a very useful terminal shortcut is using the tab key to autocomplete names that you know are present, rather than having to type out the whole thing.
... for example, if you wanted to go to a directory called src, located inside a directory called project, located on the desktop, you could type these three commands to get there from your home folder: cd desktop cd project cd src but this a waste of time — instead, you can type one command, with the different items in the path separated by forward slashes, just like you do when specifying paths to images or other assets in css, html, or javascript code: cd desktop/project/src note that including a leading slash on your path makes t...
... be configured to run upon save, as you type, or even before publishing your code (with additional tooling that we’ll see later on in the module).
Embedding API for Accessibility
/ no browse with caret setboolpref("accessibility.browsewithcaret", usecaret); /* if this pref is set, the caret will be visible in the text of the browser, allowing the user to cursor around the html content as if in a read-only editor */ moz 0.9 special content notifications the w3c uaag specifies types of content that must be optional.
...this is a much better alternative than having the user go through a long series of confirm boxes for each new page, for each type of content.
... for each preference named "browser.accept.*", there is also an "alert.audio.*" preference, to allow configuration of sound files to go with each type of content.
... one way of doing this is to build up the nsiwebbrowseraccessible interface, so that there is a method to force loading each type of content just for the current page in the current session.
Software accessibility: Where are we today?
type on a standard keyboard.
...if you're physically disabled, you may not be able to type on a regular keyboard or use a mouse.
...the sticky key technique is utilized by people who have only one usable hand, or who have no use of their hands and type using a stick in their mouth.
...when the user types something on the keyboard, or when an application displays text or images on the screen, the exact meaning of these actions is determined by the context in which they take place.
HTTP logging
open a new tab and type in "about:networking" into the url bar.
... type cmd and press enter, a new command prompt window with a black background will appear.
...you can type "%temp%" directly into the windows explorer location bar to get there quickly.
...you can type "%temp%" directly into the windows explorer location bar to get there quickly.
mach
running from the root of the source tree checkout, you should just be able to type: $ ./mach if all is well, you should see a help message.
...$ cd objdir-firefox $ mach build adding mach to your shell's search path if you add mach to your path (by modifying the path environment variable to include your source directory, or by copying mach to a directory in the default path like /usr/local/bin) then you can type mach anywhere in your source directory or your objdir.
... another possible reason: mach gives you an error, while running, say bootstrap.py directly (that is to type in a bash shell: python2 ./bootstrap.py enter-key ) in an otherwise empty ..../subdir/ may work for you!
...to see the list of the 4 available settings ( which are: alias , test , try , runprefs ) type : $ ./mach settings should i implement x as a mach command?
mozbrowsermetachange
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.
... type a domstring representing the type of meta change that this event object represents.
... example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsermetachange", function(event) { console.log("a meta tag has been " + event.details.type + ".
ChromeWorker
summary if you're developing privileged code, and would like to create a worker that can use js-ctypes to perform calls to native code, you can do so by using chromeworker instead of the standard worker object.
... it works exactly like a standard worker, except that it has access to js-ctypes via a global ctypes object available in the global scope of the worker.
... examples of chromeworker's using js-ctypes are availabe on github and are linked to from the see also section below.
... see also using web workers using workers in javascript code modules worker sharedworker web workers specification workerglobalscope github :: chromeworker - a fully working demo addon using js-ctypes from a chrome worker.
How to add a build-time test
for example, to add an xpcshell test to a module, do the following: copy tools/test-harness/xpcshell-simple/example to yourmoduledir/tests_type, wheretests_type is something that describes your tests.
... in <tt>yourmoduledir/tests_type/makefile.in</tt> change depth, module, and xpcshell_tests appropriately: depth should be a relative path pointing to <tt>mozilla/</tt>, e.g.
...you can of course just use the onetests_type directory here, but if you want to subdivide your tests by functionality, separate directories is the way to go.
... reference the test dir in a parent makefile (<tt>yourmoduledir/makefile.in</tt>): ifdef enable_tests dirs += tests_type endif (optional, but recommended) add the new makefile to allmakefiles.sh (todo: need more details about this) reconfigure (e.g.
How to Report a Hung Firefox
type "about:crashes" in the url bar and click on the top listing.
...type "about:crashes" in the url bar and click on the top listing.
...type "about:crashes" in the url bar and click on the top listing.
... getservice(ci.nsiwindowmediator); let win = wm.getmostrecentwindow("navigator:browser"); let browser = win.gbrowser.selectedbrowser; if (browser.isremotebrowser) { browser.messagemanager.loadframescript('data:,let appinfo = components.classes["@mozilla.org/xre/app-info;1"];if (appinfo && appinfo.getservice(components.interfaces.nsixulruntime).processtype != components.interfaces.nsixulruntime.process_type_default) {components.utils.import("resource://gre/modules/ctypes.jsm");var zero = new ctypes.intptr_t(8);var badptr = ctypes.cast(zero, ctypes.pointertype(ctypes.int32_t));var crash = badptr.contents;}', true); } other techniques on os x if you use a nightly build (>= firefox 16), you can use activity monitor's "sample process" feature to gene...
Implementing QueryInterface
if ( !ainstanceptr ) return ns_error_null_pointer; nsisupports* foundinterface; if ( aiid.equals(nscomtypeinfo<nsix>::getiid()) ) foundinterface = ns_static_cast(nsix*, this); else if ( aiid.equals(nscomtypeinfo<nsiy>::getiid()) ) foundinterface = ns_static_cast(nsiy*, this); // ...as many cases as needed...
... else if ( aiid.equals(nscomtypeinfo<nsisupports>::getiid()) ) foundinterface = ns_static_cast(nsisupports*, ns_static_cast(nsix*, this)); // i (may) have multiple |nsisupports| in me, // so first i cast to a specific base to avoid ambiguity else foundinterface = 0; nsresult status; if ( !foundinterface ) status = ns_nointerface; else { ns_addref(foundinterface); status = ns_ok; } *ainstanceptr = foundinterface; return status; } what's so good about it?
... it addrefs the resulting interface, not this, thus following the com-correct way (particularly important in aggregation) it uses nscomtypeinfo<t>::getiid() instead of ktiid thus saving a global declaration and global space it uses c 's static_cast, via ns_static_cast, which detects errors when you can't really get to the desired interface.
... */ { ns_assertion(ainstanceptr, "queryinterface requires a non-null destination!"); if ( !ainstanceptr ) return ns_error_null_pointer; nsisupports* foundinterface; if ( aiid.equals(nscomtypeinfo<nsix>::getiid()) ) foundinterface = ns_static_cast(nsix*, this); else if ( aiid.equals(nscomtypeinfo<nsiy>::getiid()) ) foundinterface = ns_static_cast(nsiy*, this); // note: don't check for |nsisupports|; |nsbaseimplementation| will do that for me.
Introduction to Layout in Mozilla
ncy [0..1] per frame, owned by frame widget native window [0..1] per view, owned by view key data structures the document owns the content model, and one or more presentations exposed programmatically via dom apis the presentation owns the frame hierarchy frames own the style contexts, views, widgets presentation has media type, dimensions, etc.
... may not be directly manipulated detailed walk-through setting up content model construction frame construction style resolution reflow painting setting up assume basic knowledge of embedding and network apis (doc shell, streams) content dll auto-registers a document loader factory (dlf) @mozilla.org/content-viewer-factory/view;1?type=text/html all mime types mapped to the same class, nscontentdlf nsdocshell receives inbound content via nsdsuricontentlistener invokes nsidlf::createinstance, passes mime type to dlf nscontentdlf creates a nshtmldocument object, invokes startdocumentload.
...notifications passes these to the style set object, who in turn passes to the frame constructor frame constructor creates frames constructframeinternal recursively walks content tree, resolves style and creates frames either created by tag (<select>) or by display type (<p>) frame manager maintains mapping from content to frame style resolution compute stylistic information based on the style rules that apply for the frame’s content node style data broken into different structures display, visibility, font, color, background, … inherit vs.
... nshtmlreflowcommand object encapsulates info queued and processed asynchronously, nsipressshell::appendreflowcommand, processreflowcommands incremental reflow recursively descend to target recovering reflow state child rs.reason set to incremental incremental reflow process reflow “normally” at target frame child rs.reason set based on rc’s type incremental reflow propagate damage to frames later “in the flow” incremental reflow multiple reflow commands are batched nsreflowpath maintains a tree of target frames amortize state recovery and damage propagation cost painting as reflow proceeds through the frame hierarchy, areas are invalidated via nsiviewmanager::updateview unless immediate, inv...
API-provided widgets
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.
... this is useful especially for 'view' type widgets that need to construct their views on the fly (e.g.
...this is useful especially for 'view' type widgets that need to cleanup after views that were constructed on the fly.
Log.jsm
class overview appender(); length: 1 keys of prototype: append(); doappend(); level: 0 basicformatter(); length: 1 keys of prototype: format(); boundedfileappender(); length: 2 keys of prototype: doappend(); reset(); ...
... consoleappender(); length: 1 keys of prototype: doappend(); dumpappender(); length: 1 keys of prototype: doappend(); fileappender(); length: 2 keys of prototype: doappend(); reset(); formatter(); length: 0 keys of prototype: format(); logmessage(); length: 4 keys of prototype: leveldesc logger(); length: 2 keys of prototype: addappender(); level logstructured(); ...
...name parent removeappender(); updateappenders(); and the methods mentioned below: logger methods loggerrepository(); length: 0 keys of prototype: getlogger(); rootlogger storagestreamappender(); length: 1 keys of prototype: doappend(); getinputstream(); newoutputstream(); outputstream reset(); structuredformatter(); length: 0 keys of prototype: format(); method overview enumerateinterfaces(); length: 0...
... enumerateproperties(); length: 2 member fields variable type description level object contains the following fields: field name value all 0 config 30 debug 20 desc { 0: "all", 10: "trace", 20: "debug", 30: "config", 40: "info", 50: "warn", 60: "error", 70: "fatal" } error 30 fatal 70 info 40 numbers { "all": 0, "trace": 10, "debug": 20, "config": 30, "info": 40, "warn": 50, "error": 60, "fatal": 70 } trace 10 warn 50 ...
XPCOMUtils.jsm
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).
...egetter(aobject, aname, acontract, ainterfacename); function generatensgetfactory(componentsarray); function generateci(classinfo); function generateqi(interfaces); void importrelative(that, path, scope); generator itersimpleenumerator(enumerator, interface); generator iterstringenumerator(enumerator); attributes attribute type description categorymanager nsicategorymanager returns a reference to nsicategorymanager.
...for example, if your component implements nsistreamconverter: mycomponent.prototype = { queryinterface: xpcomutils.generateqi([ components.interfaces.nsirequestobserver, components.interfaces.nsistreamlistener, components.interfaces.nsistreamconverter, ]), // ...methods...
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.
... to start, make sure you are in /path/to/your/working/directory/l10n-mozilla-1.9.2/x-testing and then, type the command mkdir /browser/chrome/browser now, step back out to the broader directory that contains both your l10n base (l10n-mozilla-1.9.2) and the en-us source code (mozilla-1.9.2).
... type the command pwd again, make sure you are in /path/to/your/working/directory/l10n-mozilla-1.9.2/x-testing and then type the command mkdir /browser/chrome/browser now, copy the file by typing cp mozilla-1.9.2/browser/locales/chrome/browser/aboutcerterror.dtd l10n-mozilla-1.9.2/x-testing/browser/chrome/browser/aboutcerterror.dtd you should now see the aboutcerterror.dtd file in that newly created ...
... (read more about tools at l10n:tools.) after you have downloaded your editor of choice, type the following command in the same path from above (l10n-mozilla-1.9.2/x-testing/browser/chrome/browser) $ edit l10n-mozilla-1.9.2/x-testing/browser/chrome/browser/aboutcerterror.dtd read the top of the file to get any context on how to translate contained in the notes written by the developers or l10n-drivers.
Mozilla Framework Based on Templates (MFBT)
functionality types and type manipulation standardinteger.h implements the <stdint.h> interface.
...this header also provides a useful "hook" for embeddings that must customize the types underlying the fixed-size integer types.) types.h includes standardinteger.h and further provides size_t.
... core types.h further provides macros to define imported and exported c symbols.
...(an unnamed temporary lives for a shorter period of time than the scope where it's found, so it usually isn't what was desired.) data structures linkedlist.h implements a type-safe doubly-linked list class.
Extras
</mrow> </math> </p> css content math.cue *[title] { color: blue; } mixing with other markups html content <math display="block"> <mrow> <mi>a</mi> <mo>=</mo> <mo>[</mo> <mtable> <mtr> <mtd><mn>1</mn></mtd> <mtd> <mtext> <img width="16" height="16" src="https://udn.realityripple.com/samples/3f/9341cbddc0.png" alt="mozilla-16" /> </mtext> </mtd> </mtr> <mtr> <mtd> <mtext><input value="type" size="4"/></mtext> </mtd> <mtd><mn>4</mn></mtd> </mtr> </mtable> <mo>]</mo> </mrow> </math> <math display="block"> <msqrt> <mpadded width="30px" height="15px" depth="15px" voffset="-15px"> <mtext> <svg width="30px" height="30px"> <defs> <radialgradient id="radgrad1" cx="50%" cy="50%" r="50%" fx="50%" fy="50%"> <stop offset="0%" style="stop-color:r...
...gb(255,255,255); stop-opacity:1;"/> <stop offset="100%" style="stop-color:rgb(255,0,0); stop-opacity:.8;"/> </radialgradient> </defs> <g transform="translate(15,15)"> <g> <animatetransform attributename="transform" attributetype="xml" type="rotate" from="360" to="0" dur="15s" repeatcount="indefinite"/> <g transform="translate(-15, -15)"> <path fill="url(#radgrad1)" d="m 15 0 l 20 10 l 30 15 l 20 20 l 15 30 l 10 20 l 0 15 l 10 10"/> </g> </g> </g> </svg> </mtext> </mpadded> </msqrt> <mo>=</mo> <msubsup> <mo>∫</mo> <mn>0</mn> <mfrac> <mi>π</mi> <mn>2</mn> </mfrac> </msubsup> <msup> <mi>θ</mi> <mtext> <svg width="15px" height="15px"...
...nt id="grad3" cx="50%" cy="50%" r="50%" fx="50%" fy="50%"> <stop offset="0%" style="stop-color:rgb(0,255,255);stop-opacity:1"/> <stop offset="100%" style="stop-color:rgb(255,255,255);stop-opacity:.8"/> </radialgradient> </defs> <rect width="300" height="250" fill="url(#grad1)"/> <g transform="translate(150,125)"> <g> <animatetransform attributename="transform" attributetype="xml" type="rotate" from="0" to="360" dur="6s" repeatcount="indefinite"/> <g transform="translate(-50,-35)"> <rect width="100" height="70" fill="url(#grad2)"/> <switch> <foreignobject width="100" height="70" requiredextensions="http://www.w3.org/1998/math/mathml"> <math display="block"> <mrow> <mo>(</mo> <mtable> <mtr> <mtd><mi>cos</mi><mi>θ<...
...mi>θ</mi></mtd> </mtr> </mtable> <mo>)</mo> </mrow> </math> </foreignobject> <text>rotation matrix</text> </switch> </g></g></g> <g> <animatemotion path="m 32,69 c 64,121 100,27 152,42 203,56 239,257 275,161 295,109 144,221 88,214 -2,202 11,35 32,69 z" begin="0s" dur="20s" repeatcount="indefinite"/> <animatetransform attributename="transform" attributetype="xml" type="scale" values="1;2;.5;1" keytimes="0;.25;.75;1" dur="20s" repeatcount="indefinite"/> <circle fill="url(#grad3)" r="30"/> <g transform="translate(-30,-30)"> <switch> <foreignobject width="60" height="60" requiredextensions="http://www.w3.org/1998/math/mathml"> <math display="block"> <mrow> <munderover> <mo>∑</mo> <mrow> <mi>n</mi> <mo>=</mo> <mn>0</mn> </mrow>...
Mozilla Style System Documentation
these three types of style contexts correspond to the three ways of creating a style context: nsiprescontext::resolvestylecontextfor, nsiprescontext::resolvepseudostylecontextfor, and.nsiprescontext::resolvestylecontextfornonelement there is also a fourth method, nsiprescontext::probepseudostylecontextfor, which creates a style context only if there are style rules that match the pseudo-element.
...ast(const nsstyledisplay*, sc->getstyledata(estylestruct_display)); there is also a (non-virtual) method on nsiframe to get the style data from a frame's style context (saving the refcounting needed to get the style context): const nsstyledisplay *display; frame->getstyledata(estylestruct_display, (const nsstylestruct*&)display); however, there are similar typesafe global function templates that (should) compile to the same thing but use the type of the template parameter to pass the correct nsstylestructid parameter.
... the style context tree will look like this, ignoring all the style contexts for the text nodes (all of which have style contexts pointing to rule node a), with each style context in the format [element type: rule node]: [doc: b] ,------------' | `-----------.
...this leads to (or perhaps three, depending on how you count) two types of sharing.
Profiling with the Firefox Profiler
one of the easiest ways to find slowness caused by a page's js is to type its url into the "filter stacks" box.
... profiling js benchmark (xpcshell) to profile the script run.js with ionmonkey (-i), type inference (-n) and jäegermonkey (-m).
... type in2, : p (void)profiler_save_profile_to_file("somepath/profile.txt") clone mstange’s handy profile analysis repository.
...it contains, for each layer, the type of the layer, and various metrics about the layer, such as the visible region and any transforms.
Condition Variables
condition variable type condition variable functions conditions are closely associated with a single monitor, which typically consists of a mutex, one or more condition variables, and the monitored data.
... nspr provides a special type, prmonitor, for use with java.
... unlike a mutex of type prlock, which can have multiple associated condition variables of type prcondvar, a mutex of type prmonitor has a single, implicitly associated condition variable.
... condition variable type prcondvar condition variable functions pr_newcondvar pr_destroycondvar pr_waitcondvar pr_notifycondvar pr_notifyallcondvar ...
I/O Functions
for information about the types most commonly used with the functions described in this chapter, see i/o types.
... pr_open pr_delete pr_getfileinfo pr_getfileinfo64 pr_rename pr_access type praccesshow functions that act on file descriptors pr_close pr_read pr_write pr_writev pr_getopenfileinfo pr_getopenfileinfo64 pr_seek pr_seek64 pr_available pr_available64 pr_sync pr_getdesctype pr_getspecialfd pr_createpipe directory i/o functions pr_opendir pr_readdir pr_closedir pr_mkdir pr_rmdir socket manipulation functions the network programming interf...
... each type of layer has a unique identity, which is allocated by the runtime.
... the layer implementor should associate the identity with all layers of that type.
Locks
this chapter describes the nspr api for creation and manipulation of a mutex of type prlock.
... lock type lock functions in nspr, a mutex of type prlock controls locking, and associated condition variables communicate changes in state among threads.
...in addition to prlock, nspr provides another mutex type, prmonitor, which is reentrant and can have only one associated condition variable.
... lock type prlock lock functions pr_newlock creates a new lock object.
NSPR Error Handling
error type error functions error codes for information on naming conventions for nspr types, functions, and macros, see nspr naming conventions.
... error type prerrorcode error functions pr_seterror pr_seterrortext pr_geterror pr_getoserror pr_geterrortextlength pr_geterrortext error codes error codes defined in prerror.h: pr_out_of_memory_error insufficient memory to perform request.
... pr_invalid_method_error the preceding function is invalid for the type of file descriptor used.
... pr_address_not_supported_error the type of network address specified is not supported.
PRHostEnt
syntax #include <prnetdb.h> typedef struct prhostent { char *h_name; char **h_aliases; #if defined(_win32) print16 h_addrtype; print16 h_length; #else print32 h_addrtype; print32 h_length; #endif char **h_addr_list; } prhostent; fields the structure has the following fields: h_name pointer to the official name of host.
... h_addrtype host address type.
...all of the addresses in the list are of the same type and therefore of the same length.
... note winsock.h defines h_addrtype and h_length as a 16-bit field, whereas other platforms treat it as a 32-bit field.
PRSockOption
enumeration type used in the option field of prsocketoptiondata to form the name portion of a name-value pair.
... syntax #include <prio.h> typedef enum prsockoption { pr_sockopt_nonblocking, pr_sockopt_linger, pr_sockopt_reuseaddr, pr_sockopt_keepalive, pr_sockopt_recvbuffersize, pr_sockopt_sendbuffersize, pr_sockopt_iptimetolive, pr_sockopt_iptypeofservice, pr_sockopt_addmember, pr_sockopt_dropmember, pr_sockopt_mcastinterface, pr_sockopt_mcasttimetolive, pr_sockopt_mcastloopback, pr_sockopt_nodelay, pr_sockopt_maxsegment, pr_sockopt_last } prsockoption; enumerators the enumeration has the following enumerators: pr_sockopt_nonblocking nonblocking i/o.
... pr_sockopt_iptypeofservice ip type-of-service and precedence.
...the option field of prsocketoptiondata should be set to an enumerator of type prsockoption.
PRSocketOptionData
type for structure used with pr_getsocketoption and pr_setsocketoption to specify options for file descriptors that represent sockets.
... syntax #include <prio.h> typedef struct prsocketoptiondata { prsockoption option; union { pruintn ip_ttl; pruintn mcast_ttl; pruintn tos; prbool non_blocking; prbool reuse_addr; prbool keep_alive; prbool mcast_loopback; prbool no_delay; prsize max_segment; prsize recv_buffer_size; prsize send_buffer_size; prlinger linger; prmcastrequest add_member; prmcastrequest drop_member; prnetaddr mcast_if; } value; } prsocketoptiondata; fields the structure has the following fields: ip_ttl ip time-to-live.
... tos ip type-of-service and precedence.
...the option field (of enumeration type prsockoption) specifies the name of the socket option, and the value field (a union of all possible values) specifies the value of the option.
PR_NEWZAP
allocates and clears memory from the heap for an instance of a given type.
... syntax #include <prmem.h> _type * pr_newzap(_struct); parameter _struct the name of a type.
... returns an pointer to a buffer sized to contain the type _struct, or if the allocation attempt fails, null.
... description this macro allocates an instance of the specified type from the heap and sets the content of that memory to zero.
Cryptography functions
the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references.
...slotfromprivatekey mxr 3.2 and later pk11_getslotid mxr 3.2 and later pk11_getslotinfo mxr 3.4 and later pk11_getslotname mxr 3.2 and later pk11_getslotseries mxr 3.2 and later pk11_getsymkeynickname mxr 3.4 and later pk11_getsymkeytype mxr 3.9 and later pk11_getsymkeyuserdata mxr 3.11 and later pk11_gettokeninfo mxr 3.2 and later pk11_gettokenname mxr 3.2 and later pk11_getwindow mxr 3.2 and later pk11_getwrapkey mxr 3.2 and later pk11_hashbuf mxr 3.2...
...mxr 3.4 and later pk11_listpublickeysinslot mxr 3.4 and later pk11_loadprivkey mxr 3.4 and later pk11_logoutall mxr 3.4 and later pk11_makekeapubkey mxr 3.2 and later pk11_mappbemechanismtocryptomechanism mxr 3.2 and later pk11_mapsignkeytype mxr 3.11 and later pk11_mechanismtoalgtag mxr 3.4 and later pk11_mergetokens mxr 3.12 and later pk11_movesymkey mxr 3.9 and later pk11_needlogin mxr 3.2 and later pk11_needuserinit mxr 3.2 and later pk11_paramfromiv mxr ...
... seckey_destroyprivatekey mxr 3.2 and later seckey_ecparamstobasepointorderlen mxr 3.12 and later seckey_ecparamstokeysize mxr 3.12 and later seckey_destroypublickeylist mxr 3.4 and later seckey_destroysubjectpublickeyinfo mxr 3.2 and later seckey_getpublickeytype mxr 3.3 and later seckey_publickeystrengthinbits mxr 3.8 and later seckey_signaturelen mxr 3.11.2 and later ...
NSS Developer Tutorial
the exact-width integer types in nspr should be used, in preference to those declared in <stdint.h> (which will be used by nspr in the future).
... universal character names are not permitted, as are wide character types (char16_t and char32_t).
... the function prototype of an exported function, cannot be changed, with these exceptions: a foo * parameter can be changed to const foo *.
... types structs members of an exported struct, cannot be reordered or removed.
nss tech note4
item *ext_critical = &(*extensions)->critical; secitem *ext_value = &(*extensions)->value; /* id attribute of the extension */ secoiddata *oiddata = secoid_findoid(ext_oid); if (oiddata == null) { /* oid not found */ /* secitem ext_oid has type (secitemtype), data (unsigned char *) and len (unsigned int) fields - the application interprets these */ .......
... if (ext_critical->len > 0) { if (ext_critical->data[0]) /* the extension is critical */ else /* the extension is not critical */ } /* value attribute of the extension */ /* secitem ext_value has type (secitemtype), data (unsigned char *) and len (unsigned int) fields - the application interprets these */ secoidtag oidtag = secoid_findoidtag(ext_oid); switch (oidtag) { case a_tag_that_app_recognizes: .....
... } extensions++; } } an example custom cert extension struct _mycertextdata { secitem version; secitem streetaddress; secitem phonenum; secitem rfc822name; secitem id; secitem maxusers; }; typedef struct _mycertextdata mycertextdata; /* template used for decoding the extension */ const sec_asn1template mycertexttemplate[] = { { sec_asn1_sequence, 0, null, sizeof( mycertextdata ) }, { sec_asn1_integer, offsetof(mycertextdata, version) }, { sec_asn1_octet_string, offsetof( mycertextdata, streetaddress ) }, { ...
... }; static const secitem myoiditem = { (secitemtype) 0, (unsigned char *)myoid, sizeof(myoid) }; secitem myextvalue; mycertextdata data; secstatus rv = cert_findcertextensionbyoid(cert, &myoiditem, &myextvalue); if (rv == secsuccess) { sec_asn1decodercontext * context = sec_asn1decoderstart(null, &data, mycertexttemplate); rv = sec_asn1decoderupdate( context, (const char...
NSS cryptographic module
this chapter describes the data types and functions that one can use to perform cryptographic operations with the nss cryptographic module.
...both modes of operation use the same data types but are implemented by different functions.
...the following sections document the data types and functions.
... pkcs #11 data types pkcs #11 functions in the non-fips (default) mode of operation pkcs #11 functions in the fips mode of operation nsc_moduledbfunc ...
Proxies in Necko
this means that callers can just create an nsichannel, not needing to worry about whether the channel will use a proxy or not the basic interfaces for proxies are: nsiproxyinfo, nsiprotocolproxyservice, and nsiproxiedprotocolhandler nsiproxyinfo is a simple helper which stores information about the type of the proxy, its host and its port.
...depending on the type of the proxy info, it either asks the http protocol handler or the protocol handler for the requested uri for a new channel with the nsiproxyinfo - if the channel supports nsiproxiedprotocolhandler.
...finally, depending on the protocol, the proxy info will be created with the appropriate type, host and port.
...note that socks is implemented as an nsisocketprovider, and the socket transport service will therefore use it as as the downmost socket type.
Invariants
when a new object is created, it is automatically created in cx->compartment, but its parent and prototype are often determined by examining the scope chain.
... however, there is another internal api, js::switchtocompartment, that lets you break this invariant, and of course in xpconnect we use that from time to time when we know we aren't going to be creating any new objects (other than global objects, which have no parent or prototype) or doing anything that might call back into native code that could create objects.
...that is, they take a parameter cx of type jscontext *, and require that cx is in a request on the current thread.
... "are we in a request on cx?", where cx is any variable of type jscontext *, is a static yes for most lines of code where such a variable exists.
JSNative
jsnative is the type of many jsapi callbacks.
... syntax typedef bool (* jsnative)(jscontext *cx, unsigned argc, js::value *vp); name type description cx jscontext * the context in which the native function is being called.
... description jsnative is the type of native implementations of javascript functions.
... full documentation of how to define a jsnative (or a jsfastnative, the equivalent typedef which preceded it) is available in the api header "js/callargs.h" added in spidermonkey 24.
JSVAL_TO_STRING
cast a jsval to type jsstring * without a type check.
... syntax jsstring * jsval_to_string(jsval v); description jsval_to_string casts the argument, v, to type jsstring *.
...this function is not type-safe: if v is not a string, the behavior is undefined.
...(the difference is that the latter will convert an object, array, number, or other value to a string in a type-safe way, creating a new string if needed.) to convert the return type of this macro (jsstring *) to a char pointer, use js_getstringbytes.
JS_AddExternalStringFinalizer
syntax int js_addexternalstringfinalizer(jsstringfinalizeop finalizer); name type description finalizer jsstringfinalizeop pointer to a callback function, described below.
... callback syntax typedef void (*jsstringfinalizeop)(jscontext *cx, jsstring *str); name type description cx jscontext * pointer to a jscontext which the finalizer may use for certain very limited operations (not documented).
... description add a finalizer for external strings created by js_newexternalstring using a type-code returned from this function, and that understands how to free or release the memory pointed at by js_getstringchars(str).
... returns a nonnegative type index if there is room for finalizer in the global gc finalizers table, else returns -1.
JS_ConvertArgumentsVA
converts a series of js values, passed in a va_list, to their corresponding jsapi types.
... syntax bool js_convertargumentsva(jscontext *cx, const js::callargs &args, const char *format, va_list ap); bool js_convertargumentsva(jscontext *cx, unsigned argc, jsval *argv, const char *format, va_list ap); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... ap va_list the list of pointers into which to store the converted types.
...the type va_list is a standard feature of the c programming language.
JS_DefaultValue
syntax bool js_defaultvalue(jscontext *cx, js::handle<jsobject*> obj, jstype hint, js::mutablehandle<js::value> vp); name type description cx jscontext * the context in which to perform the conversion.
... hint jstype the hint to pass to the [[defaultvalue]] hook when converting the object.
... hint must be jstype_string or jstype_number to pass the corresponding type as a hint, or jstype_void to pass no hint.
... do not pass any other type.
JS_DoubleToInt32
this article covers features introduced in spidermonkey 17 convert a c floating-point number of type double to 32-bit integer per ecma spec.
... syntax int32_t js_doubletoint32(double d); uint32_t js_doubletouint32(double d); name type description d double the numeric value to convert.
... description js_doubletoint32 converts a c floating-point number of type double to int32, a signed 32-bit integer.
... js_doubletouint32 converts a c floating-point number of type double to uint32, an unsigned 32-bit integer.
JS_DumpHeap
syntax bool js_dumpheap(jsruntime *rt, file *fp, void* startthing, jsgctracekind kind, void *thingtofind, size_t maxdepth, void *thingtoignore); name type description cx jscontext * pointer to a js context.
... enum jsgctracekind { // these trace kinds have a publicly exposed, although opaque, c++ type.
... jstrace_base_shape = 0x0f, jstrace_jitcode = 0x1f, jstrace_lazy_script = 0x2f, jstrace_type_object = 0x3f, jstrace_last = jstrace_type_object }; description see bug 378261 for detail.
...not all of the matching c++ types are exposed, and those that are, are opaque.
JS_GetClassObject
syntax bool js_getclassobject(jscontext *cx, jsprotokey key, js::mutablehandle<jsobject*> objp); name type description cx jscontext * a context.
... key jsprotokey the key of the prototype.
... description js_getclassobject gets the builtin class costructor for the specified prototype key.
... see also mxr id search for js_getclassobject js_getclassprototype jsprotokey ...
JS_LookupProperty
l js_lookuppropertywithflags(jscontext *cx, js::handleobject obj, const char *name, unsigned flags, js::mutablehandlevalue vp); bool js_lookuppropertywithflagsbyid(jscontext *cx, js::handleobject obj, js::handleid id, unsigned flags, js::mutablehandleobject objp, js::mutablehandlevalue vp); // added in spidermonkey 1.8.1 name type description cx jscontext * pointer to a js context from which to derive runtime information.
...this will be either obj or an element on obj's prototype chain.
...these functions all have similar behavior: the search starts with obj and proceeds along the prototype chain.
... if neither obj nor any of its prototypes have such a property, *vp receives undefined and the return value is true (to indicate no error occurred).
JS_NewExternalString
syntax jsstring * js_newexternalstring(jscontext *cx, const char16_t *chars, size_t length, const jsstringfinalizer *fin); jsstring * js_newexternalstringwithclosure(jscontext *cx, jschar *chars, size_t length, int type, void *closure); // obsolete since jsapi 13 name type description cx jscontext * the context in which to create the new string.
...added in spidermonkey 17 type int (js_newexternalstringwithclosure only) indicates which string finalizer callback the javascript engine should use (later) to free the string buffer chars.
...since the program allocated the memory, it will need to free it; this happens in an external string finalizer indicated by the type parameter.
... see also mxr id search for js_newexternalstring js_getexternalstringclosure js_isexternalstring bug 724810 - replaced type with fin parameter, and remove js_newexternalstringwithclosure ...
JS_ValueToECMAInt32
convert a javascript value to an integer type as specified by the ecmascript standard.
... syntax jsbool js_valuetoecmaint32(jscontext *cx, jsval v, int32 *ip); jsbool js_valuetoecmauint32(jscontext *cx, jsval v, uint32 *ip); jsbool js_valuetouint16(jscontext *cx, jsval v, uint16 *ip); name type description cx jscontext * the context in which to perform the conversion.
... description js_valuetoecmaint32, js_valuetoecmauint32, and js_valuetouint16 convert a javascript value to various integer types as specified in the ecmascript specification.
...if that succeeds, the result is then converted to the target integer type.
JS_ValueToFunction
syntax jsfunction * js_valuetofunction(jscontext *cx, js::handlevalue v); jsfunction * js_valuetoconstructor(jscontext *cx, js::handlevalue v); name type description cx jscontext * the context in which to perform the conversion.
...instead, use jsval_is_object and js_objectisfunction() to check whether a value is already a function, or use js_convertvalue() to convert a value to jstype_function safely.
... if v is null, undefined, a boolean, a number, or a string, a typeerror is reported and js_valuetofunction returns null.
... the object's jsobjectops.defaultvalue method is called with hint=jstype_function.) js_valuetofunction returns a pointer to the converted function.
JS_ValueToId
convert a js::value to type jsid.
...s, js::mutablehandleid idp); // added in spidermonkey 38 bool js_indextoid(jscontext *cx, uint32_t index, js::mutablehandleid idp); // added in spidermonkey 17 bool js_charstoid(jscontext* cx, js::twobytechars chars, js::mutablehandleid idp); // added in spidermonkey 24 void js::protokeytoid(jscontext *cx, jsprotokey key, js::mutablehandleid idp); // added in spidermonkey 38 name type description cx jscontext * a context.
... key jsprotokey the prototype key to convert.
... js::protokeytoid converts a specified prototype key to a jsid.
JS_ValueToNumber
convert any javascript value to a floating-point number of type jsdouble.
... syntax jsbool js_valuetonumber(jscontext *cx, jsval v, jsdouble *dp); name type description cx jscontext * the context in which to perform the conversion.
... otherwise conversion fails with a typeerror.
... see also js_convertarguments js_convertvalue js_gettypename js_typeofvalue js_valuetoint32 js_valuetoecmaint32 bug 884410 ...
JS_ValueToObject
syntax bool js_valuetoobject(jscontext *cx, js::handlevalue v, js::mutablehandleobject objp); name type description cx jscontext * the context in which to convert the value.
... if v is a boolean value, a number, or a string, the result is a new wrapper object of type boolean, number, or string.
...(implementation note: the object's jsobjectops.defaultvalue method is called with hint=jstype_object.) the resulting object is subject to garbage collection unless the variable *objp is protected by a local root scope, an object property, or the js_addroot function.
...see also mxr id search for js_valuetoobject js_convertarguments js_convertvalue js_typeofvalue js_valuetofunction ...
SpiderMonkey 38
this entailed changing the vast majority of the jsapi from raw types, such as js::value or js::value*, to js::handle and js::mutablehandle template types that encapsulate access to the provided value/string/object or its location.
...many jsapi types, functions, and callback signatures have changed, though most functions that have changed still have the same names and implement essentially unchanged functionality.
... js_evaluatescript (bug 1100579) js_evaluateucscript (bug 1100579) js_executescriptversion (bug 1095660) js_getflatstringchars (bug 1037869) js_getfunctioncallback (bug 1103269) js_getinternedstringchars (bug 1037869) js_getinternedstringcharsandlength (bug 1037869) js_getstringcharsandlength (bug 1037869) js_getstringcharsz (bug 1037869) js_getstringcharszandlength (bug 1037869) js_gettypename (bug 1037718) js_isabouttobefinalized (bug 650161) js_lookupelement (bug 1094176) js_lookupproperty (bug 1094176) js_lookuppropertybyid (bug 1094176) js_lookupucproperty (bug 1094176) js_newpropertyiterator (bug 1081660) js_nextproperty (bug 1081660) js_resolvestub (bug 1103152) js_setfinalizecallback (bug 996785) js_setfunctioncallback (bug 1103269) jschar (bug 1063962) api chan...
...ges jschar, a typedef for the standard c++ type char16_t, has been removed.
Redis Tips
some uses for redis data types you may have heard of redis referred to as a nosql database.
... redis data types include: strings hashes lists sets ordered sets (called zsets in redis) transactions publishers and subscribers this table lists some common programming tasks and data structures, and suggests some redis functions or data structures for them: dictionary lookup set, get, setnx, etc.
... you just have to be careful that you check the result type of an exec() when you're watching variables.
... creating keys: keys are like urls and should read like nice urls keys are like urls with paths separated by a colon, ':' (this is convention only) use a common prefix for all keys in your app (like a domain) be careful about possible name collisions key names should make it obvious what the values are for redis data structures are like program variables; how would you structure your data types in your program?
Security and the jar protocol
prior to this change, specifying the jar: protocol caused firefox to assume that the file being retrieved is a jar file, regardless of its mime type (in other words, its mime type was assumed to be application/zip, regardless of what it actually was).
... so starting with gecko 1.8.0.15 and 1.8.1.10, the jar: protocol is only allowed if the mime type of the file is application/java-archive.
... a site that serves a file with that type is essentially promising that it has vetted the content and that it is in fact safe to download and execute.
... any other file type results in an "unsafe file type" error.
The Places database
it contains the host url, frequency of access, if typed or not, and it's prefix (https://, ftp://, etc).
... moz_bookmarks_roots: lists special folders that are the root folders of certain content types in the bookmarks system.
... if the mime type of the image is image/png, the data blob must be reencoded from base16 (the format in which it is stored) to base64 in order to display correctly.
...there are several ways for orphans to be created, including calling markpageastyped and then never visiting the page.
Building the WebLock UI
the "shell" for the xul file, then, looks like this: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <dialog id="weblock_ui" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="web lock manager" persist="screenx screeny" screenx="24" screeny="24"> </dialog> note that this part of the xul file also contains a stylesheet declaration, which imports css rules and applies them to particular parts of the interface.
... weblock.xul <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <dialog id="weblock_mgg" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="web lock manager" style="width: 30em;" persist="screenx screeny" screenx="24" screeny="24"> <script src="chrome://weblock/content/weblock.js"/> <hbox> <separator orient="vertical" class="thin"/> <vbox flex="1"> <separator class="t...
...here is that xul file in its entirety: the weblock overlay <?xml version="1.0"?> <?xml-stylesheet href="chrome://navigator/content/weblock.css" type="text/css"?> <overlay id="weblockoverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://weblock/content/weblock.js"/> <statusbar id="status-bar"> <statusbarpanel class="statusbarpanel-iconic" id="weblock-status" insertbefore="offline-status" ...
...note that the weblock.xul file in which the manager is defined imports only the global skin: <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> save weblock.css in your working directory.
Using XPCOM Utilities to Make Things Easier
it also introduces a basic string type that is used with many of the apis in both xpcom and gecko.
... // returns a reference to a shared nsiid object\ static const nsiid iid1 = ns_get_iid(nsisupports); // constructs a new nsiid object static const nsiid iid2 = ns_isupports_iid; in order to use ns_impl_isupportsn, you must be sure that a member variable of type nsrefcnt is defined and named mrefcnt in your class.
...however, a change in xpcom that occurred before mozilla 1.3 makes ns_init_isupports no longer necessary: mrefcnt's type has been changed from an integer to a class that provides its own auto-initialization.
...the double byte version, nsembedstring, has the same functionality but the constructor takes nsastring and the .get() method returns the type prunichar*.
Components.utils.Sandbox
the principal may be one of four types: the system principal, a content principal, an expanded principal, or a null principal.
...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.
... sandboxprototype a prototype object for the sandbox.
... var sandboxscript = 'alert($)'; var options = { sandboxprototype: content, wantxrays: false // only set this to false if you need direct access to the page's javascript.
nsresult
« xpcom api reference the nsresult data type is a strongly-typed enum used to represent a value returned by an xpcom function; these are typically error or status codes.
... note: on compilers that do not support strongly-typed enums (that is, compilers that don't support this feature of c++11), it falls back to being an unsigned 32-bit integer, as in past versions of gecko.
... note: prior to gecko 19.0, nsresult was not strongly typed.
... because nsresult is strongly typed, code like the following will result in an error at compile time: bool foo() { ...
nsEmbedCString
nsembedcstring(); explicit nsembedcstring( const self_type& astring ); parameters astring [in] a nsembedcstring to copy into this string.
... nsembedcstring( const abstract_string_type& aabstractstring ); parameters aabstractstring [in] a nsacstring to copy into this string.
... explicit nsembedcstring( const abstract_string_type& aabstractstring ); parameters aabstractstring [in] a nsacstring to copy into this string.
... explicit nsembedcstring( const char_type* adata, size_type adatalength = pr_uint32_max ); parameters adata [in] a raw character array to copy into this string.
operator=
self_type& operator=( const self_type& astring ); parameters astring [in] a nsembedcstring to append to this string.
... self_type& operator=( const abstract_string_type& astring ); parameters astring [in] a nsacstring to append to this string.
... self_type& operator=( const char_type* adata ); parameters adata [in] a raw character array to append to this string.
... self_type& operator=( char_type achar ); parameters achar [in] a character to append to this string.
nsEmbedString
nsembedstring(); explicit nsembedstring( const self_type& astring ); parameters astring [in] a nsembedstring to copy into this string.
... nsembedstring( const abstract_string_type& aabstractstring ); parameters aabstractstring [in] a nsastring to copy into this string.
... explicit nsembedstring( const abstract_string_type& aabstractstring ); parameters aabstractstring [in] a nsastring to copy into this string.
... explicit nsembedstring( const char_type* adata, size_type adatalength = pr_uint32_max ); parameters adata [in] a raw character array to copy into this string.
operator=
self_type& operator=( const self_type& astring ); parameters astring [in] a nsembedstring to append to this string.
... self_type& operator=( const abstract_string_type& astring ); parameters astring [in] a nsastring to append to this string.
... self_type& operator=( const char_type* adata ); parameters adata [in] a raw character array to append to this string.
... self_type& operator=( char_type achar ); parameters achar [in] a character to append to this string.
IAccessibleRelation
1.0 66 introduced gecko 1.9 inherits from: iunknown last changed in gecko 1.9 (firefox 3) method overview [propget] hresult localizedrelationtype([out] bstr localizedrelationtype ); [propget] hresult ntargets([out] long ntargets ); [propget] hresult relationtype([out] bstr relationtype ); [propget] hresult target([in] long targetindex, [out] iunknown target ); [propget] hresult targets([in] long maxtargets, [out, size_is(maxtargets), length_is( ntargets)] iunknown targets, [out] long ntargets ); methods localizedrelationtype() returns a localized version of the relation type.
... [propget] hresult localizedrelationtype( [out] bstr localizedrelationtype ); parameters localizedrelationtype return value s_ok.
...relationtype() returns the type of the relation.
... [propget] hresult relationtype( [out] bstr relationtype ); parameters relationtype the strings returned are defined @ref grprelations "in this section of the documentation".
mozIThirdPartyUtil
obtain the bottommost nsidomwindow, and its same-type parent if it exists, from the channel's notification callbacks.
... return value true if auri is third party with respect to the channel uri or any of the uris associated with the same-type window hierarchy of the channel.
...find the same-type parent window, if there is one, and its uri.
... return value true if auri is third party with respect to any of the uris associated with awindow and its same-type parents.
nsIAccessNode
method overview nsiaccessnode getchildnodeat(in long childnum); obsolete since gecko 2.0 nsidomcssprimitivevalue getcomputedstylecssvalue(in domstring pseudoelt, in domstring propertyname); domstring getcomputedstylevalue(in domstring pseudoelt, in domstring propertyname); void scrollto(in unsigned long ascrolltype); void scrolltopoint(in unsigned long acoordinatetype, in long ax, in long ay); attributes note: attempting to access the attributes of a node that is unattached from the accessible tree will result in an exception - ns_error_failure.
... attribute type description document nsiaccessibledocument the document accessible that this access node resides in.
... void scrollto( in unsigned long ascrolltype ); parameters ascrolltype defines where the object should be placed on the screen (see nsiaccessiblescrolltype.constants for available constants).
... void scrolltopoint( in unsigned long acoordinatetype, in long ax, in long ay ); parameters acoordinatetype specifies whether the coordinates are relative to the screen or the parent object (for available constants refer to nsiaccessiblecoordinatetype.constants.
GetAccessibleRelated
« nsiaccessible page summary this method returns an accessible related to this one by the given relation type.
... nsiaccessible getaccessiblerelated( in unsigned long arelationtype ); parameters arelationtype[in] the relation type between the accessible (see constants listed in relations documentation).
... return value returns an accessible which is related to the one provided by the given relation type.
... exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree.ns_error_not_implemented indicates that the given relation type is unsupported see also nsiaccessible.getrelations() nsiaccessible.relationscount nsiaccessible.getrelation() ...
nsIAccessibleEvent
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) attributes attribute type description accessible nsiaccessible the nsiaccessible associated with the event.
... eventtype unsigned long the type of event, based on the enumerated event values defined in this interface.
... event_dom_significant_change 0x0003 an object's properties or content have changed significantly so that the type of object has really changed, and therefore the accessible should be destroyed or recreated.
... event_asynch_significant_change 0x0006 an object had a significant layout change which could affect the type of accessible object -- this is a layout occurrence and is thus asynchronous.
nsIApplicationCacheNamespace
method overview void init(in unsigned long itemtype, in acstring namespacespec, in acstring data); attributes attribute type description data acstring data associated with the namespace, such as a fallback.
... how this attribute is used varies depending on the namespace type.
... itemtype unsigned long a bit field indicating one or more namespace types.
... void init( in unsigned long itemtype, in acstring namespacespec, in acstring data ); parameters itemtype the namespace type.
nsIComponentManager
aiid the interface type to be returned.
... aiid the interface type to be returned.
... aiid the interface type to be returned.
... aiid the interface type to be returned.
nsICryptoHMAC
this method may be called multiple times with different algorithm types.
...void init( in unsigned long aalgorithm, in nsikeyobject akeyobject ); parameters aalgorithm the algorithm type to be used.
... this value must be one of the above valid algorithm types.
...to create the key object use for instance: var keyobject = components.classes["@mozilla.org/security/keyobjectfactory;1"] .getservice(components.interfaces.nsikeyobjectfactory) .keyfromstring(components.interfaces.nsikeyobject.hmac, rawkeydata); exceptions thrown ns_error_invalid_arg if an unsupported algorithm type is passed.
nsIDOMNSHTMLDocument
efox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void captureevents(in long eventflags); void clear(); boolean execcommand(in domstring commandid, in boolean doshowui, in domstring value); boolean execcommandshowhelp(in domstring commandid); obsolete since gecko 14.0 domstring getselection(); nsidomdocument open(in acstring acontenttype, in boolean areplace); boolean querycommandenabled(in domstring commandid); boolean querycommandindeterm(in domstring commandid); boolean querycommandstate(in domstring commandid); boolean querycommandsupported(in domstring commandid); domstring querycommandtext(in domstring commandid); obsolete since gecko 14.0 domstring querycommandvalue(in ...
...domstring commandid); void releaseevents(in long eventflags); void routeevent(in nsidomevent evt); void write(); obsolete since gecko 2.0 void writeln(); obsolete since gecko 2.0 attributes attribute type description alinkcolor domstring same as body.alink bgcolor domstring same as body.bgcolor compatmode domstring returns "backcompat" if the document is in quirks mode or "css1compat" if the document is in full standards or almost standards mode.
...open() nsidomdocument open( in acstring acontenttype, in boolean areplace ); parameters acontenttype the content type of the new document.
... if the type is not supported by the html content sink, trying to write to the document will probably throw.
nsIDOMNode
dom/interfaces/core/nsidomnode.idlscriptable this interface is the primary datatype for the entire document object model.
...omnode clonenode(in boolean deep); boolean hasattributes(); boolean haschildnodes(); nsidomnode insertbefore(in nsidomnode newchild, in nsidomnode refchild) boolean issupported(in domstring feature, in domstring version); void normalize(); nsidomnode removechild(in nsidomnode oldchild) nsidomnode replacechild(in nsidomnode newchild, in nsidomnode oldchild) attributes attribute type description attributes nsidomnamednodemap read only.
... nodetype unsigned short read only.
... constants constant value description element_node 1 attribute_node 2 text_node 3 cdata_section_node 4 entity_reference_node 5 entity_node 6 processing_instruction_node 7 comment_node 8 document_node 9 document_type_node 10 document_fragment_node 11 notation_node 12 methods appendchild() nsidomnode appendchild( in nsidomnode newchild ); parameters newchild return value clonenode() nsidomnode clonenode( in boolean deep ); parameters deep return value hasattributes() boolean hasattributes(); parameters none.
nsIEditor
ection(in boolean should); inline spellchecking methods nsiinlinespellchecker getinlinespellchecker(in boolean autocreate); void syncrealtimespell(); void setspellcheckuseroverride(in boolean enable); clipboard methods void cut(); boolean cancut(); void copy(); boolean cancopy(); void paste(in long aselectiontype); boolean canpaste(in long aselectiontype); selection methods void selectall(); void beginningofdocument(); void endofdocument(); drag/drop methods boolean candrag(in nsidomevent aevent); void dodrag(in nsidomevent aevent); void insertfromdrop(in nsidomevent aevent); node manipulation methods void s...
...xistingrightnode, in long offset, out nsidomnode newleftnode); void joinnodes(in nsidomnode leftnode, in nsidomnode rightnode, in nsidomnode parent); void deletenode(in nsidomnode child); void marknodedirty(in nsidomnode node); direction controller void switchtextdirection(); output methods astring outputtostring(in astring formattype, in unsigned long flags); example: // flags are declared in base/public/nsidocumentencoder.idl // outputselectiononly = 1, outputformatted = 2, // outputraw = 4, outputbodyonly = 8, // outputpreformatted = 16, outputwrap = 32, // outputformatflowed = 64, outputabsolutelinks = 258, // outputencodew3centities = 256, outputcrlinebreak = 512, // outpu...
...editorapi.outputtostring('text/html', 8); // xml: all in xml with _moz_dirty="" in new tags, html tags are in upper case // application/xhtml+xml format do the same editorapi.outputtostring('text/xml', 2); // the body is not recognized, everything is printed void outputtostream(in nsioutputstream astream, in astring formattype, in acstring charsetoverride, in unsigned long flags); listener methods void addeditorobserver(in nsieditorobserver observer);obsolete since gecko 18 void seteditorobserver(in editactionlistener observer); void removeeditorobserver(in nsieditorobserver observer obsolete since gecko 18); void addeditactionlistener(in nsieditactionlistener listener); ...
... [notxpcom] boolean ismodifiablenode(in nsidomnode anode); constants load flags constant value description enone 0 enext 1 eprevious 2 enextword 3 epreviousword 4 etobeginningofline 5 etoendofline 6 attributes attribute type description contentsmimetype string the mime type of the document.
nsIFaviconDataCallback
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void oncomplete(in nsiuri auri, in unsigned long adatalen, [const,array,size_is(adatalen)] in octet adata, in autf8string amimetype); methods oncomplete() called when the required favicon's information is available.
...it's up to the caller to check adatalen > 0 before using any data-related information like mime-type or data itself.
... void oncomplete( in nsiuri auri, in unsigned long adatalen, [const,array,size_is(adatalen)] in octet adata, in autf8string amimetype ); parameters auri receives the "favicon uri" (not the "favicon link uri") associated to the requested page.
... amimetype mime type of the icon, or an empty string if adatalen is 0.
nsIJumpListBuilder
see nsijumplistitem for information on adding additional jump list types.
... method overview void abortlistbuild(); boolean addlisttobuild(in short acattype, in nsiarray items optional, in astring catname optional); boolean commitlistbuild(); boolean deleteactivelist(); boolean initlistbuild(in nsimutablearray removeditems); attributes attribute type description available short indicates whether jump list taskbar features are supported by the current host.
...boolean addlisttobuild( in short acattype, in nsiarray items, optional in astring catname optional ); parameters acattype the type of list to add.
...ns_error_invalid_arg if incorrect parameters are passed for a particular category or item type.
nsIJumpListItem
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) note: to consumers: it's reasonable to expect we'll need support for other types of jump list items (an audio file, an email message, etc.).
... to add types, create the specific interface here, add an implementation class to winjumplistitem, and add support to addlistbuild and removed items processing.
... method overview boolean equals(in nsijumplistitem item); attributes attribute type description type short retrieves the jump list item type.
...compares the type and other properties specific to this item's type: separator - type link - type, uri, title shortcut - type, handler application boolean equals( in nsijumplistitem item ); parameters item another nsijumplistitem to compare to.
nsIMsgDatabase
last changed in gecko 1.9 (firefox 3) inherits from: nsidbchangeannouncer method overview void open(in nsilocalfile afoldername, in boolean acreate, in boolean aleaveinvaliddb); void forcefolderdbclosed(in nsimsgfolder afolder); void close(in boolean aforcecommit); void commit(in nsmsgdbcommit committype); void forceclosed(); void clearcachedhdrs; void resethdrcachesize(in unsigned long size); nsimsgdbhdr getmsghdrforkey(in nsmsgkey key); nsimsgdbhdr getmsghdrformessageid(in string messageid); boolean containskey(in nsmsgkey key); nsimsgdbhdr createnewhdr(in nsmsgkey key); void addnewhdrtodb(in nsimsgdbhdr newhdr, in boolean notify); nsimsgdbhdr copyhdrfromexistinghdr(in nsmsgke...
... void refreshcache(in string asearchfolderuri, in unsigned long anumkeys, array, size_is (anumkeys) in nsmsgkey anewhits, out unsigned long anumbadhits, array, size_is(anumbadhits) out nsmsgkey astalehits); void updatehdrincache(in string asearchfolderuri, in nsimsgdbhdr ahdr, in boolean aadd); boolean hdrisincache(in string asearchfolderuri, in nsimsgdbhdr ahdr); attributes attribute type description dbfolderinfo nsidbfolderinfo readonly: firstnew nsmsgkey readonly: msgretentionsettings nsimsgretentionsettings msgdownloadsettings nsimsgdownloadsettings lowwaterarticlenum nsmsgkey readonly: highwaterarticlenum nsmsgkey readonly: nextpseudomsgkey nsmsgkey for undo-redo of move pop->imap.
... defaultviewflags nsmsgviewflagstypevalue readonly: defaultsorttype nsmsgviewsorttypevalue readonly: defaultsortorder nsmsgviewsortordervalue readonly: msghdrcachesize unsigned long folderstream nsioutputstream summaryvalid boolean methods open() opens a database folder.
... forcefolderdbclosed() void forcefolderdbclosed(in nsimsgfolder afolder); parameters afolder close() void close(in boolean aforcecommit); parameters aforcecommit commit() void commit(in nsmsgdbcommit committype); parameters committype forceclosed() force closed is evil, and we should see if we can do without it.
nsIMsgFilterCustomAction
*/ readonly attribute astring name; /** * is this custom action valid for a particular filter type?
... * * @param type the filter type * @param scope the search scope * * @return true if valid */ boolean isvalidfortype(in nsmsgfiltertypetype type, in nsmsgsearchscopevalue scope); /** * after the user inputs a particular action value for the action, determine * if that value is valid.
... * @param actionfolder folder in the filter list * @param filtertype filter type (manual, offlinemail, etc.) * * @return errormessage a localized message to display if invalid * set to null if the actionvalue is valid */ autf8string validateactionvalue(in autf8string actionvalue, in nsimsgfolder actionfolder, in nsmsgfiltertypetype filtertype); /* allow duplicate actions in the same filter list?
... */ /** * apply the custom action to an array of messages * * @param msghdrs array of nsimsgdbhdr objects of messages * @param actionvalue user-set value to use in the action * @param copylistener calling method (filtertype manual only) * @param filtertype type of filter being applied * @param msgwindow message window */ void apply(in nsiarray msghdrs /* nsimsgdbhdr array */, in autf8string actionvalue, in nsimsgcopyservicelistener copylistener, in nsmsgfiltertypetype filtertype, in nsimsgwindow msgwindow); /* does this action start an a...
nsIMsgFolder
n nsmsgkey msgkey, out pruint32 offset, out pruint32 size); void downloadmessagesforoffline(in nsisupportsarray messages, in nsimsgwindow window); nsimsgfolder getchildwithuri(in acstring uri, in boolean deep, in boolean caseinsensitive); void downloadallforoffline(in nsiurllistener listener, in nsimsgwindow window); void enablenotifications(in long notificationtype, in boolean enable, in boolean dbbatching); boolean iscommandenabled(in acstring command); boolean matchorchangefilterdestination(in nsimsgfolder folder,in boolean caseinsensitive); boolean confirmfolderdeletionforfilter(in nsimsgwindow msgwindow); void alertfilterchanged(in nsimsgwindow msgwindow); void throwalertmsg(in string msgname, in nsimsgwindow...
...er); void addkeywordstomessages(in nsisupportsarray amessages, in acstring akeywords); void removekeywordsfrommessages(in nsisupportsarray amessages, in acstring akeywords); autf8string getmsgtextfromstream(in nsimsgdbhdr amsghdr, in nsiinputstream astream, in long abytestoread, in long amaxoutputlen, in boolean acompressquotes); attributes attribute type description supportsoffline boolean readonly offlinestoreoutputstream nsioutputstream readonly offlinestoreinputstream nsiinputstream readonly retentionsettings nsimsgretentionsettings downloadsettings nsimsgdownloadsettings sortorder long used for order in the folder pane, folder pickers, etc.
... nsmsgdispositionstate_none -1 nsmsgdispositionstate_replied 0 nsmsgdispositionstate_forwarded 1 allmessagecountnotifications 0 turn notifications on/off for various notification types.
...msgwindow window); getchildwithuri() nsimsgfolder getchildwithuri(in acstring uri, in boolean deep, in boolean caseinsensitive); downloadallforoffline() void downloadallforoffline(in nsiurllistener listener, in nsimsgwindow window); enablenotifications() void enablenotifications(in long notificationtype, in boolean enable, in boolean dbbatching); iscommandenabled() boolean iscommandenabled(in acstring command); matchorchangefilterdestination() boolean matchorchangefilterdestination(in nsimsgfolder folder, in boolean caseinsensitive); confirmfolderdeletionforfilter() boolean confirmfolderdeleti...
nsIMsgSearchSession
opeusescustomheaders(in nsmsgsearchscopevalue scope, in voidptr selection, in boolean forfilters); boolean isstringattribute(in nsmsgsearchattribvalue attrib); void addallscopes(in nsmsgsearchscopevalue attrib); void search(in nsimsgwindow awindow); void interruptsearch(); void pausesearch(); void resumesearch(); [noscript] nsmsgsearchtype setsearchparam(in nsmsgsearchtype type, in voidptr param); [noscript] void addresultelement(in nsmsgresultelement element); boolean matchhdr(in nsimsgdbhdr amsghdr, in nsimsgdatabase adatabase); void addsearchhit(in nsimsgdbhdr header, in nsimsgfolder folder); attributes attribute type description searchterms nsisupportsarray readon...
...ly: numsearchterms unsigned long readonly: runningadapter nsimsgsearchadapter readonly: searchparam voidptr not scriptable and readonly: searchtype nsmsgsearchtype readonly: numresults long readonly: window nsimsgwindow constants name value description booleanor 0 booleanand 1 methods addsearchterm() void addsearchterm(in nsmsgsearchattribvalue attrib, in nsmsgsearchopvalue op, in nsimsgsearchvalue value, in boolean booleanand, in string arbitraryheader); parameters attrib attribute for this term.
... boolean isstringattribute(in nsmsgsearchattribvalue attrib); parameters attrib addallscopes() add all scopes of a given type to the search.
... void pausesearch(); resumesearch() void resumesearch(); setsearchparam() [noscript] nsmsgsearchtype setsearchparam(in nsmsgsearchtype type, in voidptr param); parameters type param addresultelement() [noscript] void addresultelement(in nsmsgresultelement element); parameters element matchhdr() boolean matchhdr(in nsimsgdbhdr amsghdr, in nsimsgdatabase adatabase); parameters amsghdr adatabase a...
nsINavHistoryContainerResultNode
inavhistoryresultnode last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsinavhistoryresultnode findnodebydetails(in autf8string auristring, in prtime atime, in long long aitemid, in boolean arecursive); nsinavhistoryresultnode getchild(in unsigned long aindex); unsigned long getchildindex(in nsinavhistoryresultnode anode); attributes attribute type description childcount unsigned long the number of child nodes; accessing this throws an ns_error_not_available exception of containeropen is false.
... dynamiccontainertype autf8string a string representing the dynamic container api service responsible for this container.
... remotecontainertype obsolete since gecko 1.9 autf8string a string representing the remote container service api that is responsible for this container.
...the container may be a result_type_remote_container node that has been dynamically generated by the remote container api, or a bookmark folder (result_type_folder) for which some service (such as livemarks) has registered to provide certain operations.
nsIParentalControlsService
to create an instance, use: var parentalcontrolsservice = components.classes["@mozilla.org/parental-controls-service;1"] .createinstance(components.interfaces.nsiparentalcontrolsservice); method overview void log(in short aentrytype, in boolean aflag, in nsiuri asource, [optional] in nsifile atarget); boolean requesturioverride(in nsiuri atarget, [optional] in nsiinterfacerequestor awindowcontext); boolean requesturioverrides(in nsiarray atargets, [optional] in nsiinterfacerequestor awindowcontext); attributes attribute type description blockfiledownloadsenabled boolean ...
... constants constant value description epclog_urivisit 1 this log entry type represents an access to web content.
... epclog_filedownload 2 this log entry type represents a file download.
... void log( in short aentrytype, in boolean aflag, in nsiuri asource, in nsifile atarget optional ); parameters aentrytype the type of event to log.
nsIPermission
last changed in gecko 2 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsisupports attributes attribute type description capability pruint32 the permission to set: allow, deny, or unknown (which is the default).
... see nsipermissionmanager.permission_type_constants for allowed values.
... expiretype pruint32 the expiration type of the permission: on session termination, on a specified time, or never.
... type acstring the type of permission: cookie, image, and so on.
nsIServiceManager
aiid the interface type to be returned.
... aiid the interface type to be returned.
... aiid the interface type to be tested.
... aiid the interface type to be tested.
nsISocketProviderService
netwerk/socket/nsisocketproviderservice.idlscriptable provides a mapping between a socket type and its associated socket provider instance.
... 66 introduced gecko 1.0 inherits from: nsisupports last changed in gecko 1.7 method overview nsisocketprovider getsocketprovider(in string sockettype); methods getsocketprovider() given a string representing a socket type, this method returns an nsisocketprovider representing that socket type.
... nsisocketprovider getsocketprovider( in string sockettype ); parameters sockettype the socket type for which to get a socket provider.
... return value nsisocketprovider that handles the specified socket type.
nsIWebBrowserChrome2
1.0 66 introduced gecko 1.9 inherits from: nsiwebbrowserchrome last changed in gecko 1.9 (firefox 3) method overview void setstatuswithcontext(in unsigned long statustype, in astring statustext, in nsisupports statuscontext); methods setstatuswithcontext() called when the status text in the chrome needs to be updated.
...void setstatuswithcontext( in unsigned long statustype, in astring statustext, in nsisupports statuscontext ); parameters statustype indicates what is setting the text.
... statuscontext an object that provides context pertaining to the status type.
... if statustype is status_link, then this may be a dom node corresponding to the source of the link.
nsIWebBrowserPersist
s.classes["@mozilla.org/embedding/browser/nswebbrowserpersist;1"] .createinstance(components.interfaces.nsiwebbrowserpersist); method overview void cancelsave(); void savechannel(in nsichannel achannel, in nsisupports afile); void savedocument(in nsidomdocument adocument, in nsisupports afile, in nsisupports adatapath, in string aoutputcontenttype, in unsigned long aencodingflags, in unsigned long awrapcolumn); void saveuri(in nsiuri auri, in nsisupports acachekey, in nsiuri areferrer, in long areferrerpolicy, in nsiinputstream apostdata, in string aextraheaders, in nsisupports afile, in nsiloadcontext aprivacycontext); void saveprivacyawareuri(in nsiuri auri, in nsisupports acachekey, in nsiuri areferrer, in long areferr...
...erpolicy, in nsiinputstream apostdata, in string aextraheaders, in nsisupports afile, in boolean aisprivate); attributes attribute type description currentstate unsigned long current state of the persister object.
... void savedocument( in nsidomdocument adocument, in nsisupports afile, in nsisupports adatapath, in string aoutputcontenttype, in unsigned long aencodingflags, in unsigned long awrapcolumn ); parameters adocument document to save to file.
... aoutputcontenttype the desired mime type format to save the document and all sub-documents into or nsnull to use the default behavior.
nsIWebPageDescriptor
inherits from: nsisupports last changed in gecko 1.7 method overview void loadpage(in nsisupports apagedescriptor, in unsigned long adisplaytype); attributes attribute type description currentdescriptor nsisupports retrieves the page descriptor for the current document.
... constants display type constants constant value description display_as_source 0x0001 generates an optionally syntax-highlighted (for xml/html documents) source of the original page.
...void loadpage( in nsisupports apagedescriptor, in unsigned long adisplaytype ); parameters apagedescriptor the page descriptor for the page to load.
... adisplaytype the display type to use when displaying the loaded page; see display type constants for possible values.
xptcall FAQ
the core invoke function has the declaration: xptc_public_api(nsresult) xptc_invokebyindex(nsisupports* that, pruint32 methodindex, pruint32 paramcount, nsxptcvariant* params); nsxptcvariant is a discriminated union of the types that can be passed as parameters to the target function (including void* to represent arbitrary pointer types).
...xpconnect uses information from typelib files to reflect arbitrary xpcom interfaces into javascript and to make calls from javascript to xpcom using xptc_invokebyindex.
... the information in the typelibs allows xpconnect to convert function parameters and build the nsxptcvariant array required to make this call.
...these stubs forward calls to a shared function whose job it is to use the typelib information to extract the parameters from the platform specific calling convention to build an array of variants to hold the parameters and then call an inherited method which can then do whatever it wants with the call.
LDAP Support
mail compose typedown in mail compose, when typing a partial mail address, a typedown window appears listing possible matches against address books and ldap directories.
...in thunderbird, the type down window can be customized to show arbitrary ldap fields.
... this can be accomplished by setting the following preferences: user_pref("mail.autocomplete.commentcolumn", 2); user_pref("ldap_2.servers.directoryname.autocomplete.commentformat", "[ou]"); the first preference tells us to use a comment column in the type down (the default value is 0 for no comment), and that the value for the comment is a custom string unique to each directory.
..."department: [ou]" would yield a type down entry that looks like "john smit department: client engineering".
Thunderbird Configuration Files
to do add a new preference, open the context menu (right-click) on any existing preference, go to the new menu, and select the type of preference.
...before you can create the file, you must make sure that you can see the file type extensions in windows.
...click the view tab and uncheck the hide extensions for known file types option.
...change the name to user.js (click yes on the file type warning that appears).
Demo Addon
it lists all your email accounts with their account type - either pop3 or imap - and the associated email addresses.
... let data = []; for each (let account in fixiterator(mailservices.accounts.accounts, ci.nsimsgaccount)) { let info = { server: null, type: null, emails: [], name: null, }; let server = account.incomingserver; if (server) { info.server = server.prettyname; info.type = server.type; } for each (let id in fixiterator(account.identities, ci.nsimsgidentity)) { // we're only interested in identities that have a real email.
...from this, we get its name and type.
... because an account can have multiple identities of type nsimsgidentity and therefore multiple associated email addresses, with use fixiterator() again to go over all identities and get every email address.
Working with windows in chrome code
the return value of window.open (and similar methods) is a window object (usually chromewindow) – the same type as the window variable.
... the content shortcut in case of <browser type="content-primary" />, you can use the content shortcut property to accesss the window object of the content document.
...todo: link to how to pass an xpcom object to a new window when it has a more useful example opener code: window.opendialog("chrome://test/content/progress.xul", "myprogress", "chrome,centerscreen", {status: "reading remote data", maxprogress: 50, progress: 10} ); progress.xul: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window onload="onload();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script><![cdata[ var gstatus, gprogressmeter; var maxprogress = 100; function onload() { gstatus = document.getelementbyid("status"); gprogressmeter = document.getelementbyid("progressmeter"); if("arguments" in window && window.arguments.length > 0) { maxprogress = window.
...the only data types that can be passed to the new window are primitives and arrays.
Zombie compartments
multiple compartments can share a zone, where a zone keeps track of things that can easily and securely be shared between related compartments such as string data and type information.
... viewing live compartments if you want to see a list of live compartments, type "about:memory" into the address bar and click on the measure button.
...apes │ │ │ │ │ ├──1.47 mb (00.29%) ++ gc-heap │ │ │ │ │ └──0.96 mb (00.19%) ++ malloc-heap │ │ │ │ ├──1.03 mb (00.21%) -- scripts │ │ │ │ │ ├──0.72 mb (00.14%) ── gc-heap [2] │ │ │ │ │ └──0.31 mb (00.06%) ── malloc-heap/data [2] │ │ │ │ ├──0.80 mb (00.16%) -- type-inference │ │ │ │ │ ├──0.66 mb (00.13%) ── type-scripts [2] │ │ │ │ │ ├──0.13 mb (00.03%) ── allocation-site-tables [2] │ │ │ │ │ └──0.02 mb (00.00%) ── object-type-tables [2] │ │ │ │ └──0.01 mb (00.00%) -- sundries │ │ │ │ ├──0.01 mb (00.00%) ── malloc-heap [2] │ │...
...0.00 mb (00.00%) ── property-tables │ │ └───5.93 mb (01.19%) -- js-zone(0x13ffa0000) │ │ ├──1.92 mb (00.39%) ── unused-gc-things │ │ ├──1.28 mb (00.26%) -- lazy-scripts │ │ │ ├──1.03 mb (00.21%) ── gc-heap │ │ │ └──0.25 mb (00.05%) ── malloc-heap │ │ ├──1.24 mb (00.25%) ── type-pool │ │ ├──1.07 mb (00.21%) -- type-objects │ │ │ ├──1.04 mb (00.21%) ── gc-heap │ │ │ └──0.03 mb (00.01%) ── malloc-heap │ │ ├──0.23 mb (00.05%) ++ strings │ │ └──0.18 mb (00.04%) ── gc-heap-arena-admin the first line says that the window from www.google.de is taking up 28.45 mb and futher b...
Debugging Tips
printing cdata and ctype currently console.log doesn't show type information of cdata.
... let { ctypes } = components.utils.import("resource://gre/modules/ctypes.jsm", {}); let i = ctypes.int32_t(10); console.log(i); let point = ctypes.structtype("point", [{ x: ctypes.int32_t }, { y: ctypes.int32_t }]) let p = point(10, 20); console.log(p); let pp = p.address(); console.log(pp); the result will be as following: cdata { value: 10 } cdata { x: 10, y: 20 } cdata { contents: cdata } to see more descriptive information, you can use .tosource().
... let { ctypes } = components.utils.import("resource://gre/modules/ctypes.jsm", {}); let i = ctypes.int32_t(10); console.log(i.tosource()); let point = ctypes.structtype("point", [{ x: ctypes.int32_t }, { y: ctypes.int32_t }]) let p = point(10, 20); console.log(p.tosource()); let pp = p.address(); console.log(pp.tosource()); the result will be : ctypes.int32_t(10) point(10, 20) point.ptr(ctypes.uint64("0x15fdafb08")) to see the complete type information, you can use .constructor.tosource(), to print the source of ctype.
... let { ctypes } = components.utils.import("resource://gre/modules/ctypes.jsm", {}); let i = ctypes.int32_t(10); console.log(i.constructor.tosource()); let point = ctypes.structtype("point", [{ x: ctypes.int32_t }, { y: ctypes.int32_t }]) let p = point(10, 20); console.log(p.constructor.tosource()); let pp = p.address(); console.log(pp.constructor.tosource()); the result will be as per the following: ctypes.int32_t ctypes.structtype("point", [{ "x": ctypes.int32_t }, { "y": ctypes.int32_t }]) ctypes.structtype("point", [{ "x": ctypes.int32_t }, { "y": ctypes.int32_t }]).ptr ...
Declaring and Calling Functions
const clock = lib.declare("clock", ctypes.default_abi, ctypes.unsigned_long); console.log("clocks since startup: " + clock()); the clock() function requires no input parameters; it simply returns an unsigned long.
... const asctime = lib.declare("asctime", ctypes.default_abi, ctypes.char.ptr, struct_tm.ptr); for a more complete version of this example (including the implementation of the struct_tm type), see the structures example.
... returned values if the return type can fit into a javascript number without loss (that is, it's a number 32 bits or smaller, or is a double or float), then the function just return a javascript number.
... for everything else it returns a ctypes object representing the return value (including 64-bit integers).
Aggregate view - Firefox Developer Tools
there are three main ways to group the data: type call stack inverted call stack you can switch between them using the dropdown menu labeled "group by:" located at the top of the panel: there's also a box labeled "filter" at the top-right of the pane.
... type this is the default view, which looks something like this: it groups the things on the heap into types, including: javascript objects: such as function or array dom elements: such as htmlspanelement or window strings: listed as "strings" javascript sources: listed as "jsscript" internal objects: such as "js::shape".
... each type gets a row in the table, and rows are ordered by the amount of memory occupied by objects of that type.
... next to the type's name, there's an icon that contains three stars arranged in a triangle: click this to see every instance of that type.
Examine and edit HTML - Firefox Developer Tools
there are three types of searches that are performed automatically depending on what you enter, a full text search, a css selector search, and an xpath search.
... as you type, an autocomplete popup shows any class or id attributes that match the current search term: press up and down to cycle through suggestions, tab to choose the current suggestion, then enter to select the first node with that attribute.
...this includes white space (which is after all a type of text).
... note that this button is disabled if the selected element's type is such that adding a last-child would have no effect (for example, if is is an <html> or <iframe> element).
ANGLE_instanced_arrays.drawElementsInstancedANGLE() - Web APIs
syntax void ext.drawelementsinstancedangle(mode, count, type, offset, primcount); parameters mode a glenum specifying the type primitive to render.
... type a glenum specifying the type of the values in the element array buffer.
...must be a valid multiple of the size of the given type.
... if offset is a invalid multiple of the size of the given type, a gl.invalid_operation error is thrown.
AnimationPlaybackEvent.AnimationPlaybackEvent() - Web APIs
syntax var animationplaybackevent = new animationplaybackevent(type, eventinitdict); parameters type a domstring representing the name of the event.
... eventinitdict optional an optional eventinit dictionary object containing the following fields: bubbles optional defaults to false, of type boolean, indicating if the event bubbles or not.
... cancelable optional defaults to false, of type boolean, indicating if the event can be canceled or not.
... detail optional defaults to null, of type any — an event-dependent value associated with the event.
BaseAudioContext - Web APIs
event handlers baseaudiocontext.onstatechange an event handler that runs when an event of type statechange has fired.
... baseaudiocontext.createbiquadfilter() creates a biquadfilternode, which represents a second order filter configurable as several different common filter types: high-pass, low-pass, band-pass, etc baseaudiocontext.createbuffer() creates a new, empty audiobuffer object, which can then be populated by data and played via an audiobuffersourcenode.
... baseaudiocontext.createiirfilter() creates an iirfilternode, which represents a second order filter configurable as several different common filter types.
...in this case, the arraybuffer is usually loaded from an xmlhttprequest's response attribute after setting the responsetype to arraybuffer.
CSSNumericValue.max() - Web APIs
the passed values must be of the same type.
... exceptions typeerror indicates that an invalid type was passed to the method.
... examples as stated earlier, all passed values must be of the same type and value.
... // prints "2cm" console.log(css.cm("1").max(css.cm("2")).tostring()); // prints "max(1cm, 0.393701in)" console.log(css.cm("1").max(css.in("0.393701")).tostring()); specifications specification status comment css typed om level 1the definition of 'max' in that specification.
CSSNumericValue.min() - Web APIs
the passed values must be of the same type.
... exceptions typeerror indicates that an invalid type was passed to the method.
... examples as stated earlier, all passed values must be of the same type and value.
... // prints "1cm" console.log(css.cm("1").min(css.cm("2")).tostring()); // prints "max(1cm, 0.393701in)" console.log(css.cm("1").max(css.in("0.393701")).tostring()); specifications specification status comment css typed om level 1the definition of 'min' in that specification.
CSSNumericValue - Web APIs
the cssnumericvalue interface of the css typed object model api represents operations that all numeric values can perform.
... cssnumericvalue.min returns the minimum value passed cssnumericvalue.max returns the maximum value passed cssnumericvalue.equals true if all the values are the exact same type and value, in the same order.
... cssnumericvalue.tosum tbd cssnumericvalue.type tbd cssnumericvalue.parse allows a cssnumericvalue to be constructed directly from a string containing css.
... specifications specification status comment css typed om level 1the definition of 'cssnumericvalue' in that specification.
Using dynamic styling information - Web APIs
modify a stylesheet rule with cssom <html> <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.
... <html> <head> <title>simple style example</title> <script type="text/javascript"> function alterstyle(elem) { elem.style.background = 'green'; } function resetstyle(elemid) { elem = document.getelementbyid(elemid); elem.style.background = 'white'; } </script> <style type="text/css"> #p1 { border: solid blue 2px; } </style> </head> <body> <!-- passes a reference to the element's object as parameter 'this'.
... more important than the two properties noted here is the use of the style object to set individual style properties on an element: <!doctype html> <html> <head> <title>style property example</title> <link rel="stylesheet" href="example.css" type="text/css"> <script type="text/javascript"> function stilo() { document.getelementbyid('d').style.color = 'orange'; } function resetstyle() { document.getelementbyid('d').style.color = 'black'; } </script> </head> <body> <div id="d" class="thunder">thu...
...nder</div> <button onclick="stilo()">click here to change text color</button> <button onclick="resetstyle()">reset text color</button> </body> </html> the media and type of the style may or may not be given.
Basic usage of canvas - Web APIs
other contexts may provide different types of rendering; for example, webgl uses a 3d context based on opengl es.
...getcontext() takes one parameter, the type of context.
... <!doctype html> <html> <head> <meta charset="utf-8"/> <title>canvas tutorial</title> <script type="text/javascript"> function draw() { var canvas = document.getelementbyid('tutorial'); if (canvas.getcontext) { var ctx = canvas.getcontext('2d'); } } </script> <style type="text/css"> canvas { border: 1px solid black; } </style> <...
... <!doctype html> <html> <head> <meta charset="utf-8"/> <script type="application/javascript"> function draw() { var canvas = document.getelementbyid('canvas'); if (canvas.getcontext) { var ctx = canvas.getcontext('2d'); ctx.fillstyle = 'rgb(200, 0, 0)'; ctx.fillrect(10, 10, 50, 50); ctx.fillstyle = 'rgba(0, 0, 200, 0.5)'; ctx.fillrect(30, 30, 50...
Pixel manipulation with canvas - Web APIs
<canvas id="canvas" width="300" height="227"></canvas> <div> <input id="grayscalebtn" value="grayscale" type="button"> <input id="invertbtn" value="invert" type="button"> </div> var img = new image(); img.src = 'https://mdn.mozillademos.org/files/5397/rhino.jpg'; img.onload = function() { draw(this); }; function draw(img) { var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); ctx.drawimage(img, 0, 0); img.style.display = 'none'; var imagedata = ctx.getimag...
... zoom example <canvas id="canvas" width="300" height="227"></canvas> <canvas id="zoom" width="300" height="227"></canvas> <div> <label for="smoothbtn"> <input type="checkbox" name="smoothbtn" checked="checked" id="smoothbtn"> enable image smoothing </label> </div> var img = new image(); img.src = 'https://mdn.mozillademos.org/files/5397/rhino.jpg'; img.onload = function() { draw(this); }; function draw(img) { var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); ctx.drawimage(img, 0, 0); img.style.display = 'none...
...it returns a data uri containing a representation of the image in the format specified by the type parameter (defaults to png).
... canvas.toblob(callback, type, encoderoptions) creates a blob object representing the image contained in the canvas.
CloseEvent() - Web APIs
syntax var event = new closeevent(typearg, closeeventinit); values typearg is a domstring representing the name of the event.
... closeeventinit optional is a closeeventinit dictionary, having the following fields: "wasclean", optional and defaulting to false, of type long, indicates if the connection has been closed cleanly or not.
... "code", optional and defaulting to 0, of type unsigned short, that is the connection close code sent by the server.
... "reason", optional and defaulting to '', of type domstring, that is a human-readable reason why the server closed the connection.
DOMException - Web APIs
(legacy code value: 15 and legacy constant name: invalid_access_err) typemismatcherror the type of the object does not match the expected type.
... (legacy code value: 17 and legacy constant name: type_mismatch_err) this value is deprecated; the javascript typeerror exception is now raised instead of a domexception with this value.
...(legacy code value: 23 and legacy constant name: timeout_err) invalidnodetypeerror the node is incorrect or has an incorrect ancestor for this operation.
... (legacy code value: 24 and legacy constant name: invalid_node_type_err) datacloneerror the object can not be cloned.
DOMImplementation.createDocument() - Web APIs
syntax var doc = document.implementation.createdocument(namespaceuri, qualifiednamestr, documenttype); parameters namespaceuri is a domstring containing the namespace uri of the document to be created, or null if the document doesn't belong to one.
... documenttype optional is the documenttype of the document to be created.
... living standard modified the return type of createdocument() from document to xmldocument.
... the third argument of createdocument(), doctype, is now optional and default to null.
EventTarget.removeEventListener() - Web APIs
the event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see matching event listeners for removal syntax target.removeeventlistener(type, listener[, options]); target.removeeventlistener(type, listener[, usecapture]); parameters type a string which specifies the type of event for which to remove an event listener.
... the available options are: capture: a boolean which indicates that events of this type will be dispatched to the registered listener before being dispatched to any eventtarget beneath it in the dom tree.
...obviously, you need to specify the same type and listener parameters to removeeventlistener().
... while addeventlistener() will let you add the same listener more than once for the same type if the options are different, the only option removeeventlistener() checks is the capture/usecapture flag.
FileSystemDirectoryEntry.getDirectory() - Web APIs
the fileerror.code specifies what type of error occurred, as follows: fileerror.not_found_err the create option was not specified (or was specified as false), and the directory doesn't exist.
... fileerror.type_mismatch_err the path specified is not a directory; it's probably a file, but might be an unsupported file descriptor such as a pipe; this depends on the user agent to some extent.
... option values file/directory condition result create exclusive false n/a[1] path exists and matches the desired type (depending on whether the function called is getfile() or getdirectory() the successcallback is called with a filesystemfileentry if getfile() was called or a filesystemdirectoryentry if getdirectory() was called.
... false n/a[1] path exists but doesn't match the desired type the errorcallback is called with an appropriate error code (if the callback was provided).
FileSystemDirectoryEntry.getFile() - Web APIs
the {domxref("fileerror.code")}} specifies what type of error occurred, as follows: fileerror.not_found_err the create option was not specified (or was specified as false), and the file doesn't exist.
... fileerror.type_mismatch_err the path specified is not a file; it's probably a directory, but might be an unsupported file descriptor such as a pipe; this depends on the user agent to some extent.
... option values file/directory condition result create exclusive false n/a[1] path exists and matches the desired type (depending on whether the function called is getfile() or getdirectory() the successcallback is called with a filesystemfileentry if getfile() was called or a filesystemdirectoryentry if getdirectory() was called.
... false n/a[1] path exists but doesn't match the desired type the errorcallback is called with an appropriate error code (if the callback was provided).
Using FormData Objects - Web APIs
the transmitted data is in the same format that the form's submit() method would use to send the data if the form's encoding type were set to multipart/form-data.
...var blob = new blob([content], { type: "text/xml"}); formdata.append("webmasterfile", blob); var request = new xmlhttprequest(); request.open("post", "http://foo.com/submitform.php"); request.send(formdata); note: the fields "userfile" and "webmasterfile" both contain a file.
...simply include an <input> element of type file in your <form>: <form enctype="multipart/form-data" method="post" name="fileinfo"> <label>your email address:</label> <input type="email" autocomplete="on" autofocus name="userid" placeholder="email" required size="32" maxlength="64" /><br /> <label>custom file label:</label> <input type="text" name="filelabel" size="12" maxlength="32" /><br /> <label>file to stash:</label> <inp...
...ut type="file" name="file" required /> <input type="submit" value="stash the file!" /> </form> <div></div> then you can send it using code like the following: var form = document.forms.nameditem("fileinfo"); form.addeventlistener('submit', function(ev) { var ooutput = document.queryselector("div"), odata = new formdata(form); odata.append("customfield", "this is some extra data"); var oreq = new xmlhttprequest(); oreq.open("post", "stash.php", true); oreq.onload = function(oevent) { if (oreq.status == 200) { ooutput.innerhtml = "uploaded!"; } else { ooutput.innerhtml = "error " + oreq.status + " occurred when trying to upload your file.<br \/>"; } }; oreq.send(odata); ev.preventdefault(); }, false); note: if you pass in a reference to t...
GlobalEventHandlers.onkeypress - Web APIs
html <input> <p id="log"></p> javascript const input = document.queryselector('input'); const log = document.getelementbyid('log'); input.onkeypress = logkey; function logkey(e) { log.textcontent += ` ${e.code}`; } result filter keys with a regular expression this example filters the characters typed into a form field using a regular expression.
...y(event) { return event.charcode === 0 || /\d/.test(string.fromcharcode(event.charcode)); } const input = document.queryselector('input'); input.onkeypress = numbersonly; // prevent pasting (since pasted content might include non-number characters) input.onpaste = event => false; result capture the typing of a hidden word the following javascript function will do something after the user types the word "exit" in any point of a page.
... /* type the word "exit" in any point of your page...
... */ (function () { const ssecret = /* choose your hidden word...: */ "exit"; let noffset = 0; document.onkeypress = function(opevt) { let oevent = opevt || window.event, nchr = oevent.charcode, snodetype = oevent.target.nodename.touppercase(); if (nchr === 0 || oevent.target.contenteditable.touppercase() === "true" || snodetype === "textarea" || snodetype === "input" && oevent.target.type.touppercase() === "text") { return true; } if (nchr !== ssecret.charcodeat(noffset)) { noffset = nchr === ssecret.charcodeat(0) ?
msAudioCategory - Web APIs
value include a description of the property's value, including data type and what it represents.
... yes communications for streaming communication audio such as the following: voip real time chat or other type of phone calls should not be used in non-real-time or non-communication scenarios, such as audio and/or video playback, as playback startup latency is affected.
... game sound effects designed to mix with existing audio characters talking all non-music sounds no gamemedia background music played by a game no soundeffects game or other sound effects designed to mix with existing audio: characters talking beeps, dings, brief sounds no other default audio type, and recommended for all audio media that does not need to continue playing in the background.
... no if msaudiodevicetype is not explicitly set, msaudiodevicetype will be set to communications.
HTMLCanvasElement.getContext() - Web APIs
later calls to this method on the same canvas element return the same drawing context instance as was returned the last time the method was invoked with the same contexttype argument.
... to get a different drawing context object you need to pass a different contexttype or call the method on a different canvas element.
... syntax var ctx = canvas.getcontext(contexttype); var ctx = canvas.getcontext(contexttype, contextattributes); parameters contexttype is a domstring containing the context identifier defining the drawing context associated to the canvas.
... if the contexttype doesn't match a possible drawing context, null is returned.
HTMLCanvasElement.mozGetAsFile() - Web APIs
syntax canvas.mozgetasfile(name, type); parameters name a domstring indicating the file name to give the file representing the image file in memory.
... type optional a domstring which specifies the image file format to use when creating the new image file.
... the default type is image/png.
... for other options, see our image file type and format guide.
HTMLElement: change event - Web APIs
bubbles yes cancelable no interface event event handler property onchange depending on the kind of element being changed and the way the user interacts with the element, the change event fires at a different moment: when the element is :checked (by clicking or using the keyboard) for <input type="radio"> and <input type="checkbox">; when the user commits the change explicitly (e.g., by selecting a value from a <select>'s dropdown with a mouse click, by selecting a date from a date picker for <input type="date">, by selecting a file in the file picker for <input type="file">, etc.); when the element loses focus after its value was changed, but not commited (e.g., after editing the value...
... of <textarea> or <input type="text">).
... the html specification lists the <input> types that should fire the change event.
...: "select result"; } select { grid-area: select; } .result { grid-area: result; } javascript const selectelement = document.queryselector('.ice-cream'); selectelement.addeventlistener('change', (event) => { const result = document.queryselector('.result'); result.textcontent = `you like ${event.target.value}`; }); result text input element for some elements, including <input type="text">, the change event doesn't fire until the control loses focus.
HTMLFormElement: submit event - Web APIs
bubbles yes (although specified as a simple event that doesn't bubble) cancelable yes interface submitevent event handler property globaleventhandlers.onsubmit note that the submit event fires on the <form> element itself, and not on any <button> or <input type="submit"> inside it.
... the submit event fires when the user clicks a submit button (<button> or <input type="submit">) or presses enter while editing a field (e.g.
... <input type="text">) in a form.
... html <form id="form"> <label>test field: <input type="text"></label> <br><br> <button type="submit">submit form</button> </form> <p id="log"></p> javascript function logsubmit(event) { log.textcontent = `form submitted!
HTMLInputElement.setSelectionRange() - Web APIs
note that accordingly to the whatwg forms spec selectionstart, selectionend properties and setselectionrange method apply only to inputs of types text, search, url, tel and password.
... chrome, starting from version 33, throws an exception while accessing those properties and method on the rest of input types.
... for example, on input of type number: "failed to read the 'selectionstart' property from 'htmlinputelement': the input element's type ('number') does not support selection".
... html <input type="text" id="text-box" size="20" value="mozilla"> <button onclick="selecttext()">select text</button> javascript function selecttext() { const input = document.getelementbyid('text-box'); input.focus(); input.setselectionrange(2, 5); } result specifications specification status comment html living standardthe definition of 'htmlinputelement.setselectionrang...
In depth: Microtasks and the JavaScript runtime environment - Web APIs
there are three types of code that create a new execution context: the global context is the execution context created to run the main body of your code; that is, any code that exists outside of a javascript function.
... there are three types of event loop: window event loop the window event loop is the one that drives all of the windows sharing a similar origin (though there are further limits to this as described elsewhere in this article xxxx ????).
...workers are kept in one or more agents that are separate from the "main" code; the browser may use a single event loop for all of the workers of a given type or may use multiple event loops to handle them.
...this includes worklets of type worklet, audioworklet, and paintworklet.
Browser storage limits and eviction criteria - Web APIs
different types of data storage even in the same browser, using the same storage method, there are different classes of data storage to understand.
... storage comes in two types: persistent: this is data that is intended to be kept around for a long time.
... each storage type represents a separate repository.
... storages maintained by the quota manager (see below) <profile>/storage/permanent — persistent data storage repository <profile>/storage/temporary — temporary data storage repository <profile>/storage/default — default data storage repository note: after introducing storage api, the "permanent" folder can be considered obsolete; the "permanent" folder only stores indexeddb persistent-type databases.
KeyboardEvent.key - Web APIs
WebAPIKeyboardEventkey
if the key produces a character key that would result in a character being inserted into possibly an <input>, <textarea> or an element with htmlelement.contenteditable set to true, the beforeinput and input event types are fired in that order.
... html <div class="fx"> <div> <textarea rows="5" name="test-target" id="test-target"></textarea> <button type="button" name="btn-clear-console" id="btn-clear-console">clear console</button> </div> <div class="flex"> <pre id="console-log"></pre> </div> </div> css .fx { -webkit-display: flex; display: flex; margin-left: -20px; margin-right: -20px; } .fx > div { padding-left: 20px; padding-right: 20px; } .fx > div:first-child { width: 30%; } .flex { -webkit-flex: 1; flex: ...
... when key 2 is pressed, another keydown event is fired for this new key press, and the key property value for the event is set to the string @ for the u.s keyboard type and " for the uk keyboard type, because of the active modifier shift key.
... when key 2 is pressed, another keydown event is fired for this new key press, and the key property value for the event is set to be the string @ for the u.s keyboard type and " for the uk keyboard type, because of the active modifier shift key.
KeyboardEvent - Web APIs
the event type (keydown, keypress, or keyup) identifies what kind of keyboard activity occurred.
... events the following events are based on the keyboardevent type.
... usage notes there are three types of keyboard events: keydown, keypress, and keyup.
... example <!doctype html> <html> <head> <script> 'use strict'; document.addeventlistener('keydown', (event) => { const keyname = event.key; if (keyname === 'control') { // do not alert when only control key is pressed.
MediaCapabilities.encodingInfo() - Web APIs
the mediacapabilities.encodinginfo() method, part of the mediacapabilities interface of the media capabilities api, returns a promise with the tested media configuration's mediacapabilitiesinfo; this contains the three boolean properties supported, smooth, and powerefficient, which describe how compatible the device is with the type of media.
... syntax mediacapabilities.encodinginfo(mediaencodingconfiguration) parameters mediaencodingconfiguration a valid mediaencodingconfiguration dictionary containing a valid media encoding type of record or transmission and a valid media configuration: either an audioconfiguration or videoconfiguration dictionary.
... return value a promise fulfilling with a mediacapabilitiesinfo interface containing three boolean attributes: supported smooth powerefficient exceptions a typeerror is raised if the mediaconfiguration passed to the encodinginfo() method is invalid, either because the type is not video or audio, the contenttype is not a valid codec mime type, or any other error in the media configuration passed to the method, including omitting any of the media encoding configuration elements.
... example //create media configuration to be tested const mediaconfig = { type : 'record', // or 'transmission' video : { contenttype : "video/webm;codecs=vp8.0", // valid content type width : 1920, // width of the video height : 1080, // height of the video bitrate : 120000, // number of bits used to encode 1s of video framerate : 48 // number of frames making up that 1s.
MediaKeySystemConfiguration - Web APIs
properties mediakeysystemconfiguration.initdatatypes read only returns a list of supported initialization data type names.
... an initialization data type is a string indicating the format of the initialization data.
... mediakeysystemconfiguration.audiocapabilities read only returns a list of supported audio type and capability pairs.
... mediakeysystemconfiguration.videocapabilities read only returns a list of supported video type and capability pairs.
MediaSource - Web APIs
mediasource.addsourcebuffer() creates a new sourcebuffer of the given mime type and adds it to the mediasource.sourcebuffers list.
... static methods mediasource.istypesupported() returns a boolean value indicating if the given mime type is supported by the current user agent — this is, if it can successfully create sourcebuffer objects for that mime type.
...as written by nick desaulniers and can be viewed live here (you can also download the source for further investigation.) var video = document.queryselector('video'); var asseturl = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource(); //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sour...
...cebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffer(buf); }); }; function fetchab (url, cb) { console.log(url); var xhr = new xmlhttprequest; xhr.open('get', url); xhr.responsetype = 'arraybuffer'; xhr.onload = function () { cb(xhr.response); }; xhr.send(); }; specifications specification status comment media source extensionsthe definition of 'mediasource' in that specification.
MouseEvent.initMouseEvent() - Web APIs
syntax event.initmouseevent(type, canbubble, cancelable, view, detail, screenx, screeny, clientx, clienty, ctrlkey, altkey, shiftkey, metakey, button, relatedtarget); parameters type the string to set the event's type to.
... possible types for mouse events include: click, mousedown, mouseup, mouseover, mousemove, mouseout.
...only used with some event types (e.g., mouseover and mouseout).
... example html <div style="background:red; width:180px; padding:10px;"> <div id="out"></div> <input type="text"> </div> javascript document.body.onclick = function(){ e = arguments[0]; var dt = e.target,stag = dt.tagname.tolowercase(); document.getelementbyid("out").innerhtml = stag; }; var simulateclick = function(){ var evt = document.createevent("mouseevents"); evt.initmouseevent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null); document.body.dispatchevent(evt); } simulateclick(); result specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'mouseevent.initmouseevent()' in that specification.
Web-based protocol handlers - Web APIs
this is becoming more important as more types of applications migrate to the web.
... example <!doctype html public "-//w3c//dtd html 4.01//en"> <html lang="en"> <head> <title>web protocol handler sample - register</title> <script type="text/javascript"> navigator.registerprotocolhandler("web+burger", "http://www.google.co.uk/?uri=%s", "burger handler"); </script> </head> <body> <h1>web protocol handler sample</h1> <p...
... example <!doctype html public "-//w3c//dtd html 4.01//en"> <html lang="en"> <head> <title>web protocol handler sample - test</title> </head> <body> <p>hey have you seen <a href="web+burger:cheeseburger">this</a> before?</p> </body> </html> handling the next phase is handling the action.
... example <?php $value = ""; if ( isset ( $_get["value"] ) ) { $value = $_get["value"]; } ?> <!doctype html public "-//w3c//dtd html 4.01//en"> <html lang="en"> <head> <title>web protocol handler sample</title> </head> <body> <h1>web protocol handler sample - handler</h1> <p>this web page is called when handling a <code>web+burger:</code> protocol action.
OffscreenCanvas.convertToBlob() - Web APIs
syntax promise<blob> offscreencanvas.converttoblob(options); parameters optionsoptional you can specify several options when converting your offscreencanvas object into a blob object, for example: const blob = offscreencanvas.converttoblob({ type: "image/jpeg", quality: 0.95 }); options: type: a domstring indicating the image format.
... the default type is image/png.
... quality: a number between 0 and 1 indicating image quality if the type option is image/jpeg or image/webp.
... offscreen.converttoblob().then(function(blob) { console.log(blob); }); // blob { size: 334, type: "image/png" } specifications currently drafted as a proposal: offscreencanvas.
OffscreenCanvas.convertToBlob() - Web APIs
syntax promise<blob> offscreencanvas.converttoblob(options); parameters optionsoptional you can specify several options when converting your offscreencanvas object into a blob object, for example: const blob = offscreencanvas.converttoblob({ type: "image/jpeg", quality: 0.95 }); options: type: a domstring indicating the image format.
... the default type is image/png.
... quality: a number between 0 and 1 indicating image quality if the type option is image/jpeg or image/webp.
... offscreen.converttoblob().then(function(blob) { console.log(blob); }); // blob { size: 334, type: "image/png" } specifications specification status comment html living standardthe definition of 'offscreencanvas: converttoblob' in that specification.
OffscreenCanvas.convertToBlob() - Web APIs
syntax promise<blob> offscreencanvas.converttoblob(options); parameters options optional you can specify several options when converting your offscreencanvas object into a blob object, for example: const blob = offscreencanvas.converttoblob({ type: "image/jpeg", quality: 0.95 }); options: type: a domstring indicating the image format.
... the default type is image/png.
... quality: a number between 0 and 1 indicating image quality if the type option is image/jpeg or image/webp.
... offscreen.converttoblob().then(function(blob) { console.log(blob); }); // blob { size: 334, type: "image/png" } specifications currently drafted as a proposal: offscreencanvas.
PerformanceEntry.duration - Web APIs
the value returned by this property depends on the performance entry's type: "frame" - returns a timestamp indicating the difference between the starttimes of two successive frames.
... note: if the performance entry has an entrytype of "resource" (i.e.
...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 each method var s...
...upported = typeof obj[methods[i]] == "function"; if (supported) { var js = obj[methods[i]](); log("..." + methods[i] + "() = " + json.stringify(js)); } else { log("..." + methods[i] + " = not supported"); } } } specifications specification status comment performance timeline level 2the definition of 'duration' in that specification.
PerformanceEntry.startTime - Web APIs
the value returned by this property depends on the performance entry's type: "frame" - returns the timestamp when the frame was started.
... note: if the performance entry has an entrytype of "resource" (i.e.
...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 each method var s...
...upported = typeof obj[methods[i]] == "function"; if (supported) { var js = obj[methods[i]](); log("..." + methods[i] + "() = " + json.stringify(js)); } else { log("..." + methods[i] + " = not supported"); } } } specifications specification status comment performance timeline level 2the definition of 'starttime' in that specification.
Multi-touch interaction - Web APIs
example this example demonstrates using pointer events' various event types (pointerdown, pointermove, pointerup pointercancel, etc.) for different multi-touch interactions.
...it may be called multiple times (for example, if the user moves the pointer) before a different event type is fired.
... function pointerup_handler(ev) { if (logevents) log(ev.type, ev); // remove this touch point from the cache and reset the target's // background and border remove_event(ev); update_background(ev); ev.target.style.border = "1px solid black"; } application ui the application uses <div> elements for the touch areas and provides buttons to enable logging and to clear the log.
...false : true; } function log(name, ev) { var o = document.getelementsbytagname('output')[0]; var s = name + ": pointerid = " + ev.pointerid + " ; pointertype = " + ev.pointertype + " ; isprimary = " + ev.isprimary; o.innerhtml += s + " "; } function clearlog(event) { var o = document.getelementsbytagname('output')[0]; o.innerhtml = ""; } ...
Pinch zoom gestures - Web APIs
there are many types of gestures, from the simple single-touch swipe gesture to the more complex multi-touch twist gesture, where the touch points (aka pointers) move in different directions.
... example in this example, you use the pointer events to simultaneously detect two pointing devices of any type, including fingers, mice, and pens.
... function pointerup_handler(ev) { log(ev.type, ev); // remove this pointer from the cache and reset the target's // background and border remove_event(ev); ev.target.style.background = "white"; ev.target.style.border = "1px solid black"; // if the number of pointers down is less than two then reset diff tracker if (evcache.length < 2) { prevdiff = -1; } } application ui the application uses a <div> element for the touc...
...false : true; } function log(prefix, ev) { if (!logevents) return; var o = document.getelementsbytagname('output')[0]; var s = prefix + ": pointerid = " + ev.pointerid + " ; pointertype = " + ev.pointertype + " ; isprimary = " + ev.isprimary; o.innerhtml += s + " "; } function clearlog(event) { var o = document.getelementsbytagname('output')[0]; o.innerhtml = ""; } ...
RTCDataChannel: error event - Web APIs
examples // strings for each of the sctp cause codes found in rfc // 4960, section 3.3.10: // https://tools.ietf.org/html/rfc4960#section-3.3.10 const sctpcausecodes = [ "no sctp error", "invalid stream identifier", "missing mandatory parameter", "stale cookie error", "sender is out of resource (i.e., memory)", "unable to resolve address", "unrecognized sctp chunk type received", "invalid mandatory parameter", "unrecognized parameters", "no user data (sctp data chunk has no data)", "cookie received while shutting down", "restart of an association with new addresses", "user-initiated abort", "protocol violation" ]; dc.addeventlistener("error", ev => { const err = ev.error; console.error("webrtc error: ", err.message); // handle specific er...
...ror detail types switch(err.errordetail) { case "sdp-syntax-error": console.error(" sdp syntax error in line ", err.sdplinenumber); break; case "idp-load-failure": console.error(" identity provider load failure: http error ", err.httprequeststatuscode); break; case "sctp-failure": if (err.sctpcausecode < sctpcausecodes.length) { console.error(" sctp failure: ", err.sctpcausecode); } else { console.error(" unknown sctp error"); } break; case "dtls-failure": if (err.receivedalert) { console.error(" received dlts failure alert: ", err.receivedalert); } if (err.sentalert) { console.error(" sent dlts failure alert: ", err.receivedalert); } ...
...each error type has a different set of information output.
...other error types similarly output appropriate information.
RTCDataChannel - Web APIs
the peer being invited to exchange data receives a datachannel event (which has type rtcdatachannelevent) to let it know the data channel has been added to the connection.
... propertiesalso inherits properties from: eventtargetbinarytype the property binarytype on the rtcdatachannel interface is a domstring which specifies the type of javascript object which should be used to represent binary data received on the rtcdatachannel.
... values allowed by the websocket.binarytype property are also permitted here: "blob" if blob objects are being used or "arraybuffer" if arraybuffer objects are being used.
...if no protocol was specified when the data channel was created, then this property's value is "" (the empty string).readystate read only the read-only rtcdatachannel property readystate returns an enum of type rtcdatachannelstate which indicates the state of the data channel's underlying data connection.reliable read only the read-only rtcdatachannel property reliable indicates whether or not the data channel is reliable.stream read only the deprecated (and never part of the official specification) read-only rtcdatachannel property stream returns an id number (between 0 and 65,535) which unique...
RTCIceTransport - Web APIs
the value is one of the strings from the rtcicetransport enumerated type: "rtp" or "rtsp".
...the value is one of those included in the rtcicegathererstate enumerated type: "new", "gathering", or "complete".
... role read only returns a domstring whose value is one of the members of the rtcicerole enumerated type: "controlling" or "controlled"; this indicates whether the ice agent is the one that makes the final decision as to the candidate pair to use or not.
...see the rtcicetransportstate enumerated type for a complete list of states.
RTCPeerConnection.iceGatheringState - Web APIs
the read-only property rtcpeerconnection.icegatheringstate returns an enum of type rtcicegatheringstate that describes connection's ice gathering state.
... you can detect when the value of this property changes by watching for an event of type icegatheringstatechange.
... syntax var state = rtcpeerconnection.icegatheringstate; value the possible values are those of an enum of type rtcicegatheringstate.
...you can detect when this value changes by watching for an event of type icegatheringstatechange.
RTCPeerConnection.setRemoteDescription() - Web APIs
this value is an offer or answer received from the remote peer through your implementation of the sessiondescription parameter is technically of type rtcsessiondescriptioninit, but because rtcsessiondescription serializes to be indistinguishable from rtcsessiondescriptioninit, you can also pass in an rtcsessiondescription.
... invalidstateerror the rtcpeerconnection is closed, or it's in a state which isn't compatible with the specified description's type.
... for example, if the type is rollback and the signaling state is one of stable, have-local-pranswer, or have-remote-pranswer, this exception is thrown, because you can't roll back a connection that's either fully established or is in the final stage of becoming connected.
... typeerror the specified rtcsessiondescriptioninit or rtcsessiondescription object is missing the type property, or no description parameter was provided at all.
RTCRtpStreamStats - Web APIs
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.
...this value will match that of the media type indicated by rtccodecstats.codec, as well as the track's kind property.
... previously called mediatype.
... obsolete fields mediatype renamed to kind in the specification in february 2018.
RTCSessionDescription() - Web APIs
that dictionary has the following properties: type required.
... a string which is a member of the rtcsdptype enum; it must have one of the following values: this enum defines strings that describe the current state of the session description, as used in the type property.
... the session description's type will be specified using one of these values.
... rollback this special type with an empty session description is used to roll back to the previous stable state.
ReadableStream.ReadableStream() - Web APIs
the controller parameter passed to this method is a readablestreamdefaultcontroller or a readablebytestreamcontroller, depending on the value of the type property.
...the controller parameter passed to this method is a readablestreamdefaultcontroller or a readablebytestreamcontroller, depending on the value of the type property.
... type optional this property controls what type of readable stream is being dealt with.
... exceptions rangeerror the supplied type value is neither "bytes" nor undefined.
Request() - Web APIs
WebAPIRequestRequest
errors type description typeerror since firefox 43, request() will throw a typeerror if the url has credentials, such as http://user:password@example.com.
...since we are fetching an image, we run body.blob on the response to give it the proper mime type so it will be handled properly, then create an object url of it and display it in an <img> element.
...onse) { return response.blob(); }).then(function(response) { var objecturl = url.createobjecturl(response); myimage.src = objecturl; }); in our fetch request with init example (see fetch request init live) we do the same thing except that we pass in an init object when we invoke fetch(): var myimage = document.queryselector('img'); var myheaders = new headers(); myheaders.append('content-type', 'image/jpeg'); var myinit = { method: 'get', headers: myheaders, mode: 'cors', cache: 'default' }; var myrequest = new request('flowers.jpg',myinit); fetch(myrequest).then(function(response) { ...
... var myinit = { method: 'get', headers: { 'content-type': 'image/jpeg' }, mode: 'cors', cache: 'default' }; var myrequest = new request('flowers.jpg', myinit); you may also pass a request object to the request() constructor to create a copy of the request (this is similar to calling the clone() method.) var copy = new request(myrequest); note: this last usage is probably only useful in serviceworkers.
SVGTransformList - Web APIs
m removeitem(in unsigned long index) svgtransform appenditem(in svgtransform newitem) svgtransform createsvgtransformfrommatrix(in svgmatrix) svgtransform consolidate() properties readonly unsigned long numberofitems readonly unsigned long length normative document svg 1.1 (2nd edition) properties name type description numberofitems unsigned long the number of items in the list.
... createsvgtransformfrommatrix(in svgmatrix) svgtransform creates an svgtransform object which is initialized to transform of type svg_transform_matrix and whose values are the given matrix.
... consolidate() svgtransform consolidates the list of separate svgtransform objects by multiplying the equivalent transformation matrices together to result in a list consisting of a single svgtransform object of type svg_transform_matrix.
... <svg id="my-svg" viewbox="0 0 300 280" xmlns="http://www.w3.org/2000/svg" version="1.1"> <desc>example showing how to transform svg elements that using svgtransform objects</desc> <script type="application/ecmascript"> <![cdata[ function transformme(evt) { // svg root element to access the createsvgtransform() function var svgroot = evt.target.parentnode; // svgtransformlist of the element that has been clicked on var tfmlist = evt.target.transform.baseval; // create a seperate transform object for each transform var translate = svgroot.creates...
SharedWorker() - Web APIs
available properties are as follows: type: a domstring specifying the type of worker to create.
... credentials: a domstring specifying the type of credentials to use for the worker.
...if not specified, or if type is classic, the default used is omit (no credentials required).
... a networkerror is raised if the mime type of the worker script is incorrect.
Using readable streams - Web APIs
in the pump() function seen above we first invoke read(), which returns a promise containing a results object — this has the results of our read in it, in the form { done, value }: return reader.read().then(({ done, value }) => { the results can be one of three different types: if a chunk is available to read, the promise will be fulfilled with an object of the form { value: thechunk, done: false }.
... the generic syntax skeleton looks like this: const stream = new readablestream({ start(controller) { }, pull(controller) { }, cancel() { }, type, autoallocatechunksize }, { highwatermark, size() }); the constructor takes two objects as parameters.
... type and autoallocatechunksize — these are used — when included — to signify that the stream is to be a bytestream.
... note: in order to consume a stream using fetchevent.respondwith(), the enqueued stream contents must be of type uint8array; for example, encoded using textencoder.
SubtleCrypto.importKey() - Web APIs
keydata is an arraybuffer, a typedarray, a dataview, or a jsonwebkey object containing the key in the given format.
... algorithm is a dictionary object defining the type of key to import and providing extra algorithm-specific parameters.
... exceptions the promise is rejected when one of the following exceptions is encountered: syntaxerror raised when keyusages is empty but the unwrapped key is of type secret or private.
... typeerror raised when trying to use an invalid format or if the keydata is not suited for that format.
Using Touch Events - Web APIs
interfaces touch events consist of three interfaces (touch, touchevent and touchlist) and the following event types: touchstart - fired when a touch point is placed on the touch surface.
... changedtouches - a list of the touch points whose items depends on the associated event type: for the touchstart event, it is a list of the touch points that became active with the current event.
... register an event handler for each touch event type.
...additionally, the pointer event types are very similar to mouse event types (for example, pointerdown pointerup) thus code to handle pointer events closely matches mouse handling code.
TrackEvent - Web APIs
events based on trackevent are always sent to one of the media track list types: events involving video tracks are always sent to the videotracklist found in htmlmediaelement.videotracks events involving audio tracks are always sent to the audiotracklist specified in htmlmediaelement.audiotracks events affecting text tracks are sent to the texttracklist object indicated by htmlmediaelement.texttracks.
... constructor trackevent() creates and initializes a new trackevent object with the event type specified, as well as optional additional properties.
...if not null, this is always an object of one of the media track types: audiotrack, videotrack, or texttrack).
...ventlistener("removetrack", handletrackevent, false); function handletrackevent(event) { var trackkind; if (event.target instanceof(videotracklist)) { trackkind = "video"; } else if (event.target instanceof(audiotracklist)) { trackkind = "audio"; } else if (event.target instanceof(texttracklist)) { trackkind = "text"; } else { trackkind = "unknown"; } switch(event.type) { case "addtrack": console.log("added a " + trackkind + " track"); break; case "removetrack": console.log("removed a " + trackkind + " track"); break; } } the event handler uses the javascript instanceof operator to determine which type of track the event occurred on, then outputs to console a message indicating what kind of track it is and whether it's being ...
ValidityState.patternMismatch - Web APIs
if the field supports the pattern attribute -- which means the <input> is of type text, tel, email, url, password, or search -- and the pattern value is set to a valid regular expression, if the value don't doesn't conform to the constraints set by the pattern value, the patternmismatch property will be true.
... examples given the following: <p> <label>enter your phone number in the format (123)456-7890 (<input name="tel1" type="tel" pattern="[0-9]{3}" placeholder="###" aria-label="3-digit area code" size="2"/>)- <input name="tel2" type="tel" pattern="[0-9]{3}" placeholder="###" aria-label="3-digit prefix" size="2"/> - <input name="tel3" type="tel" pattern="[0-9]{4}" placeholder="####" aria-label="4-digit number" size="3"/> </label> </p> here we have 3 sections for a north american phone number with an implicit label encompassing all three components of the phone number, expecting 3-digits, 3-digits and 4-digits respectively, as defined by the pattern attribute set on each.
... note: the email input type requires, at minimum, a match of x@y and the url type requires, at minimum, a match to x:, with no pattern attribute present.
... when invalid, the validitystate.typemismatch will be true, if there is no pattern attribute (or if the pattern attribute is not valid for that input type).
WebGL2RenderingContext.drawElementsInstanced() - Web APIs
syntax void gl.drawelementsinstanced(mode, count, type, offset, instancecount); parameters mode a glenum specifying the type primitive to render.
... type a glenum specifying the type of the values in the element array buffer.
...must be a valid multiple of the size of the given type.
... if offset is a valid multiple of the size of the given type, a gl.invalid_operation error is thrown.
WebGL2RenderingContext.drawRangeElements() - Web APIs
syntax void gl.drawrangeelements(mode, start, end, count, type, offset); parameters mode a glenum specifying the type primitive to render.
... type a glenum specifying the type of the values in the element array buffer.
...must be a valid multiple of the size of the given type.
... if offset is a valid multiple of the size of the given type, a gl.invalid_operation error is thrown.
WebGL2RenderingContext.vertexAttribIPointer() - Web APIs
syntax void gl.vertexattribipointer(index, size, type, stride, offset); parameters index a gluint specifying the index of the vertex attribute that is to be modified.
... type a glenum specifying the data type of each component in the array.
...must be a multiple of type.
...bone indices, interpreted as integer gl.vertexattribipointer(2, 4, gl.unsigned_byte, 20, 16); gl.enablevertexattribarray(2); //connect to attributes from the vertex shader gl.bindattriblocation(shaderprogram, 0, "position"); gl.bindattriblocation(shaderprogram, 1, "boneweights"); gl.bindattriblocation(shaderprogram, 2, "boneindices"); <script id="shader-vs" type="x-shader/x-vertex">#version 300 es uniform mat4 mvmatrix; uniform mat4 bones[120]; in vec3 position; in vec4 boneweights; in uvec4 boneindices;//read as 4-component unsigned integer void main() { vec4 skinnedposition = bones[boneindices.s] * vec4(position, 1.0) * boneweights.s + bones[boneindices.t] * vec4(position, 1.0) * boneweights.t + bones[boneindices.p] * vec...
WebGLRenderingContext.drawElements() - Web APIs
syntax void gl.drawelements(mode, count, type, offset); parameters mode a glenum specifying the type primitive to render.
... type a glenum specifying the type of the values in the element array buffer.
...must be a valid multiple of the size of the given type.
... if offset is not a valid multiple of the size of the given type, a gl.invalid_operation error is thrown.
WebGLRenderingContext.getParameter() - Web APIs
constant returned type description gl.active_texture glenum gl.aliased_line_width_range float32array (with 2 elements) gl.aliased_point_size_range float32array (with 2 elements) gl.alpha_bits glint gl.array_buffer_binding webglbuffer gl.blend glboolean gl.blend_color float32array (with 4 values) ...
... gl.green_bits glint gl.implementation_color_read_format glenum gl.implementation_color_read_type glenum gl.line_width glfloat gl.max_combined_texture_image_units glint gl.max_cube_map_texture_size glint gl.max_fragment_uniform_vectors glint gl.max_renderbuffer_size glint gl.max_texture_image_units glint gl.max_texture_size glint gl.max_varying_vectors glint ...
... constant returned type description gl.copy_read_buffer_binding webglbuffer or null see bindbuffer.
... webgl extensions you can query the following pname parameters when using webgl extensions: constant returned type extension description ext.max_texture_max_anisotropy_ext glfloat ext_texture_filter_anisotropic maximum available anisotropy.
WebGLRenderingContext.getShaderPrecisionFormat() - Web APIs
syntax webglshaderprecisionformat gl.getshaderprecisionformat(shadertype, precisiontype); parameters shadertype either a gl.fragment_shader or a gl.vertex_shader.
... precisiontype a precision type value.
... exceptions gl.invalid_enum if the shader or precision types aren't recognized.
... examples the following code gets the precision format of a gl.vertex_shader with a gl.medium_float precision type.
Simple color animation - Web APIs
ion </button> body { text-align : center; } canvas { display : block; width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : inline-block; font-size : inherit; margin : auto; padding : 0.6em; } window.addeventlistener("load", function setupanimation (evt) { "use strict" window.removeeventlistener(evt.type, setupanimation, false); // a variable to hold a timer that drives the animation.
... var button = document.queryselector("#animation-onoff"); var verb = document.queryselector("strong"); function startanimation(evt) { button.removeeventlistener(evt.type, startanimation, false); button.addeventlistener("click", stopanimation, false); verb.innerhtml="stop"; // setup animation loop by redrawing every second.
... drawanimation(); } function stopanimation(evt) { button.removeeventlistener(evt.type, stopanimation, false); button.addeventlistener("click", startanimation, false); verb.innerhtml="start"; // stop animation by clearing the timer.
... stopanimation({type: "click"}); var gl; function drawanimation () { if (!gl) { var canvas = document.getelementbyid("canvas-view"); gl = canvas.getcontext("webgl") ||canvas.getcontext("experimental-webgl"); if (!gl) { clearinterval(timer); alert("failed to get webgl context.\n" + "your browser or device may not support webgl."); return; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); } // get a random color value using a helper function.
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
let ignoreoffer = false; signaler.onmessage = async ({ data: { description, candidate }}) => { try { if (description) { const offercollision = (description.type == "offer") && (makingoffer || pc.signalingstate != "stable"); ignoreoffer = !polite && offercollision; if (ignoreoffer) { return; } await pc.setremotedescription(description); if (description.type =="offer") { await pc.setlocaldescription(); signaler.send(description: pc.localdescription) } } else if (...
...previously, triggering rollback involved manually checking for rollback conditions and triggering the rollback manually, by setting the local description to one with the type rollback, like this: await pc.setlocaldescription({ type: "rollback" }); doing so returns the local peer to the stable signalingstate from whichever state it had previously been in.
... perfect negotiation with the old api using the previous api to implement incoming negotiation messages during perfect negotiation would look something like this: signaler.onmessage = async({data: { description, candidate }}) => { try { if (description) { if (description.type == "offer" && pc.signalingstate != "stable") { if (!polite) { return; } await promise.all([ pc.setlocaldescription({type: "rollback"}), pc.setremotedescription(description); ]); } else { await pc.setremotedescription(description); } if (description.type == "offer") { await pc.setlocaldescription(awai...
... let ignoreoffer = false; signaler.onmessage = async ({ data: { description, candidate }}) => { try { if (description) { const offercollision = (description.type == "offer") && (makingoffer || pc.signalingstate != "stable"); ignoreoffer = !polite && offercollision; if (ignoreoffer) { return; } await pc.setremotedescription(description); if (description.type == "offer") { await pc.setlocaldescription(); signaler.send(description: pc.localdescription); } } else if...
WebSocket.send() - Web APIs
WebAPIWebSocketsend
it may be one of the following types: usvstring a text string.
... arraybuffer you can send the underlying binary data used by a typed array object; its binary data contents are queued in the buffer, increasing the value of bufferedamount by the requisite number of bytes.
... arraybufferview you can send any javascript typed array object as a binary frame; its binary data contents are queued in the buffer, increasing the value of bufferedamount by the requisite number of bytes.
... as of gecko 11.0, support for arraybuffer is implemented but not blob data types.
Writing WebSocket client applications - Web APIs
these strings are used to indicate sub-protocols, so that a single server can implement multiple websocket sub-protocols (for example, you might want one server to be able to handle different types of interactions depending on the specified protocol).
... var msg = { type: "message", text: document.getelementbyid("text").value, id: clientid, date: date.now() }; // send the msg object as a json-formatted string.
...there are assorted types of data packets the client might receive, such as: login handshake message text user list updates the code that interprets these incoming messages might look like this: examplesocket.onmessage = function(event) { var f = document.getelementbyid("chatbox").contentdocument; var text = ""; var msg = json.parse(event.data); var time = new date(msg.date); var timestr = time.tolocale...
...timestring(); switch(msg.type) { case "id": clientid = msg.id; setusername(); break; case "username": text = "<b>user <em>" + msg.name + "</em> signed in at " + timestr + "</b><br>"; break; case "message": text = "(" + timestr + ") <b>" + msg.name + "</b>: " + msg.text + "<br>"; break; case "rejectusername": text = "<b>your username has been set to <em>" + msg.name + "</em> because the name you chose is in use.</b><br>" break; case "userlist": var ul = ""; for (i=0; i < msg.users.length; i++) { ul += msg.users[i] + "<br>"; } document.getelementbyid("userlistbox").innerhtml = ul; break; } if (text.length) { f.write(text); document.getelementbyid("chatbox").contentwindo...
Using the Web Audio API - Web APIs
lucky for us there's a method that allows us to do just that — audiocontext.createmediaelementsource: // get the audio element const audioelement = document.queryselector('audio'); // pass it into the audio context const track = audiocontext.createmediaelementsource(audioelement); note: the <audio> element above is represented in the dom by an object of type htmlmediaelement, which comes with its own set of functionality.
... let's give the user control to do this — we'll use a range input: <input type="range" id="volume" min="0" max="2" value="1" step="0.01"> note: range inputs are a really handy input type for updating values on audio nodes.
...gainnode.gain) are not simple values; they are actually objects of type audioparam — these called parameters.
...again let's use a range type input to vary this parameter: <input type="range" id="panner" min="-1" max="1" value="0" step="0.01"> we use the values from that input to adjust our panner values in the same way as we did before: const pannercontrol = document.queryselector('#panner'); pannercontrol.addeventlistener('input', function() { panner.pan.value = this.value; }, false); let's adjust our audio graph again, to...
Web Audio API - Web APIs
several sources — with different types of channel layout — are supported even within a single context.
... audioscheduledsourcenode the audioscheduledsourcenode is a parent interface for several types of audio source node interfaces.
... mediastreamtrackaudiosourcenode a node of type mediastreamtrackaudiosourcenode represents an audio source whose data comes from a mediastreamtrack.
... iirfilternode implements a general infinite impulse response (iir) filter; this type of filter can be used to implement tone control devices and graphic equalizers as well.
The structured clone algorithm - Web APIs
the prototype chain is not walked or duplicated.
... note: native error types can be cloned in chrome, and firefox is working on it.
... supported types object type notes all primitive types however, not symbols.
... blob file filelist arraybuffer arraybufferview including other typed arrays.
Window.captureEvents() - Web APIs
the window.captureevents() method registers the window to capture all events of the specified type.
... syntax window.captureevents(eventtype) eventtype is a combination of the following values: event.abort, event.blur, event.click, event.change, event.dblclick, event.dragddrop, event.error, event.focus, event.keydown, event.keypress, event.keyup, event.load, event.mousedown, event.mousemove, event.mouseout, event.mouseover, event.mouseup, event.move, event.reset, event.resize, event.select, event.submit, event.unload.
... example <!doctype html> <html lang="en"> <head> <!-- ...
... when you call the captureevents() method on the window, events of the type you specify (for example, event.click) no longer pass through to "lower" objects in the hierarchy.
Window - Web APIs
WebAPIWindow
for overriding the prototype of built-in elements) are listed in a separate section below.
... methods implemented from elsewhere eventtarget.addeventlistener() register an event handler to a specific event type on the window.
... window.captureevents() registers the window to capture all events of the specified type.
... window.releaseevents() releases the window from trapping events of a specific type.
WindowOrWorkerGlobalScope.fetch() - Web APIs
typeerror the specified url string includes user credentials.
...since we are fetching an image, we run body.blob() on the response to give it the proper mime type so it will be handled properly, then create an object url of it and display it in an <img> element.
... return response.blob(); }) .then(function(response) { let objecturl = url.createobjecturl(response); myimage.src = objecturl; }); in the fetch with init then request example (see fetch request init live), we do the same thing except that we pass in an init object when we invoke fetch(): const myimage = document.queryselector('img'); let myheaders = new headers(); myheaders.append('content-type', 'image/jpeg'); const myinit = { method: 'get', headers: myheaders, mode: 'cors', cache: 'default' }; let myrequest = new request('flowers.jpg'); fetch(myrequest, myinit).then(function(response) { // ...
... const myinit = { method: 'get', headers: { 'content-type': 'image/jpeg' }, mode: 'cors', cache: 'default' }; let myrequest = new request('flowers.jpg', myinit); specifications specification status comment fetchthe definition of 'fetch()' in that specification.
Worker() - Web APIs
WebAPIWorkerWorker
available properties are as follows: type: a domstring specifying the type of worker to create.
... credentials: a domstring specifying the type of credentials to use for the worker.
...if not specified, or if type is classic, the default used is omit (no credentials required).
... a networkerror is raised if the mime type of the worker script is incorrect.
Synchronous and asynchronous requests - Web APIs
*/) { var xhr = new xmlhttprequest(); xhr.callback = callback; xhr.arguments = array.prototype.slice.call(arguments, 2); xhr.onload = xhrsuccess; xhr.onerror = xhrerror; xhr.open("get", url, true); xhr.send(null); } usage: function showmessage(message) { console.log(message + this.responsetext); } loadfile("message.txt", showmessage, "new message!\n\n"); the signature of the utility function loadfile declares (i) a target url to read (via an http get request), (ii...
...this is done by setting the value of the timeout property on the xmlhttprequest object, as shown in the code below: function loadfile(url, timeout, callback) { var args = array.prototype.slice.call(arguments, 3); var xhr = new xmlhttprequest(); xhr.ontimeout = function () { console.error("the request for " + url + " timed out."); }; xhr.onload = function() { if (xhr.readystate === 4) { if (xhr.status === 200) { callback.apply(xhr, args); } else { console.error(xhr.statustext); } ...
... example.html (the main page): <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>mdn example</title> <script type="text/javascript"> var worker = new worker("mytask.js"); worker.onmessage = function(event) { alert("worker said: " + event.data); }; worker.postmessage("hello"); </script> </head> <body></body> </html> myfile.txt (the target of the synchronous xmlhttpre...
...:( client.setrequestheader("content-type", "text/plain;charset=utf-8"); client.send(analyticsdata); } using the sendbeacon() method, the data will be transmitted asynchronously to the web server when the user agent has had an opportunity to do so, without delaying the unload or affecting the performance of the next navigation.
XMLHttpRequest.sendAsBinary() - Web APIs
this method makes it possible to read and upload any type of file and to stringify the raw data.
... polyfill since sendasbinary() is an experimental feature, here is a polyfill for browsers that don't support the sendasbinary() method but support typed arrays.
... /*\ |*| |*| :: xmlhttprequest.prototype.sendasbinary() polyfill :: |*| |*| https://developer.mozilla.org/docs/dom/xmlhttprequest#sendasbinary() |*| \*/ if (!xmlhttprequest.prototype.sendasbinary) { xmlhttprequest.prototype.sendasbinary = function (sdata) { var nbytes = sdata.length, ui8data = new uint8array(nbytes); for (var nidx = 0; nidx < nbytes; nidx++) { ui8data[nidx] = sdata.charcodeat(nidx) & 0xff; } /* send as arraybufferview...: */ this.send(ui8data); /* ...or as arraybuffer (legacy)...: this.send(ui8data.buffer); */ }; } note: it's possible to build this polyfill putting two types of data as argument for send(): an arraybuffer (ui8data.buffer – the commented code) or an arraybufferview (ui8data, which is a typed array of 8-bit unsigned intege...
...another possible approach to send binary data is the stringview non native typed arrays superclass in conjunction with the send() method.
XRInputSourceEvent() - Web APIs
syntax newinputsourceevent = new xrinputsourceevent(type, eventinitdict); parameters type a domstring indicating which of the input source events the new object will represent.
... permitted values are listed under event types below.
... return value a new xrinputsourceevent object representing the event described by the given type and eventinitdict.
... event types select sent to an xrsession when the sending input source has fully completed a primary action.
XRSessionEvent() - Web APIs
syntax newxrsessionevent = new xrsessionevent(type, eventinitdict); parameters type a domstring indicating which of the events represented by objects of type xrsessionevent this particular object represents.
... see event types for a list of the permitted values.
... return value a newly-created xrsessionevent object representing an object of the specfied type and configured as described by the eventinitdict parameter.
... event types the following events are represented using the xrsessionevent interface, and are permitted values for its type property.
XRSessionInit - Web APIs
at this time, all features are identified using strings from the xrreferencespacetype enumeration, but future updates to the webxr standard may add more features.
...these values currently must come from the enumerated type xrreferencespacetype.
... security requirements each reference space or feature type has minimum safety requirements.
... by session type, those are: reference space type user consent rquirement feature policy requirement bounded-floor always required xr-spatial-tracking local always required for inline sessions xr-spatial-tracking local-floor always required xr-spatial-tracking unbounded always required xr-spatial-tracking viewer always required — ...
XSL Transformations in Mozilla FAQ - Web APIs
make sure the mime type for both source and stylesheet are set to an xml mimetype, namely text/xml or application/xml.
...the most common cause is the mime type handling.
... to find out which mime type your server sends, look at page info, use extensions like livehttpheaders or a download manager like wget.
... note: starting in gecko 7.0, both text/xsl and application/xslt+xml are supported mime types for xslt media stylesheets.
ARIA Test Cases - Accessibility
widget test cases alert simple alert complex alert real alert example with aria-required and aria-invalid -- type in a email address without an at sign to test the alert expected at behavior: a screen reader or screen magnifier must speak an alert when it becomes visible.
... n/a - fail window-eyes - - - - nvda - n/a - - zoom (leopard) pass n/a pass pass zoom (leopard) pass n/a pass pass zoomtext fail- announced as 'alert' pass - - orca - - - - button basic button button with description dojo nightly build -- lots of other types of buttons there as well.
... - - orca - - - - checkbox simple checkbox testcases: set aria-checked="false" for unchecked both remove or set attribute for unchecked case -- also includes an invalid and required checkbox hierarchical (newly added test not in test results yet) dojo nightly build expected at behavior: screen reader should speak the accessible name followed by both the type being checkbox and the state (checked, unchecked).
... optional: for each character typed, screen readers may choose to indicate how many options are remaining in the autocomplete list (if that number has changed).
Web accessibility for seizures and physical reactions - Accessibility
in the case of photosensitive epilepsy, seizures are triggered specifically by flashing lights, but other types of reflex epilepsies may be triggered by the act of reading, or by noises.
...only a few types of epilepsies are photosensitive though, and the vast majority of epilepsies are not." in addition to seizures brought about by photosensitivity, listening to certain pieces of music can also trigger what are called musicogenic seizures, although these types of seizures seem to be much more rare.
...for example, the page for trace research & development center’s photosensitive epilepsy analysis tool notes that “photosensitive seizures can be provoked by certain types of flashing in web or computer content, including mouse-overs that cause large areas of the screen to rapidly flash on and off repeatedly.” other physical reactions nausea, vertigo (or dizziness), and disorientation are very nonspecific symptoms associated with all kinds of diseases and not particularly suggestive of seizures (except maybe disorientation, which is seen in seizures).
...because of this condition, their brain will produce seizure-like discharges when exposed to this type of visual stimulation gamma oscillations and photosensitive epilepsy current biology volume 27, issue 9, 8 may 2017, pages r336-r338 certain visual images, even in the absence of motion or flicker, can trigger seizures in patients with photosensitive epilepsy.
:checked - CSS: Cascading Style Sheets
WebCSS:checked
the :checked css pseudo-class selector represents any radio (<input type="radio">), checkbox (<input type="checkbox">), or option (<option> in a <select>) element that is checked or toggled to an on state.
... syntax :checked examples basic example html <div> <input type="radio" name="my-input" id="yes"> <label for="yes">yes</label> <input type="radio" name="my-input" id="no"> <label for="no">no</label> </div> <div> <input type="checkbox" name="my-checkbox" id="opt-in"> <label for="opt-in">check me!</label> </div> <select name="my-select" id="fruit"> <option value="opt1">apples</option> <option value="opt2">grapes</option> <option value="opt3">...
...pears</option> </select> css div, select { margin: 8px; } /* labels for checked inputs */ input:checked + label { color: red; } /* radio element, when checked */ input[type="radio"]:checked { box-shadow: 0 0 0 3px orange; } /* checkbox element, when checked */ input[type="checkbox"]:checked { box-shadow: 0 0 0 3px hotpink; } /* option elements, when selected */ option:checked { box-shadow: 0 0 0 3px lime; color: red; } result toggling elements with a hidden checkbox this example utilizes the :checked pseudo-class to let the user toggle content based on the state of a checkbox, all without using javascript.
... html <input type="checkbox" id="expand-toggle" /> <table> <thead> <tr><th>column #1</th><th>column #2</th><th>column #3</th></tr> </thead> <tbody> <tr class="expandable"><td>[more text]</td><td>[more text]</td><td>[more text]</td></tr> <tr><td>[cell text]</td><td>[cell text]</td><td>[cell text]</td></tr> <tr><td>[cell text]</td><td>[cell text]</td><td>[cell text]</td></tr> <tr class="expandable"><td>[more text]</td><td>[more text]</td><td>[more text]</td></tr> <tr class="expandable"><td>[more text]</td><td>[more text]</td><td>[more text]</td></tr> </tbody> </table> <label for="expand-toggle" id="expand-btn">toggle hidden rows</label> css /* hide the toggle checkbox */ #expand-toggle { display: none; } /* hide expandable content by default */ .expandab...
:default - CSS: Cascading Style Sheets
WebCSS:default
what this selector matches is defined in html standard §4.16.3 pseudo-classes — it may match the <button>, <input type="checkbox">, <input type="radio">, and <option> elements: a default option element is the first one with the selected attribute, or the first enabled option in dom order.
... <input type="checkbox"> and <input type="radio"> match if they have the checked attribute.
...this also applies to <input> types that submit forms, like image or submit.
... syntax :default examples html <fieldset> <legend>favorite season</legend> <input type="radio" name="season" id="spring"> <label for="spring">spring</label> <input type="radio" name="season" id="summer" checked> <label for="summer">summer</label> <input type="radio" name="season" id="fall"> <label for="fall">fall</label> <input type="radio" name="season" id="winter"> <label for="winter">winter</label> </fieldset> css input:default { box-shadow: 0 0 2px 1px coral; } input:default + label { color: coral; } result specifications specification status comment html living standardthe definition of ':default' in that specification.
:is() (:matches(), :any()) - CSS: Cascading Style Sheets
WebCSS:is
<compound-selector> ]*where <compound-selector> = [ <type-selector>?
... <subclass-selector>* [ <pseudo-element-selector> <pseudo-class-selector>* ]* ]!<combinator> = '>' | '+' | '~' | [ '|' ]where <type-selector> = <wq-name> | <ns-prefix>?
...l ul dir, ul menu dir, ul dir dir, menu ol ul, menu ul ul, menu menu ul, menu dir ul, menu ol menu, menu ul menu, menu menu menu, menu dir menu, menu ol dir, menu ul dir, menu menu dir, menu dir dir, dir ol ul, dir ul ul, dir menu ul, dir dir ul, dir ol menu, dir ul menu, dir menu menu, dir dir menu, dir ol dir, dir ul dir, dir menu dir, dir dir dir { list-style-type: square; } ...
... can be replaced with: /* 3-deep (or more) unordered lists use a square */ :is(ol, ul, menu, dir) :is(ol, ul, menu, dir) ul, :is(ol, ul, menu, dir) :is(ol, ul, menu, dir) menu, :is(ol, ul, menu, dir) :is(ol, ul, menu, dir) dir { list-style-type: square; } simplifying section selectors the :is() pseudo-class is particularly useful when dealing with html5 sections and headings.
:nth-child() - CSS: Cascading Style Sheets
<compound-selector> ]*where <compound-selector> = [ <type-selector>?
... <subclass-selector>* [ <pseudo-element-selector> <pseudo-class-selector>* ]* ]!<combinator> = '>' | '+' | '~' | [ '|' ]where <type-selector> = <wq-name> | <ns-prefix>?
...3> <p>children 1, 5, and 7 are selected.<br> 3 is used in the counting because it is a child, but it isn't selected because it isn't a <code>&lt;span&gt;</code>.</p> <div class="second"> <span>span!</span> <span>span</span> <em>this is an `em`.</em> <span>span</span> <span>span!</span> <span>span</span> <span>span!</span> <span>span</span> </div> <br> <h3><code>span:nth-of-type(2n+1)</code>, with an <code>&lt;em&gt;</code> among the child elements.</h3> <p>children 1, 4, 6, and 8 are selected.<br> 3 isn't used in the counting or selected because it is an <code>&lt;em&gt;</code>, not a <code>&lt;span&gt;</code>, and <code>nth-of-type</code> only selects children of that type.
...pan!</span> <span>span</span> <em>this is an `em`.</em> <span>span!</span> <span>span</span> <span>span!</span> <span>span</span> <span>span!</span> </div> css html { font-family: sans-serif; } span, div em { padding: 5px; border: 1px solid green; display: inline-block; margin-bottom: 3px; } .first span:nth-child(2n+1), .second span:nth-child(2n+1), .third span:nth-of-type(2n+1) { background-color: lime; } result specifications specification status comment selectors level 4the definition of ':nth-child' in that specification.
font-variation-settings - CSS: Cascading Style Sheets
the font-variation-settings css descriptor allows authors to specify low-level opentype or truetype font variations in the @font-face rule.
... syntax /* use the default settings */ font-variation-settings: normal; /* set values for opentype axis names */ font-variation-settings: "xhgt" 0.7; values normal text is laid out using default settings.
... <string> <number> when rendering text, the list of opentype axis names is passed to the text layout engine to enable or disable font features.
... formal definition related at-rule@font-faceinitial valuenormalcomputed valueas specified formal syntax normal | [ <string> <number> ]# examples setting font weight and stretch in a @font-face rule @font-face { font-family: 'opentypefont'; src: url('open_type_font.woff2') format('woff2'); font-weight: normal; font-style: normal; font-variation-settings: 'wght' 400, 'wdth' 300; } specifications specification status comment css fonts module level 4the definition of 'font-variation-settings' in that specification.
@font-feature-values - CSS: Cascading Style Sheets
the @font-feature-values css at-rule lets you use a common name in the font-variant-alternates property for features activated differently in opentype.
...a stylset feature value definition allows an unlimited number of values: ident1: 2 4 12 1 maps to the opentype values ss02, ss04, ss12, and ss01.
... note that values higher than 99 are valid, but don't map to any opentype values and are ignored.
... formal syntax @font-feature-values <family-name># { <feature-value-block-list> }where <family-name> = <string> | <custom-ident>+<feature-value-block-list> = <feature-value-block>+where <feature-value-block> = <feature-type> '{' <feature-value-declaration-list> '}'where <feature-type> = @stylistic | @historical-forms | @styleset | @character-variant | @swash | @ornaments | @annotation<feature-value-declaration-list> = <feature-value-declaration>where <feature-value-declaration> = <custom-ident>: <integer>+; examples using @styleset in a @font-feature-values rule /* at-rule for "nice-style" in font one */ @font-fe...
@import - CSS: Cascading Style Sheets
WebCSS@import
description imported rules must precede all other types of rules, except @charset rules; as it is not a nested statement, @import cannot be used inside conditional group at-rules.
... so that user agents can avoid retrieving resources for unsupported media types, authors may specify media-dependent @import rules.
...<media-type> [ and <media-condition-without-or> ]?where <media-condition> = <media-not> | <media-and> | <media-or> | <media-in-parens><media-type> = <ident><media-condition-without-or> = <media-not> | <media-and> | <media-in-parens>where <media-not> = not <media-in-parens><media-and> = <media-in-parens> [ and <media-in-parens> ]+<media-or> = <media-in-parens> [ or <media-in-parens> ]+<media-in-parens> = ( <media-condition> ) | <media-fea...
... recommendation extended the syntax to support any media query and not only simple media types.
aural - CSS: Cascading Style Sheets
WebCSS@mediaaural
the aural css media type is used for devices that have speech output capabilities.
... note: this media type has been deprecated in favor of speech.
... syntax the aural css media type—which has been deprecated in favor of the speech media type—was used to specify a block of css that applied only when the content is being presented using a speech synthesis device.
... @media aural { /* speech-specific styles here */ } updating existing css to use the speech media type should be as simple as replacing aural with speech.
CSS Fonts - CSS: Cascading Style Sheets
WebCSSCSS Fonts
opentype font features guide font features or variants refer to different glyphs or character styles contained within an opentype font.
...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, or style.
Basic concepts of CSS Scroll Snap - CSS: Cascading Style Sheets
this can be helpful in creating a more app-like experience on mobile or even on the desktop for some types of applications.
... basics of scroll snap the key properties of the scroll snap specification are scroll-snap-type and scroll-snap-align.
... the scroll-snap-type property is used on the scroll container to state the type and direction of scrolling.
... using scroll-snap-type the scroll-snap-type property needs to know the direction in which scroll snapping happens.
<color> - CSS: Cascading Style Sheets
the <color> css data type represents a color in the srgb color space.
... a <color> can be defined in any of the following ways: using a keyword (such as blue or transparent) using the rgb cubic-coordinate system (via the #-hexadecimal or the rgb() and rgba() functional notations) using the hsl cylindrical-coordinate system (via the hsl() and hsla() functional notations) note: this article describes the <color> data type in detail.
... syntax the <color> data type is specified using one of the options listed below.
... html <div></div> <hr> <label for="color">enter a valid color value:</label> <input type="text" id="color"> css div { width: 100%; height: 200px; } javascript const inputelem = document.queryselector('input'); const divelem = document.queryselector('div'); function validtextcolor(stringtotest) { if (stringtotest === "") { return false; } if (stringtotest === "inherit") { return false; } if (stringtotest === "transparent") { return false; } const image = document.cr...
content - CSS: Cascading Style Sheets
WebCSScontent
<image> an <image>, denoted by the <url> or <gradient> data type, or part of the webpage, defined by the element() function, denoting the content to display.
...otherwise, for uri values, the absolute uri; for attr() values, the resulting string; for other keywords, as specified.animation typediscrete formal syntax normal | none | [ <content-replacement> | <content-list> ] [/ <string> ]?where <content-replacement> = <image><content-list> = [ <string> | contents | <image> | <quote> | <target> | <leader()> ]+where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient><quote> = open-quote | close-quote | no-open-quote | no-close-quote<target>...
... = <target-counter()> | <target-counters()> | <target-text()><leader()> = leader( <leader-type> )where <image()> = image( <image-tags>?
...)<leader-type> = dotted | solid | space | <string>where <image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>?
cursor - CSS: Cascading Style Sheets
WebCSScursor
the cursor css property sets the type of mouse cursor, if any, to show when the mouse pointer is over an element.
...more than one <url> may be provided as fallbacks, in case some cursor image types are not supported.
... formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specified, but with <url> values made absoluteanimation typediscrete formal syntax [ [ <url> [ <x> <y> ]?
...lt | none | context-menu | help | pointer | progress | wait | cell | crosshair | text | vertical-text | alias | copy | move | no-drop | not-allowed | e-resize | n-resize | ne-resize | nw-resize | s-resize | se-resize | sw-resize | w-resize | ew-resize | ns-resize | nesw-resize | nwse-resize | col-resize | row-resize | all-scroll | zoom-in | zoom-out | grab | grabbing ] ] examples setting cursor types .foo { cursor: crosshair; } .bar { cursor: zoom-in; } /* a fallback keyword value is required when using a url */ .baz { cursor: url("hyper.cur"), auto; } specifications specification status comment css basic user interface module level 3the definition of 'cursor' in that specification.
<easing-function> - CSS: Cascading Style Sheets
the <easing-function> css data type denotes a mathematical function that describes how fast one-dimensional values change during animations.
... syntax there are three types of easing function: linear, cubic bézier curves, and staircase functions.
... the value of an <easing-function> type describes the easing function using one of those three types.
...*/ cubic-bezier(0, 1.1, 0.8, 4) these cubic bézier curves definitions are invalid: /* though the animated output type may be a color, bézier curves work w/ numerical ratios.*/ cubic-bezier(0.1, red, 1.0, green) /* abscissas must be in the [0, 1] range or the curve is not a function of time.
<filter-function> - CSS: Cascading Style Sheets
the <filter-function> css data type represents a graphical effect that can change the appearance of an input image.
... syntax the <filter-function> data type is specified using one of the filter functions listed below.
... examples filter function comparison this example provides a simple graphic, along with a select menu to allow you to choose between the different types of filter function, and a slider to allow you to vary the values used inside the filter function.
... <select id="filter-select"> <option selected>blur</option> <option>brightness</option> <option>contrast</option> <option>drop-shadow</option> <option>grayscale</option> <option>hue-rotate</option> <option>invert</option> <option>opacity</option> <option>saturate</option> <option>sepia</option> </select> </li> <li> <input type="range"><output></output> </li> <li> <p>current value: <code></code></p> </li> </ul> css div { width: 300px; height: 300px; background: url(https://media.prod.mdn.mozit.cloud/attachments/2020/07/29/17350/3b4892b7e820122ac6dd7678891d4507/firefox.png) no-repeat center; } li { display: flex; align-items: center; justify-content: center; margin-bottom: 20px; } input { wi...
font-family - CSS: Cascading Style Sheets
lucida bright, lucida fax, palatino, "palatino linotype", palladio, "urw palladio", serif.
... cursive glyphs in cursive fonts generally have either joining strokes or other cursive characteristics beyond those of italic typefaces.
...because typographic traditions vary widely across the world, this generic is provided for typefaces that don't map cleanly into the other generics.
...it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax [ <family-name> | <generic-family> ]#where <family-name> = <string> | <custom-ident>+<generic-family> = serif | sans-serif | cursive | fantasy | monospace examples some common font families .serif { font-family: times, times new roman, georgia, serif; } .sansserif { font-family: verdana, arial, helvetica, sans-serif; } .monospace { font-family: lucida console, c...
font-weight - CSS: Cascading Style Sheets
older lighter 100 400 100 200 400 100 300 400 100 400 700 100 500 700 100 600 900 400 700 900 400 800 900 700 900 900 700 common weight name mapping the numerical values 100 to 900 roughly correspond to the following common weight names (see the opentype specification): value common weight name 100 thin (hairline) 200 extra light (ultra light) 300 light 400 normal (regular) 500 medium 600 semi bold (demi bold) 700 bold 800 extra bold (ultra bold) 900 black (heavy) 950 extra black (ultra black) variable fo...
... for truetype or opentype variable fonts, the "wght" variation is used to implement varying widths.
... html <header> <input type="range" id="weight" name="weight" min="1" max="1000" /> <label for="weight">weight</label> </header> <div class="container"> <p class="sample">...it would not be wonderful to meet a megalosaurus, forty feet long or so, waddling like an elephantine lizard up holborn hill.</p> </div> css /* mutator sans is created by letterror (https://github.com/letterror/mutatorsans) and is used here under the terms of its license: https://github.com/letterror/mutatorsans/blob/master/license */ @font-face { src: url('https://mdn.mozillademos.org/files/16011/mutatorsans.ttf'); font-family:'mutatorsans'; f...
...it also applies to ::first-letter and ::first-line.inheritedyescomputed valuethe keyword or the numerical value as specified, with bolder and lighter transformed to the real valueanimation typea font weight formal syntax <font-weight-absolute> | bolder | lighterwhere <font-weight-absolute> = normal | bold | <number <a href="/docs/css/value_definition_syntax#brackets" title="brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[1,1000]> examples setting font weights html <p> alice was beginning to get very tired of sitting by h...
<frequency> - CSS: Cascading Style Sheets
WebCSSfrequency
the <frequency> css data type represents a frequency dimension, such as the pitch of a speaking voice.
... syntax the <frequency> data type consists of a <number> followed by one of the units listed below.
... note: this data type was initially introduced in css level 2 for the now-obsolete aural media type, where it was used to define the pitch of the voice.
... however, the <frequency> data type has been reintroduced in css3, though no css property is using it at the moment.
<image> - CSS: Cascading Style Sheets
WebCSSimage
the <image> css data type represents a two-dimensional image.
... syntax the <image> data type can be represented with any of the following: an image denoted by the <url> data type a <gradient> data type a part of the webpage, defined by the element() function an image, image fragment or solid patch of color, defined by the image() function a blending of two or more images defined by the cross-fade() function.
... note: not all browsers support every type of image on every property.
...before this, there was no explicitly defined <image> data type.
ime-mode - CSS: Cascading Style Sheets
WebCSSime-mode
description unlike internet explorer, firefox's implementation of ime-mode allows this property on <input type="password">.
...users may correct the inappropriate behavior of sites that don't follow this recommendation by placing the following css into their user stylesheet: input[type=password] { ime-mode: auto !important; } the mac version of gecko 1.9 (firefox 3) can't recover the previous state of the ime when a field for which it is disabled loses focus, so mac users may get grumpy when you use the disabled value.
... formal definition initial valueautoapplies totext fieldsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | normal | active | inactive | disabled examples disabling input method support this example disables input method support for a form field.
... <input type="text" name="name" value="initial value" style="ime-mode: disabled"> note: you shouldn't rely on disabling ime to prevent extended characters from passing through your form.
<length> - CSS: Cascading Style Sheets
WebCSSlength
the <length> css data type represents a distance value.
... syntax the <length> data type consists of a <number> followed by one of the units listed below.
... interpolation when animated, values of the <length> data type are interpolated as real, floating-point numbers.
... html <div class="outer"> <div class="input-container"> <label>enter width:</label> <input type="text" id="length"> </div> <div class="inner"> </div> </div> <div class="results"> </div> css html { font-family: sans-serif; font-weight: bold; box-sizing: border-box; } .outer { width: 100%; height: 50px; background-color: #eee; position: relative; } .inner { height: 50px; background-color: #999; box-shadow: inset 3px 3px 5px rgba(255,255,255,0.5), i...
<shape> - CSS: Cascading Style Sheets
WebCSSshape
the <shape> css data type defines the specific form (shape) of a region.
...when possible, use clip-path and the <basic-shape> data type instead.
... syntax the <shape> data type is specified using the rect() function, which produces a region in the form of a rectangle.
... interpolation when animated, values of the <shape> data type are interpolated over their top, right, bottom, and left components, each treated as a real, floating-point number.
<url> - CSS: Cascading Style Sheets
WebCSSurl
the <url> css data type denotes a pointer to a resource, such as an image or a font.
...a url is a type of uri, and describes the location of a resource.
...confusingly, this meant that url() could be used to create a <uri> css data type.
... syntax the <url> data type is specified using the url() functional notation.
Event developer guide - Developer guides
WebGuideEvents
events refers both to a design pattern used for the asynchronous handling of various incidents which occur in the lifetime of a web page and to the naming, characterization, and use of a large number of incidents of different types.
... the overview page provides an introduction to the design pattern and a summary of the types of incidents which are defined and reacted to by modern web browsers.
... the custom events page describes how the event code design pattern can be used in custom code to define new event types emitted by user objects, register listener functions to handle those events, and trigger the events in user code.
...the different types of user interaction-driven events include: the original 'click' event, mouse events, mouse gesture events, and both touch events and the earlier mozilla experimental touch events, now deprecated.
Making content editable - Developer guides
the preferences shown below using about:config: user_pref("capability.policy.policynames", "allowclipboard"); user_pref("capability.policy.allowclipboard.sites", "https://www.mozilla.org"); user_pref("capability.policy.allowclipboard.clipboard.cutcopy", "allaccess"); user_pref("capability.policy.allowclipboard.clipboard.paste", "allaccess"); example: a simple but complete rich text editor <!doctype html> <html> <head> <title>rich text editor</title> <script type="text/javascript"> var odoc, sdeftxt; function initdoc() { odoc = document.getelementbyid("textbox"); sdeftxt = odoc.innerhtml; if (document.compform.switchmode.checked) { setdocmode(true); } } function formatdoc(scmd, svalue) { if (validatemode()) { document.execcommand(scmd, false, svalue); odoc.focus(); } } function va...
...ontent.selectnodecontents(odoc.firstchild); odoc.innerhtml = ocontent.tostring(); } odoc.contenteditable = true; } odoc.focus(); } function printdoc() { if (!validatemode()) { return; } var oprntwin = window.open("","_blank","width=450,height=470,left=400,top=100,menubar=yes,toolbar=no,location=no,scrollbars=yes"); oprntwin.document.open(); oprntwin.document.write("<!doctype html><html><head><title>print<\/title><\/head><body onload=\"print();\">" + odoc.innerhtml + "<\/body><\/html>"); oprntwin.document.close(); } </script> <style type="text/css"> .intlink { cursor: pointer; } img.intlink { border: 0; } #toolbar1 select { font-size:10px; } #textbox { width: 540px; height: 200px; border: 1px #000000 solid; padding: 12px; overflow: scroll; } #textbox #sour...
...cetext { padding: 0; margin: 0; min-width: 498px; min-height: 200px; } #editmode label { cursor: pointer; } </style> </head> <body onload="initdoc();"> <form name="compform" method="post" action="sample.php" onsubmit="if(validatemode()){this.mydoc.value=odoc.innerhtml;return true;}return false;"> <input type="hidden" name="mydoc"> <div id="toolbar1"> <select onchange="formatdoc('formatblock',this[this.selectedindex].value);this.selectedindex=0;"> <option selected>- formatting -</option> <option value="h1">title 1 &lt;h1&gt;</option> <option value="h2">title 2 &lt;h2&gt;</option> <option value="h3">title 3 &lt;h3&gt;</option> <option value="h4">title 4 &lt;h4&gt;</option> <option value="h5">title 5 &lt;h5&gt;</option> <option value="h6">subtitle &lt;h6&gt;</option> <option value="p">par...
.../i1+3yitha7prkiphvbups+/fvrvv8/f///////////////////////////////////////////////yh5baeaab8alaaaaaawabyaaawn4ceozgmeakqubgsuspvbsyfjjvds6njlb0khr4akbcmfscgbqaocwjf5gwquvyksfbwze+awibv0ghfog2ewidchjwriqo9e2fx4xd5r+b0ddaenbxbhbhn2dgwdaqfjjyvhcqyrfgoidgiqjawtcqmriwwmfgicnvcaaamoak+blaortluyt7i5uiuhads=" /> </div> <div id="textbox" contenteditable="true"><p>lorem ipsum</p></div> <p id="editmode"><input type="checkbox" name="switchmode" id="switchbox" onchange="setdocmode(this.checked);" /> <label for="switchbox">show html</label></p> <p><input type="submit" value="send" /></p> </form> </body> </html> note: if you want to see how to standardize the creation and the insertion of your editor in your page, please see our more complete rich-text editor example.
Introduction to HTML5 - Developer guides
declaring that the document contains html5 mark-up with the html5 doctype the doctype for html5 is very simple.
... to indicate that your html content uses html5, simply use: <!doctype html> doing so will cause even browsers that don't presently support html5 to enter into standards mode, which means that they'll interpret the long-established parts of html in an html5-compliant way while ignoring the new features of html5 they don't support.
... this is much simpler than the former doctypes, and shorter, making it easier to remember and reducing the amount of bytes that must be downloaded.
...this was done to tighten security and prevent some types of attacks.
The HTML autocomplete attribute - HTML: Hypertext Markup Language
autocomplete lets web developers specify what if any permission the user agent has to provide automated assistance in filling out form field values, as well as guidance to the browser as to the type of information expected in the field.
...no guidance is provided as to the type of data expected in the field, so the browser may use its own judgement.
... "cc-type" the type of payment instrument (such as "visa" or "master card").
...this works even when the autocomplete attribute would normally not apply by virtue of its type.
<a>: The Anchor element - HTML: Hypertext Markup Language
WebHTMLElementa
can be used with or without a value: without a value, the browser will suggest a filename/extension, generated from various sources: the content-disposition http header the final segment in the url path the media type (from the (content-type header, the start of a data: url, or blob.type for a blob: url) defining a value suggests it as the filename.
... rel the relationship of the linked url as space-separated link types.
... type hints at the linked url’s format with a mime type.
...use the http content-type header on the linked url.
<img>: The Image Embed element - HTML: Hypertext Markup Language
WebHTMLElementimg
abbreviation file format mime type file extension(s) browser compatibility apng animated portable network graphics image/apng .apng chrome, edge, firefox, opera, safari bmp bitmap file image/bmp .bmp chrome, edge, firefox, internet explorer, opera, safari gif graphics interchange format image/gif .gif chrome, edge, firefox, internet explorer, opera, safari ...
...there are a number of situations in which a browser might not display images, such as: non-visual browsers (such as those used by people with visual impairments) the user chooses not to display images (saving bandwidth, privacy reasons) the image is invalid or an unsupported type in these cases, the browser may replace the image with the text in the element's alt attribute.
... depending on its type, an image may have an intrinsic width and height.
... for some image types, however, intrinsic dimensions are unnecessary.
<label> - HTML: Hypertext Markup Language
WebHTMLElementlabel
<input type="checkbox" name="peas"> </label> other usage notes: the form control that the label is labeling is called the labeled control of the label element.
... examples simple label example <label>click me <input type="text"></label> using the "for" attribute <label for="username">click me</label> <input type="text" id="username"> accessibility concerns interactive content don't place interactive elements such as anchors or buttons inside a label.
... don't <label for="tac"> <input id="tac" type="checkbox" name="terms-and-conditions"> i agree to the <a href="terms-and-conditions.html">terms and conditions</a> </label> do <label for="tac"> <input id="tac" type="checkbox" name="terms-and-conditions"> i agree to the terms and conditions </label> <p> <a href="terms-and-conditions.html">read our terms and conditions</a> </p> headings placing heading elements within a <label> interferes with many kinds of assistive technology, because headings are commonly used as a navigation aid.
... don't <label for="your-name"> <h3>your name</h3> <input id="your-name" name="your-name" type="text"> </label> do <label class="large-label" for="your-name"> your name <input id="your-name" name="your-name" type="text"> </label> buttons an <input> element with a type="button" declaration and a valid value attribute does not need a label associated with it.
<li> - HTML: Hypertext Markup Language
WebHTMLElementli
type this character attribute indicates the numbering type: a: lowercase letters a: uppercase letters i: lowercase roman numerals i: uppercase roman numerals 1: numbers this type overrides the one used by its parent <ol> element, if any.
... note: this attribute has been deprecated; use the css list-style-type property instead.
... ordered list <ol> <li>first item</li> <li>second item</li> <li>third item</li> </ol> ordered list with a custom value <ol type="i"> <li value="3">third item</li> <li>fourth item</li> <li>fifth item</li> </ol> unordered list <ul> <li>first item</li> <li>second item</li> <li>third item</li> </ul> specifications specification status comment html living standardthe definition of '<li>' in that specification.
... recommendation the type attribute has been deprecated.
<picture>: The Picture element - HTML: Hypertext Markup Language
WebHTMLElementpicture
to decide which url to load, the user agent examines each <source>'s srcset, media, and type attributes to select a compatible image that best matches the current layout and capabilities of the display device.
... <picture> <source srcset="logo-768.png 768w, logo-768-1.5x.png 1.5x"> <source srcset="logo-480.png, logo-480-2x.png 2x"> <img src="logo-320.png" alt="logo"> </picture> the type attribute the type attribute specifies a mime type for the resource url(s) in the <source> element's srcset attribute.
... if the user agent does not support the given type, the <source> element is skipped.
... <picture> <source srcset="logo.webp" type="image/webp"> <img src="logo.png" alt="logo"> </picture> specifications specification status comment html living standardthe definition of '<picture>' in that specification.
HTTP authentication - HTTP
the syntax for these headers is the following: www-authenticate: <type> realm=<realm> proxy-authenticate: <type> realm=<realm> here, <type> is the authentication scheme ("basic" is the most common scheme and introduced below).
...here, the <type> is needed again followed by the credentials, which can be encoded or encrypted depending on which authentication scheme is used.
... authorization: <type> <credentials> proxy-authorization: <type> <credentials> authentication schemes the general http authentication framework is used by several authentication schemes.
... the .htaccess file typically looks like this: authtype basic authname "access to the staging site" authuserfile /path/to/.htpasswd require valid-user the .htaccess file references a .htpasswd file in which each line consists of a username and a password separated by a colon (:).
Browser detection using the user agent - HTTP
mobile, tablet or desktop the most common reason to perform user agent sniffing is to determine which type of device the browser runs on.
... the goal is to serve different html to different device types.
... never assume that a browser or a rendering engine only runs on one type of device.
...the os may run on more than one type of (for example, android runs on tablets as well as phones).
Accept-Language - HTTP
header type request header forbidden header name no cors-safelisted request header yes, with the additional restriction that values can only be 0-9, a-z, a-z, space or *,-.;=.
... syntax accept-language: <language> accept-language: * // multiple types, weighted with the quality value syntax: accept-language: fr-ch, fr;q=0.9, en;q=0.8, de;q=0.7, *;q=0.5 directives <language> a language tag (which is sometimes referred to as a "locale identifier").
...the most common extra information is the country or region variant (like 'en-us' or 'fr-ca') or the type of alphabet to use (like 'sr-latn').
... other variants like the type of orthography ('de-de-1996') are usually not used in the context of this header.
Clear-Site-Data - HTTP
header type response header forbidden header name no syntax the clear-site-data header accepts one or more directives.
... if all types of data should be cleared, the wildcard directive ("*") can be used.
... "*" (wildcard) indicates that the server wishes to clear all types of data for the origin of the response.
... if more data types are added in future versions of this header, they will also be covered by it.
Content-Encoding - HTTP
the content-encoding entity header is used to compress the media-type.
...it lets the client know how to decode in order to obtain the media-type referenced by the content-type header.
... the recommendation is to compress data as much as possible and therefore to use this field, but some types of resources, such as jpeg images, are already compressed.
... header type entity header forbidden header name no syntax content-encoding: gzip content-encoding: compress content-encoding: deflate content-encoding: identity content-encoding: br // multiple, in the order in which they were applied content-encoding: gzip, identity content-encoding: deflate, gzip directives gzip a format using the lempel-ziv coding (lz77), with a 32-bit crc.
CSP: style-src - HTTP
csp version 1 directive type fetch directive default-src fallback yes.
...sites needing to allow these content types can specify them using the data attribute.
... examples violation cases given this csp header: content-security-policy: style-src https://example.com/ the following stylesheets are blocked and won't load: <link href="https://not-example.com/styles/main.css" rel="stylesheet" type="text/css" /> <style> #inline-style { background: red; } </style> <style> @import url("https://not-example.com/styles/print.css") print; </style> as well as styles loaded using the link header: link: <https://not-example.com/styles/stylesheet.css>;rel=stylesheet inline style attributes are also blocked: <div style="display:none">foo</div> as well as styles that are applied in javascript...
...ttribute directly, or by setting csstext: document.queryselector('div').setattribute('style', 'display:none;'); document.queryselector('div').style.csstext = 'display:none;'; however, styles properties that are set directly on the element's style property will not be blocked, allowing users to safely manipulate styles via javascript: document.queryselector('div').style.display = 'none'; these types of manipulations can be prevented by disallowing javascript via the script-src csp directive.
OPTIONS - HTTP
WebHTTPMethodsOPTIONS
the access-control-request-headers header tells the server that when the actual request is sent, it will have the x-pingother and content-type headers.
... options /resources/post-here/ http/1.1 host: bar.example accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 accept-language: en-us,en;q=0.5 accept-encoding: gzip,deflate connection: keep-alive origin: https://foo.example access-control-request-method: post access-control-request-headers: x-pingother, content-type the server now can respond if it will accept a request under these circumstances.
...(this header is similar to the allow response header, but used only for cors.) access-control-allow-headers any script inspecting the response is permitted to read the values of the x-pingother and content-type headers.
... http/1.1 204 no content date: mon, 01 dec 2008 01:15:39 gmt server: apache/2.0.61 (unix) access-control-allow-origin: https://foo.example access-control-allow-methods: post, get, options access-control-allow-headers: x-pingother, content-type access-control-max-age: 86400 vary: accept-encoding, origin keep-alive: timeout=2, max=100 connection: keep-alive specifications specification title rfc 7231, section 4.3.7: options hypertext transfer protocol (http/1.1): semantics and content ...
Closures - JavaScript
<p id="help">helpful notes will appear here</p> <p>e-mail: <input type="text" id="email" name="email"></p> <p>name: <input type="text" id="name" name="name"></p> <p>age: <input type="text" id="age" name="age"></p> function showhelp(help) { document.getelementbyid('help').innerhtml = help; } function setuphelp() { var helptext = [ {'id': 'email', 'help': 'your e-mail address'}, {'id': 'name', 'help': 'your full name'}, {'id': 'age', 'help': '...
... for instance, when creating a new object/class, methods should normally be associated to the object's prototype rather than defined into the object constructor.
...tion() { return this.name; }; this.getmessage = function() { return this.message; }; } because the previous code does not take advantage of the benefits of using closures in this particular instance, we could instead rewrite it to avoid using closure as follows: function myobject(name, message) { this.name = name.tostring(); this.message = message.tostring(); } myobject.prototype = { getname: function() { return this.name; }, getmessage: function() { return this.message; } }; however, redefining the prototype is not recommended.
... the following example instead appends to the existing prototype: function myobject(name, message) { this.name = name.tostring(); this.message = message.tostring(); } myobject.prototype.getname = function() { return this.name; }; myobject.prototype.getmessage = function() { return this.message; }; in the two previous examples, the inherited prototype can be shared by all objects and the method definitions need not occur at every object creation.
Functions - JavaScript
console.log(square(5)) // uncaught typeerror: square is not a function const square = function(n) { return n * n; } the arguments of a function are not limited to strings and numbers.
... var createpet = function(name) { var sex; return { setname: function(newname) { name = newname; }, getname: function() { return name; }, getsex: function() { return sex; }, setsex: function(newsex) { if(typeof newsex === 'string' && (newsex.tolowercase() === 'male' || newsex.tolowercase() === 'female')) { sex = newsex; } } } } var pet = createpet('vivie'); pet.getname(); // vivie pet.setname('oliver'); pet.setsex('male'); pet.getsex(); // male pet.getname(); // oliver in the code above, the name variable of the outer ...
...however, this is prevented by the second line in this example: function multiply(a, b) { b = typeof b !== 'undefined' ?
...note: coercion inside the isnan function has interesting rules; you may alternatively want to use number.isnan(), as defined in ecmascript 2015, or you can use typeof to determine if the value is not-a-number.
Iterators and generators - JavaScript
instead, they return a special type of iterator, called a generator.
...some built-in types, such as array or map, have a default iteration behavior, while other types (such as object) do not.
...this simply means that the object (or one of the objects up its prototype chain) must have a property with a symbol.iterator key.
...te many times it[symbol.iterator] = function* () { yield 2; yield 1; }; user-defined iterables you can make your own iterables like this: const myiterable = { *[symbol.iterator]() { yield 1; yield 2; yield 3; } } for (let value of myiterable) { console.log(value); } // 1 // 2 // 3 or [...myiterable]; // [1, 2, 3] built-in iterables string, array, typedarray, map and set are all built-in iterables, because their prototype objects all have a symbol.iterator method.
Assertions - JavaScript
types the following section is also duplicated on this cheatsheet.
... boundary-type assertions characters meaning ^ matches the beginning of input.
...this is a position where the previous and next character are of the same type: either both must be words, or both must be non-words, for example between two letters or between two spaces.
... examples general boundary-type overview example // using regex boundaries to fix buggy string.
JavaScript error reference - 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).
...operatorsyntaxerror: missing variable namesyntaxerror: missing } after function bodysyntaxerror: missing } after property listsyntaxerror: redeclaration of formal parameter "x"syntaxerror: return not in functionsyntaxerror: test for equality (==) mistyped as assignment (=)?syntaxerror: unterminated string literaltypeerror: "x" has no propertiestypeerror: "x" is (not) "y"typeerror: "x" is not a constructortypeerror: "x" is not a functiontypeerror: "x" is not a non-null objecttypeerror: "x" is read-onlytypeerror: 'x' is not iterabletypeerror: more arguments neededtypeerror: reduce of empty array with no initial valuetypeerror: x.prototype.y called ...
...on incompatible typetypeerror: can't access dead objecttypeerror: can't access property "x" of "y"typeerror: can't assign to property "x" on "y": not an objecttypeerror: can't define property "x": "obj" is not extensibletypeerror: can't delete non-configurable array elementtypeerror: can't redefine non-configurable property "x"typeerror: cannot use "in" operator to search for "x" in "y"typeerror: cyclic object valuetypeerror: invalid "instanceof" operand "x"typeerror: invalid array.prototype.sort argumenttypeerror: invalid argumentstypeerror: invalid assignment to const "x"typeerror: property "x" is non-configurable and can't be deletedtypeerror: setting getter-only property "x"typeerror: variable "x" redeclares argumenturierror: malformed uri sequencewarning: 08/09 is not a legal ecma-262 oct...
...al constantwarning: -file- is being assigned a //# sourcemappingurl, but already has onewarning: date.prototype.tolocaleformat is deprecatedwarning: javascript 1.6's for-each-in loops are deprecatedwarning: string.x is deprecated; use string.prototype.x insteadwarning: expression closures are deprecatedwarning: unreachable code after return statement ...
ArrayBuffer - JavaScript
it is an array of bytes, often referred to in other languages as a "byte array".you cannot directly manipulate the contents of an arraybuffer; instead, you create one of the typed array objects or a dataview object which represents the buffer in a specific format, and use that to read and write the contents of the buffer.
... static methods arraybuffer.isview(arg) returns true if arg is one of the arraybuffer views, such as typed array objects or a dataview.
... instance properties arraybuffer.prototype.bytelength the read-only size, in bytes, of the arraybuffer.
... instance methods arraybuffer.prototype.slice() returns a new arraybuffer whose contents are a copy of this arraybuffer's bytes from begin (inclusive) up to end (exclusive).
Atomics.notify() - JavaScript
syntax atomics.notify(typedarray, index, count) parameters typedarray a shared int32array.
... index the position in the typedarray to wake up on.
... exceptions throws a typeerror, if typedarray is not a int32array.
... throws a rangeerror, if index is out of bounds in the typedarray.
Atomics.store() - JavaScript
syntax atomics.store(typedarray, index, value) parameters typedarray an integer typed array.
... index the position in the typedarray to store a value in.
... exceptions throws a typeerror, if typedarray is not one of the allowed integer types.
... throws a rangeerror, if index is out of bounds in the typedarray.
Atomics.wait() - JavaScript
syntax atomics.wait(typedarray, index, value[, timeout]) parameters typedarray a shared int32array.
... index the position in the typedarray to wait on.
... exceptions throws a typeerror, if typedarray is not a shared int32array.
... throws a rangeerror, if index is out of bounds in the typedarray.
Boolean - JavaScript
instance methods boolean.prototype.tostring() returns a string of either true or false depending upon the value of the object.
... overrides the object.prototype.tostring() method.
... boolean.prototype.valueof() returns the primitive value of the boolean object.
... overrides the object.prototype.valueof() method.
Intl.Collator - JavaScript
instance methods intl.collator.prototype.compare getter function that compares two strings according to the sort order of this intl.collator object.
... intl.collator.prototype.resolvedoptions() returns a new object with properties reflecting the locale and collation options computed during initialization of the object.
... using locales the results provided by collator.prototype.compare() vary between languages.
...our application, make sure to specify that language (and possibly some fallback languages) using the locales argument: // in german, ä sorts with a console.log(new intl.collator('de').compare('ä', 'z')); // → a negative value // in swedish, ä sorts after z console.log(new intl.collator('sv').compare('ä', 'z')); // → a positive value using options the results provided by collator.prototype.compare() can be customized using the options argument: // in german, ä has a as the base letter console.log(new intl.collator('de', { sensitivity: 'base' }).compare('ä', 'a')); // → 0 // in swedish, ä and a are separate base letters console.log(new intl.collator('sv', { sensitivity: 'base' }).compare('ä', 'a')); // → a positive value specifications specification ec...
Intl.ListFormat - JavaScript
instance methods intl.listformat.prototype.format() returns a language-specific formatted string representing the elements of the list.
... intl.listformat.prototype.formattoparts() returns an array of objects representing the different components that can be used to format a list of values in a locale-aware fashion.
... const list = ['motorcycle', 'bus', 'car']; console.log(new intl.listformat('en-gb', { style: 'long', type: 'conjunction' }).format(list)); // > motorcycle, bus and car console.log(new intl.listformat('en-gb', { style: 'short', type: 'disjunction' }).format(list)); // > motorcycle, bus or car console.log(new intl.listformat('en-gb', { style: 'narrow', type: 'unit' }).format(list)); // > motorcycle bus car using formattoparts the following example shows how to create a list formatter returning formatted parts const list = ['motorcycle', 'bus', 'car']; console.log(new intl.listformat('en-gb', { style: 'long', type: 'conjunction' }).formattoparts(list)); // [ { "type": "ele...
...ment", "value": "motorcycle" }, // { "type": "literal", "value": ", " }, // { "type": "element", "value": "bus" }, // { "type": "literal", "value": ", and " }, // { "type": "element", "value": "car" } ]; specifications specification intl.listformatthe definition of 'listformat' in that specification.
Intl.RelativeTimeFormat - JavaScript
instance methods intl.relativetimeformat.prototype.format() formats a value and a unit according to the locale and formatting options of the given intl.relativetimeformat object.
... intl.relativetimeformat.prototype.formattoparts() returns an array of objects representing the relative time format in parts that can be used for custom locale-aware formatting.
... intl.relativetimeformat.prototype.resolvedoptions() returns a new object with properties reflecting the locale and formatting options computed during initialization of the object.
...rtf.formattoparts(-1, "day"); // > [{ type: "literal", value: "yesterday"}] rtf.formattoparts(100, "day"); // > [{ type: "literal", value: "in " }, // > { type: "integer", value: "100", unit: "day" }, // > { type: "literal", value: " days" }] specifications specification status comment ecmascript internationalization api (ecma-402)the definition of 'relativetimeformat' in that specification.
JSON.parse() - JavaScript
polyfill // from https://github.com/douglascrockford/json-js/blob/master/json2.js if (typeof json.parse !== "function") { var rx_one = /^[\],:{}\s]*$/; var rx_two = /\\(?:["\\\/bfnrt]|u[0-9a-fa-f]{4})/g; var rx_three = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[ee][+\-]?\d+)?/g; var rx_four = /(?:^|:|,)(?:\s*\[)+/g; var rx_dangerous = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; json.parse = f...
... var k; var v; var value = holder[key]; if (value && typeof value === "object") { for (k in value) { if (object.prototype.hasownproperty.call(value, k)) { v = walk(value, k); if (v !== undefined) { value[k] = v; } else { delete value[k]; } } ...
... return (typeof reviver === "function") ?
... json.parse('{"p": 5}', (key, value) => typeof value === 'number' ?
Math.ceil() - JavaScript
* * @param {string} type the type of adjustment.
... */ function decimaladjust(type, value, exp) { // if the exp is undefined or zero...
... if (typeof exp === 'undefined' || +exp === 0) { return math[type](value); } value = +value; exp = +exp; // if the value is not a number or the exp is not an integer...
... if (isnan(value) || !(typeof exp === 'number' && exp % 1 === 0)) { return nan; } // shift value = value.tostring().split('e'); value = math[type](+(value[0] + 'e' + (value[1] ?
Math.floor() - JavaScript
* * @param {string} type the type of adjustment.
... */ function decimaladjust(type, value, exp) { // if the exp is undefined or zero...
... if (typeof exp === 'undefined' || +exp === 0) { return math[type](value); } value = +value; exp = +exp; // if the value is not a number or the exp is not an integer...
... if (isnan(value) || !(typeof exp === 'number' && exp % 1 === 0)) { return nan; } // shift value = value.tostring().split('e'); value = math[type](+(value[0] + 'e' + (value[1] ?
Number.isNaN() - JavaScript
the number.isnan() method determines whether the passed value is nan and its type is number.
... return value true if the given value is nan and its type is number; otherwise, false.
...this also means that only values of the type number, that are also nan, return true.
... number.isnan = number.isnan || function isnan(input) { return typeof input === 'number' && input !== input; } examples using isnan number.isnan(nan); // true number.isnan(number.nan); // true number.isnan(0 / 0); // true // e.g.
Object.defineProperties() - JavaScript
data descriptors and accessor descriptors may optionally contain the following keys: 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.
...yfill assuming a pristine execution environment with all names and properties referring to their initial values, object.defineproperties is almost completely equivalent (note the comment in iscallable) to the following reimplementation in javascript: function defineproperties(obj, properties) { function converttodescriptor(desc) { function hasproperty(obj, prop) { return object.prototype.hasownproperty.call(obj, prop); } function iscallable(v) { // nb: modify as necessary if other values than functions are callable.
... return typeof v === 'function'; } if (typeof desc !== 'object' || desc === null) throw new typeerror('bad desc'); var d = {}; if (hasproperty(desc, 'enumerable')) d.enumerable = !!desc.enumerable; if (hasproperty(desc, 'configurable')) d.configurable = !!desc.configurable; if (hasproperty(desc, 'value')) d.value = desc.value; if (hasproperty(desc, 'writable')) d.writable = !!desc.writable; if (hasproperty(desc, 'get')) { var g = desc.get; if (!iscallable(g) && typeof g !== 'undefined') throw new typeerror('bad get'); d.get = g; } if (hasproperty(desc, 'set')) { var s = desc.set; if (!iscallable(s) && typeof s !== 'undefined') throw new typeerror('bad set'); d.set...
... = s; } if (('get' in d || 'set' in d) && ('value' in d || 'writable' in d)) throw new typeerror('identity-confused descriptor'); return d; } if (typeof obj !== 'object' || obj === null) throw new typeerror('bad obj'); properties = object(properties); var keys = object.keys(properties); var descs = []; for (var i = 0; i < keys.length; i++) descs.push([keys[i], converttodescriptor(properties[keys[i]])]); for (var i = 0; i < descs.length; i++) object.defineproperty(obj, descs[i][0], descs[i][1]); return obj; } examples using object.defineproperties var obj = {}; object.defineproperties(obj, { 'property1': { value: true, writable: true }, 'property2': { value: 'hello', writable: false } // etc.
Object.getOwnPropertyDescriptors() - JavaScript
further information about property descriptor types and their attributes can be found in 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.
... examples creating a shallow clone whereas the object.assign() method will only copy enumerable and own properties from a source object to a target object, you are able to use this method and object.create() for a shallow copy between two unknown objects: object.create( object.getprototypeof(obj), object.getownpropertydescriptors(obj) ); creating a subclass a typical way of creating a subclass is to define the subclass, set its prototype to an instance of the superclass, and then define properties on that instance.
...instead, you can use this code to set the prototype: function superclass() {} superclass.prototype = { // define your methods and properties here }; function subclass() {} subclass.prototype = object.create( superclass.prototype, { // define your methods and properties here } ); specifications specification ecmascript (ecma-262)the definition of 'object.getownpropertydescriptors' in that specification.
Object.getOwnPropertyNames() - JavaScript
in es5, if the argument to this method is not an object (a primitive), then it will cause a typeerror.
... object.getownpropertynames('foo'); // typeerror: "foo" is not an object (es5 code) object.getownpropertynames('foo'); // ["0", "1", "2", "length"] (es2015 code) examples using object.getownpropertynames() var arr = ['a', 'b', 'c']; console.log(object.getownpropertynames(arr).sort()); // .sort() is an array method.
...numerable property var my_obj = object.create({}, { getfoo: { value: function() { return this.foo; }, enumerable: false } }); my_obj.foo = 1; console.log(object.getownpropertynames(my_obj).sort()); // logs ["foo", "getfoo"] if you want only the enumerable properties, see object.keys() or use a for...in loop (note that this will also return enumerable properties found along the prototype chain for the object unless the latter is filtered with hasownproperty()).
... items on the prototype chain are not listed: function parentclass() {} parentclass.prototype.inheritedmethod = function() {}; function childclass() { this.prop = 5; this.method = function() {}; } childclass.prototype = new parentclass; childclass.prototype.prototypemethod = function() {}; console.log( object.getownpropertynames( new childclass() // ["prop", "method"] ) ); get non-enumerable properties only this uses the array.prototype.filter() function to remove the enumerable keys (obtained with object.keys()) from a list of all keys (obtained with object.getownpropertynames()) thus giving only the non-enumerable keys as output.
Object.keys() - JavaScript
polyfill to add compatible object.keys support in older environments that do not natively support it, copy the following snippet: // from /docs/web/javascript/reference/global_objects/object/keys if (!object.keys) { object.keys = (function() { 'use strict'; var hasownproperty = object.prototype.hasownproperty, hasdontenumbug = !({ tostring: null }).propertyisenumerable('tostring'), dontenums = [ 'tostring', 'tolocalestring', 'valueof', 'hasownproperty', 'isprototypeof', 'propertyisenumerable', 'constructor' ], dontenumslength = dontenums.length; return function(obj) { if (typ...
...eof obj !== 'function' && (typeof obj !== 'object' || obj === null)) { throw new typeerror('object.keys called on non-object'); } var result = [], prop, i; for (prop in obj) { if (hasownproperty.call(obj, prop)) { result.push(prop); } } if (hasdontenumbug) { for (i = 0; i < dontenumslength; i++) { if (hasownproperty.call(obj, dontenums[i])) { result.push(dontenums[i]); } } } return result; }; }()); } please note that the above code includes non-enumerable keys in ie7 (and maybe ie8), when passing in an object from a different window.
... non-object coercion in es5, if the argument to this method is not an object (a primitive), then it will cause a typeerror.
... // in es5 object.keys('foo'); // typeerror: "foo" is not an object // in es2015+ object.keys('foo'); // ["0", "1", "2"] specifications specification ecmascript (ecma-262)the definition of 'object.keys' in that specification.
Reflect.apply() - JavaScript
exceptions a typeerror, if the target is not callable.
... description in es5, you typically use the function.prototype.apply() method to call a function with a given this value and arguments provided as an array (or an array-like object).
... function.prototype.apply.call(math.floor, undefined, [1.75]); with reflect.apply() this becomes less verbose and easier to understand.
... examples using reflect.apply() reflect.apply(math.floor, undefined, [1.75]); // 1; reflect.apply(string.fromcharcode, undefined, [104, 101, 108, 108, 111]) // "hello" reflect.apply(regexp.prototype.exec, /ab/, ['confabulation']).index // 4 reflect.apply(''.charat, 'ponies', [3]) // "i" specifications specification ecmascript (ecma-262)the definition of 'reflect.apply' in that specification.
Reflect - JavaScript
see also function.prototype.apply().
...also provides the option to specify a different prototype.
... reflect.getprototypeof(target) same as object.getprototypeof().
... reflect.setprototypeof(target, prototype) a function that sets the prototype of an object.
Symbol.match - JavaScript
this function is called by the string.prototype.match() method.
...for example, the methods string.prototype.startswith(), string.prototype.endswith() and string.prototype.includes(), check if their first argument is a regular expression and will throw a typeerror if they are.
... property attributes of symbol.match writable no enumerable no configurable no examples disabling the isregexp check the following code will throw a typeerror: '/bar/'.startswith(/bar/); // throws typeerror, as /bar/ is a regular expression // and symbol.match is not modified.
...the methods startswith and endswith won't throw a typeerror as a consequence.
Symbol.toStringTag - JavaScript
it is accessed internally by the object.prototype.tostring() method.
... property attributes of symbol.tostringtag writable no enumerable no configurable no examples default tags object.prototype.tostring.call('foo'); // "[object string]" object.prototype.tostring.call([1, 2]); // "[object array]" object.prototype.tostring.call(3); // "[object number]" object.prototype.tostring.call(true); // "[object boolean]" object.prototype.tostring.call(undefined); // "[object undefined]" object.prototype.tostring.call(null); // "[object null]" // ...
... and more built-in tostringtag symbols object.prototype.tostring.call(new map()); // "[object map]" object.prototype.tostring.call(function* () {}); // "[object generatorfunction]" object.prototype.tostring.call(promise.resolve()); // "[object promise]" // ...
... and more custom classes default to object tag when creating your own class, javascript defaults to the "object" tag: class validatorclass {} object.prototype.tostring.call(new validatorclass()); // "[object object]" custom tag with tostringtag now, with the help of tostringtag, you are able to set your own custom tag: class validatorclass { get [symbol.tostringtag]() { return 'validator'; } } object.prototype.tostring.call(new validatorclass()); // "[object validator]" tostringtag available on all dom prototype objects due to a webidl spec change in mid-2020, browsers are adding a symbol.tostringtag property to all dom prototype objects.
WebAssembly.Table() constructor - JavaScript
the webassembly.table() constructor creates a new table object of the given size and element type.
... syntax new webassembly.table(tabledescriptor); parameters tabledescriptor an object that can contain the following members: element a string representing the type of value to be stored in the table.
... exceptions if tabledescriptor is not of type object, a typeerror is thrown.
...we then print out the table length and contents of the two indexes (retrieved via table.prototype.get() to show that the length is two and both elements are null.
WebAssembly.instantiate() - JavaScript
this function has two overloads: the primary overload takes the webassembly binary code, in the form of a typed array or arraybuffer, and performs both compilation and instantiation in one step.
... syntax primary overload — taking wasm binary code promise<resultobject> webassembly.instantiate(buffersource, importobject); parameters buffersource a typed array or arraybuffer containing the binary code of the .wasm module you want to compile.
... exceptions if either of the parameters are not of the correct type or structure, a typeerror is thrown.
... exceptions if either of the parameters are not of the correct type or structure, a typeerror is thrown.
WebAssembly.validate() - JavaScript
the webassembly.validate() function validates a given typed array of webassembly binary code, returning whether the bytes form a valid wasm module (true) or not (false).
... syntax webassembly.validate(buffersource); parameters buffersource a typed array or arraybuffer containing webassembly binary code to be validated.
... exceptions if buffersource is not a typed array or arraybuffer, a typeerror is thrown.
... examples using validate the following example (see the validate.html source code, and see it live too) fetches a .wasm module and converts it into a typed array.
Standard built-in objects - JavaScript
object function boolean symbol error objects error objects are a special type of fundamental object.
... they include the basic error type, as well as several specialized error types.
... error aggregateerror evalerror internalerror rangeerror referenceerror syntaxerror typeerror urierror numbers and dates these are the base objects representing numbers, dates, and mathematical calculations.
...this includes (typed) arrays and array-like constructs.
Strict equality (===) - JavaScript
unlike the equality operator, the strict equality operator always considers operands of different types to be different.
... if the operands are of different types, return false.
... the most notable difference between this operator and the equality (==) operator is that if the operands are of different types, the == operator attempts to convert them to the same type before comparing.
... examples comparing operands of the same type console.log("hello" === "hello"); // true console.log("hello" === "hola"); // false console.log(3 === 3); // true console.log(3 === 4); // false console.log(true === true); // true console.log(true === false); // false console.log(null === null); // true comparing operands of different types console.log("3" === 3); // false console.log(true === 1); // false console.log(null === undefined); // false comparing objects const object1 = { name: "hello" } const object2 = { name: "hello" } console.log(object1 === object2); // false console.log(object1 === object1); // true specifications specification ecmascript (ecma-262)the definition ...
in operator - JavaScript
the in operator returns true if the specified property is in the specified object or its prototype chain.
... object object to check if it (or its prototype chain) contains the property with specified name (prop).
... 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.
Expressions and operators - JavaScript
typeof the typeof operator determines the type of a given object.
... + the unary plus operator converts its operand to number type.
... - the unary negation operator converts its operand to number type and then negates it.
... equality operators the result of evaluating an equality operator is always of type boolean based on whether the comparison is true.
export - JavaScript
syntax there are two types of exports: named exports (zero or more exports per module) default exports (one per module) // exporting individual features export let name1, name2, …, namen; // also var, const export let name1 = …, name2 = …, …, namen; // also var, const export function functionname(){...} export class classname {...} // export list export { name1, name2, …, namen }; // renaming exports exp...
... description there are two different types of export, named and default.
...each type corresponds to one of the above syntax: named exports: // export features declared earlier export { myfunction, myvariable }; // export individual features (can export var, let, // const, function, class) export let myvariable = math.sqrt(2); export function myfunction() { ...
...foo, graph }; then in the top-level module included in your html page, we could have: import { cube, foo, graph } from './my-module.js'; graph.options = { color:'blue', thickness:'3px' }; graph.draw(); console.log(cube(3)); // 27 console.log(foo); // 4.555806215962888 it is important to note the following: you need to include this script in your html with a <script> element of type="module", so that it gets recognised as a module and dealt with appropriately.
icons - Web app manifests
type array mandatory yes the icons member specifies an array of objects representing image files that can serve as application icons for different contexts.
... examples "icons": [ { "src": "icon/lowres.webp", "sizes": "48x48", "type": "image/webp" }, { "src": "icon/lowres", "sizes": "48x48" }, { "src": "icon/hd_hi.ico", "sizes": "72x72 96x96 128x128 256x256" }, { "src": "icon/hd_hi.svg", "sizes": "72x72" } ] values image objects may contain the following values: member description sizes a string containing space-separated image dimensions.
... type a hint as to the media type of the image.
... the purpose of this member is to allow a user agent to quickly ignore images with media types it does not support.
Digital audio concepts - Web media technologies
audio channels and frames there are two types of audio channel.
... the type of content being encoded can affect the choice of codec.
... audio frequency bandwidth some codecs allow you to configure the audio frequency bandwidth directly, either by specifying the range of frequencies to allow, by establishing upper and/or lower frequency limits, or by specifying an audio source type that determines how to configure the algorithm based on the expected frequency use of the incoming signal.
... there are two types of joint stereo: mid-side and intensity.
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.
...it can apply to a file, a file type, all files loaded on a page, a specific metric (e.g.
... user timing api create application specific timestamps using the user timing api's "mark" and "measure" entry types - that are part of the browser's performance timeline.
... glossary terms beacon brotli compression client hints code splitting cssom domain sharding effective connection type first contentful paint first cpu idle first input delay first interactive first meaningful paint first paint http http/2 jank latency lazy load long task lossless compression lossy compression main thread minification network throttling packet page load time page prediction parse perceived performance prefetch prerender quic rail real user monitoring resource timing r...
Add to Home screen - Progressive web apps (PWAs)
note: the .webmanifest extension is specified in the media type registration section of the specification, but generally browsers will support manifests with other appropriate extensions, e.g.
...hey, at least it isn't cats.", "display": "fullscreen", "icons": [ { "src": "icon/fox-icon.png", "sizes": "192x192", "type": "image/png" } ], "name": "awesome fox pictures", "short_name": "foxes", "start_url": "/pwa-examples/a2hs/index.html" } appropriate icon as shown in the above manifest listing, we are including a 192 x 192 px icon for use in our app.
...you could also decide to include different types of icons so devices can use the best one they are able to (e.g., chrome already supports the webp format).
... note that the type member in each icon's object specifies the icon's mimetype, so the browser can quickly read what type the icon is, and then ignore it and move to a different icon if it doesn't support it.
How to make PWAs installable - Progressive web apps (PWAs)
the content of the file looks like this: { "name": "js13kgames progressive web app", "short_name": "js13kpwa", "description": "progressive web app that lists games submitted to the a-frame category in the js13kgames 2017 competition.", "icons": [ { "src": "icons/icon-32.png", "sizes": "32x32", "type": "image/png" }, // ...
... { "src": "icons/icon-512.png", "sizes": "512x512", "type": "image/png" } ], "start_url": "/pwa-examples/js13kpwa/index.html", "display": "fullscreen", "theme_color": "#b12a34", "background_color": "#b12a34" } most of the fields are self-explanatory, but to be certain we're on the same page: name: the full name of your web app.
... icons: a bunch of icon information — source urls, sizes, and types.
... a minimal web manifest must have at least a name and an icons field with at least one icon defined; that icon must have at least the src, sizes, and type sub-fields as well.
textLength - SVG: Scalable Vector Graphics
example let's create a simple example that presents text you can resize using an <input> element of type "range".
... html the html is also simple, with only two displayed elements contained inside a grouping <div>: <div class="controls"> <input type="range" id="widthslider" min="80" max="978"> <span id="widthdisplay"></span> </div> the <input> element, of type "range", is used to create the slider control the user will manipulate to change the width of the text.
...= document.getelementbyid("widthslider"); const widthdisplay = document.getelementbyid("widthdisplay"); const textelement = document.getelementbyid("hello"); const baselength = math.floor(textelement.textlength.baseval.value); widthslider.value = baselength; widthslider.addeventlistener("input", function(event) { textelement.textlength.baseval.newvaluespecifiedunits( svglength.svg_lengthtype_px, widthslider.valueasnumber); widthdisplay.innertext = widthslider.value; }, false); widthslider.dispatchevent(new event("input")); after fetching the element references, an eventlistener is established by calling addeventlistener() on the slider control, to receive any input events which occur.
... when an "input" event occurs, we call svglength.newvaluespecifiedunits() to set the value of textlength to the slider's new value, using the svglength interface's svg_lengthtype_px unit type to indicate that the value represents pixels.
<circle> - SVG: Scalable Vector Graphics
WebSVGElementcircle
value type: <length>|<percentage> ; default value: 0; animatable: yes cy the y-axis coordinate of the center of the circle.
... value type: <length>|<percentage> ; default value: 0; animatable: yes r the radius of the circle.
... value type: <length> ; default value: 0; animatable: yes pathlength the total length for the circle's circumference, in user units.
... value type: <number> ; default value: none; animatable: yes note: starting with svg2, cx, cy, and r are geometry properties, meaning those attributes can also be used as css properties for that element.
<feColorMatrix> - SVG: Scalable Vector Graphics
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in type values dom interface this element implements the svgfecolormatrixelement interface.
... <circle cx="30" cy="30" r="20" fill="blue" fill-opacity="0.5" /> <circle cx="20" cy="50" r="20" fill="green" fill-opacity="0.5" /> <circle cx="40" cy="50" r="20" fill="red" fill-opacity="0.5" /> </g> </defs> <use href="#circles" /> <text x="70" y="50">reference</text> <!-- identity matrix --> <filter id="colormethesame"> <fecolormatrix in="sourcegraphic" type="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0" /> </filter> <use href="#circles" transform="translate(0 70)" filter="url(#colormethesame)" /> <text x="70" y="120">identity matrix</text> <!-- combine rgb into green matrix --> <filter id="colormegreen"> <fecolormatrix in="sourcegraphic" type="matrix" ...
...values="0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 1 0" /> </filter> <use href="#circles" transform="translate(0 140)" filter="url(#colormegreen)" /> <text x="70" y="190">rgbtogreen</text> <!-- saturate --> <filter id="colormesaturate"> <fecolormatrix in="sourcegraphic" type="saturate" values="0.2" /> </filter> <use href="#circles" transform="translate(0 210)" filter="url(#colormesaturate)" /> <text x="70" y="260">saturate</text> <!-- huerotate --> <filter id="colormehuerotate"> <fecolormatrix in="sourcegraphic" type="huerotate" values="180" /> </filter> <use href="#circles" transform="translate(0 280)" filter="url(#colormehuerotate)" /> <text x="70" y="330">huerotate</text> <!-- lum...
...inancetoalpha --> <filter id="colormelta"> <fecolormatrix in="sourcegraphic" type="luminancetoalpha" /> </filter> <use href="#circles" transform="translate(0 350)" filter="url(#colormelta)" /> <text x="70" y="400">luminancetoalpha</text> </svg> result screenshotlive sample specifications specification status comment filter effects module level 1the definition of '<fecolormatrix>' in that specification.
<feComponentTransfer> - SVG: Scalable Vector Graphics
<stop offset="0.2" stop-color="#ffff00"></stop> <stop offset="0.4" stop-color="#00ff00"></stop> <stop offset="0.6" stop-color="#00ffff"></stop> <stop offset="0.8" stop-color="#0000ff"></stop> <stop offset="1" stop-color="#800080"></stop> </lineargradient> <filter id="identity" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="identity"></fefuncr> <fefuncg type="identity"></fefuncg> <fefuncb type="identity"></fefuncb> <fefunca type="identity"></fefunca> </fecomponenttransfer> </filter> <filter id="table" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="table" tablevalues="0 0 1 1"></fefuncr> <fefuncg type="table" tablevalues="1 1 0...
... 0"></fefuncg> <fefuncb type="table" tablevalues="0 1 1 0"></fefuncb> </fecomponenttransfer> </filter> <filter id="discrete" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="discrete" tablevalues="0 0 1 1"></fefuncr> <fefuncg type="discrete" tablevalues="1 1 0 0"></fefuncg> <fefuncb type="discrete" tablevalues="0 1 1 0"></fefuncb> </fecomponenttransfer> </filter> <filter id="linear" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="linear" slope="0.5" intercept="0"></fefuncr> <fefuncg type="linear" slope="0.5" intercept="0.25"></fefuncg> <fefuncb type="linear" slope="0.5" intercept="0.5"></fefuncb> </fecomponenttransfer> </filter> ...
...<filter id="gamma" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="gamma" amplitude="4" exponent="7" offset="0"></fefuncr> <fefuncg type="gamma" amplitude="4" exponent="4" offset="0"></fefuncg> <fefuncb type="gamma" amplitude="4" exponent="1" offset="0"></fefuncb> </fecomponenttransfer> </filter> </defs> <g font-weight="bold"> <text x="0" y="20">default</text> <rect x="0" y="30" width="100%" height="20"></rect> <text x="0" y="70">identity</text> <rect x="0" y="80" width="100%" height="20" style="filter:url(#identity)"></rect> <text x="0" y="120">table lookup</text> <rect x="0" y="130" width="100%" height="20" style="filter:url(#table)"></rect> <text x="0" y="170">discrete table lookup</text> ...
... working draft specified that missing transfer function elements are treated like they were specified with their type attributes set to identity.
<foreignObject> - SVG: Scalable Vector Graphics
value type: <length>|<percentage> ; default value: auto; animatable: yes width the width of the foreignobject.
... value type: <length>|<percentage> ; default value: auto; animatable: yes x the x coordinate of the foreignobject.
... value type: <length>|<percentage> ; default value: 0; animatable: yes y the y coordinate of the foreignobject.
... value type: <length>|<percentage> ; default value: 0; animatable: yes note: starting with svg2, x, y, width, and height are geometry properties, meaning those attributes can also be used as css properties for that element.
<script> - SVG: Scalable Vector Graphics
WebSVGElementscript
value type: <string>; default value: ?; animatable: yes href the url to the script to load.
... value type: <url> ; default value: none; animatable: no type this attribute defines type of the script language to use.
... value type: <string>; default value: application/ecmascript; animatable: no xlink:href deprecated since svg 2 the url to the script to load.
... value type: <url> ; default value: none; animatable: no global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesnonepermitted contentany elements or character data specifications specification status comment scalable vector graphics (svg) 2the definition of '<script>' in that specification.
<style> - SVG: Scalable Vector Graphics
WebSVGElementstyle
html,body,svg { height:100%; margin: 0; padding: 0; } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <style> circle { fill: gold; stroke: maroon; stroke-width: 2px; } </style> <circle cx="5" cy="5" r="4" /> </svg> attributes type this attribute defines type of the style sheet language to use as a media type string.
... value type: <string>; default value: text/css; animatable: no media this attribute defines to which media the style applies.
... value type: <string>; default value: all; animatable: no title this attribute the title of the style sheet which can be used to switch between alternate style sheets.
... value type: <string>; default value: none; animatable: no global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesnonepermitted contentany elements or character data specifications specification status comment scalable vector graphics (svg) 2the definition of '<style>' in that specification.
Fills and Strokes - SVG: Scalable Vector Graphics
most svg you'll find around the web use inline css, but there are advantages and disadvantages associated with each type.
... finally, you can also use dashed line types on a stroke by specifying the stroke-dasharray attribute.
... <?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="http://www.w3.org/2000/svg" version="1.1"> <rect height="10" width="10" id="myrect"/> </svg> where style.css looks something like: #myrect { fill: red; stroke: black; } « previousnext » ...
Paths - SVG: Scalable Vector Graphics
WebSVGTutorialPaths
we will start with a rectangle (the same type that could be more easily made with a <rect> element).
... s x2 y2, x y (or) s dx2 dy2, dx dy s produces the same type of curve as earlier—but if it follows another s command or a c command, the first control point is assumed to be a reflection of the one used previously.
... <svg width="190" height="160" xmlns="http://www.w3.org/2000/svg"> <path d="m 10 80 c 40 10, 65 10, 95 80 s 150 150, 180 80" stroke="black" fill="transparent"/> </svg> the other type of bézier curve, the quadratic curve called with q, is actually a simpler curve than the cubic one.
... arcs the other type of curved line that can be created using svg is the arc, called with the a command.
Securing your site - Web security
for certain types of data, you may wish to disable this feature.
... content security properly configuring server mime types there are several ways incorrect mime types can cause potential security problems with your site.
... this article explains some of those and shows how to configure your server to serve files with the correct mime types.
... content security policy an added layer of security that helps to detect and mitigate certain types of attacks, including cross site scripting (xss) and data injection attacks.
Web security
content security content security policy (csp) content security policy (csp) is an added layer of security that helps to detect and mitigate certain types of attacks, including cross-site scripting (xss) and data injection attacks.
...passive mixed content is displayed by default, but users can set a preference to block this type of content, as well.
... http x-content-type-options the x-content-type-options response http header is a marker used by the server to indicate that the mime types advertised in the content-type headers should not be changed and be followed.
... this is a way to opt out of mime type sniffing, or, in other words, to say that the mime types are deliberately configured.
Using custom elements - Web Components
there are two types of custom elements: autonomous custom elements are standalone — they don't inherit from standard html elements.
... } } the preceding code snippet contains the constructor() definition for the class, which always starts by calling super() so that the correct prototype chain is established.
...classes please note that es2015 classes cannot reliably be transpiled in babel 6 or typescript targeting legacy browsers.
... you can either use babel 7 or the babel-plugin-transform-builtin-classes for babel 6, and target es2015 in typescript instead of legacy.
Common XSLT Errors - XSLT: Extensible Stylesheet Language Transformations
mime types your server needs to send both the source and the stylesheet with a xml mime type, text/xml or application/xml.
... to find out the current type, load the file in mozilla and look at the page info.
... or use a download tool, those usually tell the mime type.
... in firefox 6 and forward, you can also use the official xslt mimetype: application/xslt+xml.
<xsl:stylesheet> - XSLT: Extensible Stylesheet Language Transformations
input-type-annotations specifies whether type annotations are stripped from the element so the same results are produced whether the source documents have been validated against a schema or not.
... xpath-default-namespace specifies the namespace that will be used if the element name is unprefixed or an unprefixed type name within an xpath expression.
... type required outermost element of stylesheet.
... xslt 2.0 added the attributes xpath-default-namespace, default-validation, default-collation, and input-type-annotations and made all attributes except version optional.
An Overview - XSLT: Extensible Stylesheet Language Transformations
the tree is an abstract datatype, a conceptual model which can be implemented in various ways depending on the parser and the processor.
...it can be made up of seven different types of nodes: the single root node, element nodes, text nodes, attribute nodes, comment nodes, processing instruction nodes, and namespace nodes.
...there are certain constraints on which type of nodes can occur where: for example, text nodes can have no children.
...for example, if the stylesheet is called inventory.xsl and resides in the same directory as the xml document, the processing instruction in the xml document would look like this: <?xml-stylesheet type="text/xml" href="inventory.xsl"?> this must be placed in the prolog section of the xml document.
Loading and running WebAssembly code - WebAssembly
webassembly is not yet integrated with <script type='module'> or es2015 import statements, thus there is not a path to have the browser fetch modules for you using imports.
... using xmlhttprequest xmlhttprequest is somewhat older than fetch, but can still be happily used to get a typed array.
... the key part of this is to set the response type to 'arraybuffer' using the responsetype property.
... the final code looks like this: request = new xmlhttprequest(); request.open('get', 'simple.wasm'); request.responsetype = 'arraybuffer'; request.send(); request.onload = function() { var bytes = request.response; webassembly.instantiate(bytes, importobject).then(results => { results.instance.exports.exported_func(); }); }; note: you can see an example of this in action in xhr-wasm.html.
system - Archive of obsolete content
platform the type of operating system you're running on.
... var system = require("sdk/system"); console.log("platform = " + system.platform); architecture the type of processor architecture you're running on.
... var system = require("sdk/system"); console.log("architecture = " + system.architecture); compiler the type of compiler used to build the host application.
/loader - Archive of obsolete content
it can be loaded as a regular script tag in documents that have system principals (note: this does not appear to work as of 02.2016 due to "use strict" being added to the file): <script type='application/javascript' src='resource://gre/modules/commonjs/toolkit/loader.js'></script> this will expose a single loader object containing all of the api functions described in this document.
... prototype: object that the returned sandbox will inherit from.
... let sandbox = sandbox({ name: 'resource:///modules/foo/bar.js', wantxrays: false, prototype: { console: { log: dump.bind(dump, 'log: '), info: dump.bind(dump, 'info: '), warn: dump.bind(dump, 'warn: '), error: dump.bind(dump, 'error: ') } } }); evaluate() evaluates code in the supplied sandbox.
Developing for Firefox Mobile - Archive of obsolete content
then type: adb devices you should see some output like: list of devices attached 51800f220f01564 device (the long hex string will be different.) if you do, then adb has found your device and you can get started.
...the easiest way is probably to copy the signed xpi somewhere on the device: adb push my-addon.xpi /mnt/sdcard/ then open firefox mobile and type this into the address bar: file:///mnt/sdcard/my-addon.xpi the browser should open the xpi and ask if you want to install it.
...core/heritage supported core/namespace supported core/promise supported event/core supported event/target supported frame/hidden-frame supported frame/utils supported io/byte-streams supported io/file supported io/text-streams supported lang/functional supported lang/type supported loader/cuddlefish supported loader/sandbox supported net/url supported net/xhr supported places/bookmarks not supported places/favicon not supported places/history not supported platform/xpcom supported preferences/service supported stylesheet/style supported ...
JavaScript Debugger Service - Archive of obsolete content
jsd.scripthook = { onscriptcreated: function(script) { // your function here }, onscriptdestroyed: function(script) { // your function here } }; jsd.errorhook = { onerror: function(message, filename, lineno, colno, flags, errnum, exc) { // your function here } }; // triggered when jsd.errorhook[onerror] returns false jsd.debughook = { onexecute: function(frame, type, rv) { // your function here } }; jsd.enumeratescripts({ // the enumeratescript method will be called once for every script jsd knows about enumeratescript: function(script) { // your function here } }); a simple stack trace here, we will show how to implement a simple javascript stack trace using the jsd.
... jsd.errorhook = { onerror: function(message, filename, lineno, colno, flags, errnum, exc) { dump(message + "@" + filename + "@" + lineno + "@" + colno + "@" + errnum + "\n"); // check message type var jsdierrorhook = components.interfaces.jsdierrorhook; var messagetype; if (flags & jsdierrorhook.report_error) messagetype = "error"; if (flags & jsdierrorhook.report_warning) messagetype = "warning"; if (flags & jsdierrorhook.report_exception) messagetype = "uncaught-exception"; if (flags & jsdierrorhook.report_strict) messagetype += "-strict"; dump(messagetype + "\n"); return false; // trigger debughook // return true; if you do not wish to trigger debughook } }; // note that debughook does not _al...
...ways_ trigger when jsd.errorhook[onerror] returns false // it is not well-known why debughook sometimes fails to trigger jsd.debughook = { onexecute: function(frame, type, rv) { stacktrace = ""; for (var f = frame; f; f = f.callingframe) { stacktrace += f.script.filename + "@" + f.line + "@" + f.functionname + "\n"; } dump(stacktrace); return components.interfaces.jsdiexecutionhook.return_continue; } }; filters jsd also allows the use of filters to track which scripts should trigger the hooks.
Miscellaneous - Archive of obsolete content
</div> <script type="text/javascript"> var elm = document.getelementbyid("scrollarea"); elm.addeventlistener("dommousescroll", function scroll(event){ //event.detail is positive for a downward scroll, negative for an upward scroll alert("scrolling " + event.detail + " lines"); }, false); </script> if you do not receive a dommousescroll event while holding any of the modifier keys (ctrl,shift,alt,meta...
...rl")) 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 parameters getting postdata of a webpage first, you need to get the browser you want, and its hi...
...in the components/certsservice.js file: const cc = components.classes; const ci = components.interfaces; components.utils.import("resource://gre/modules/xpcomutils.jsm"); const gobserver = cc['@mozilla.org/observer-service;1'].getservice(ci.nsiobserverservice); const gioservice = cc["@mozilla.org/network/io-service;1"].getservice(ci.nsiioservice); function certsservice() {} certsservice.prototype = { observe: function(asubject, atopic, adata) { switch(atopic) { case "app-startup": gobserver.addobserver(this,"xpcom-shutdown",false); gobserver.addobserver(this,"final-ui-startup",false); break; case "xpcom-shutdown": gobserver.removeobserver(this,"final-ui-startup"); gobserver.
Code snippets - Archive of obsolete content
stringview a library that implements a stringview view for javascript typed arrays.
... this lets you access data in typed arrays using c-like string functions.
...nevertheless, the increasing computational power of modern browsers together with the introduction of typed arrays in ecmascript allow us, in theory, to build full virtual machines in pure ecmascript.
Extension Packaging - Archive of obsolete content
the mime type recognized by firefox for xpi files is application/x-xpinstall.
... since most http servers are not configured to return this mime type for the .xpi extension by default, you will probably need to configure your http server.
... in the apache http server, this can be done by adding the following directive to the configuration file or .htaccess: addtype application/x-xpinstall .xpi install extension files directly if you know the location of the application (if you are installing an extension as part of the application installer, for example), you can install the extension files directly to <appdir>/extensions/<extensionid>.
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
onclick) for (var key in elemattr) { var val = elemattr[key]; if (nodes && key == "key") { nodes[val] = elem; continue; } var attrns = namespace(key); if (typeof val == "function") { // special case for function attributes; don't just add them as 'on...' attributes, but as events, using addeventlistener elem.addeventlistener(key.replace(/^on/, ""), val, false); } else { // note that the default namespace for xml attributes is, and should be, blank (ie.
...; function addentrytopopup(menupopup, doc, chromewindow) { var newitem = doc.createelement("menuitem"); newitem.setattribute("value", "testvalue"); newitem.setattribute("label", "another popup menu item"); menupopup.appendchild(newitem); }; var jsontemplatebtn = ["xul:toolbarbutton", { id: "mytestbutton", class: "toolbarbutton-1", type: "menu", label: "test button label", tooltiptext: "test button tooltip", removable: true, key: "mytestbutton123" }, [ "menupopup", { onpopupshowing: function(event) { addentrytopopup(this, document, window); } }, null ] ]; var capturednodes = {}; var toolbox = doc.getel...
...the demo of this is seen at jsfiddle :: jsontodom example var json = ['html:div', {style:'background-color:springgreen'}, ['html:form', {id:'myfirstform'}, ['html:input', {type:'text', value:'my field'}], ['html:button', {id:'mybtn'}, 'button text content'] ], ['html:form', {id:'mysecondform'}, ['html:input', {type:'text', value:'my field for second form'}], ['html:div', {}, 'sub div with textcontent and siblings', ['html:br', {}], ['html:input', {type:'checkbox', id:'mycheck'}],...
Intercepting Page Loads - Archive of obsolete content
._toggleprogresslistener(browser.webprogress, false); }, this); gbrowser.tabcontainer.removeeventlistener("tabopen", this, false); gbrowser.tabcontainer.removeeventlistener("tabclose", this, false); }, handleevent : function(aevent) { let tab = aevent.target; let webprogress = gbrowser.getbrowserfortab(tab).webprogress; this._toggleprogresslistener(webprogress, ("tabopen" == aevent.type)); }, _toggleprogresslistener : function(awebprogress, aisadd) { if (aisadd) { awebprogress.addprogresslistener(this, awebprogress.notify_all); } else { awebprogress.removeprogresslistener(this); } } this shouldn't be too hard to follow.
...a good filter would look like this: shouldload : function(acontenttype, acontentlocation, arequestorigin, acontext, amimetypeguess, aextra) { let result = components.interfaces.nsicontentpolicy.accept; // we should check for type_subdocument as well if we want frames.
... if ((components.interfaces.nsicontentpolicy.type_document == acontenttype) && some_regular_expression.test(acontentlocation.spec)) { // do stuff here, possibly changing result.
Setting Up a Development Environment - Archive of obsolete content
in the "run" textbox you should type this: bash -c "make" or replace "make" with "make clean" for the clean command.
...the install process requires using an environment variable called ostype, which is not exported.
... long story short, if you want to run it from a command line, you need to run: export ostype; make install and in the command in komodo, you should enter the following: bash -c "export ostype; make install" the export command won't work correctly unless you use "bash -c".
Search Extension Tutorial (Draft) - Archive of obsolete content
search.xml <?xml version="1.0" encoding="utf-8"?> <searchplugin xmlns="http://www.mozilla.org/2006/browser/search/"> <shortname>example engine</shortname> <description>example search engine</description> <inputencoding>utf-8</inputencoding> <image width="16" height="16" type="image/png">data:image/png;base64, ...
... </image> <url type="application/x-suggestions+json" template="https://api.example.com/suggestions"> <param name="q" value="{searchterms}"/> </url> <url type="text/html" method="get" template="https://www.example.com/search"> <param name="q" value="{searchterms}"/> <param name="source" value="search-box"/> </url> <url type="application/x-moz-keywordsearch" method="get" template="https://www.example.com/search"> <param name="q" value="{searchterms}"/> <param name="source" value="keyword"/> </url> <searchform>https://www.example.com/search</searchform> </searchplugin> bootstrap.js const { classes: cc, interfaces: ci, utils: cu, results: cr } = components; // import the services module.
...a separate url for keyword can be set by adding a type="application/x-moz-keywordsearch" url to the search description file if desired.
XML data - Archive of obsolete content
to do this, your stylesheet uses rules that map tags in the xml document to the display types used by html.
... for the full list of display types, see the display property in the css specification.
...copy and paste the content from here, making sure that you scroll to get all of it: <?xml version="1.0"?> <!-- xml demonstration --> <?xml-stylesheet type="text/css" href="style9.css"?> <!doctype planet> <planet> <ocean> <name>arctic</name> <area>13,000</area> <depth>1,200</depth> </ocean> <ocean> <name>atlantic</name> <area>87,000</area> <depth>3,900</depth> </ocean> <ocean> <name>pacific</name> <area>180,000</area> <depth>4,000</depth> </ocean> <ocean> <name>indian</name> <area>75,000</area> <depth>3,900</depth> </ocean> <ocean> <name>south...
Creating a status bar extension - Archive of obsolete content
<?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:id>status-bar-sample-1@example.com</em:id> <em:version>1.0</em:version> <em:type>2</em:type> <!-- front end metadata --> <em:name>status bar sample 1</em:name> <em:description>sample static status bar panel</em:description> <em:creator>my name</em:creator> <em:homepageurl>http://developer.mozilla.org/en/docs/creating_a_status_bar_extension</em:homepageurl> <!-- describe the firefox versions we support --> <em:targetapplication> <description> ...
... type the addon type.
...our overlay file, status-bar-sample-1.xul, looks like this: <?xml version="1.0" encoding="utf-8"?> <!doctype overlay > <overlay id="status-bar-sample-1-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <!-- firefox --> <statusbar id="status-bar"> <statusbarpanel id="status-bar-sample-1" label="hello world" tooltiptext="sample status bar item" /> </statusbar> </overlay> the first order of business in the status-bar-sample-1.xul file is to es...
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
good candidates for inner-browsing include a spell check application, in which the text entered in a web page is checked as it is typed; a webmail application that uses the inner-browsing model to display the separate messages and message lists in an integrated way, much like a client mail app; and a stock ticker that spools the information across the web page.
... document.getelementbyid("container").innerhtml+=articletitle+"<br />"; } source code for the sample <html> <head> <title>inner-browsing example, with xmlhttprequest and dom</title> <script type="text/javascript" language="javascript" src="xmlrequest.js"></script> <script> /* ***** begin license block ***** * version: mpl 1.1 * * the contents of this file are subject to the mozilla public license version * 1.1 (the "license"); you may not use this file except in compliance with * the license.
...decoration:none;} .tab:hover { background-color:#ddeeff; } </style> </head> <body > <h2>latest headlines - inner-browsing example </h2> <p>click the tabbed menu to dynamically load the headlines into this web page.</p> <br /> <!-- ***** this code dynamically creates the tabbed menu if the browser has support to xmlhttprequest, since the mechanism used here is xmlhttprequest ***** --> <script type="text/javascript" language="javascript"> //// /// object detection // var xcomp=null; var testxmlhttprequest=false; try { xcomp = new xmlhttprequest(); if(xcomp) testxmlhttprequest=true; } catch (e) { try { xcomp = new activexobject("microsoft.xmlhttp"); if(xcomp) testxmlhttprequest=true; } catch (e) { } } if(testxmlhttprequest&&document.getelementsbyta...
MMgc - Archive of obsolete content
these flags may be passed to alloc to control the allocation type.
...the memory profiler use srtti and stack traces to get information by location and type: class avmplus::growablebuffer - 24.9% - 3015 kb 514 items, avg 6007b 98.9% - 2983 kb - 512 items - poolobject.cpp:29 abcparser.cpp:948 … 0.8% - 24 kb - 1 items - poolobject.cpp:29 abcparser.cpp:948 … class avmplus::string - 13.2% - 1602 kb 15675 items, avg 104b 65.6% - 1051 kb - 14397 items - stringobject.cpp:46 avmcore.cpp:2300 … 20.4% - 326 kb - 10439 items - avmcor...
...these 4k blocks are aligned on 4k boundaries so we can easily allocate everything on 8-byte boundaries (a necessary consequence of the 32-bit atom design-- 3 type bits and 29 pointer bits).
Source code directories overview - Archive of obsolete content
these include: cookies, irc, wallet, dom inspector, p3p, schema validation, spellchecker, transformiix, typeaheadfind, javascript debugger, xforms, etc.
... view contains c interfaces and code for different types of views (e.g.
... components contains the alerts, autocomplete, command line interface, console, cookies, download manager, filepicker, history, password manager, typeaheadfind, view source, etc.
Making it into a static overlay - Archive of obsolete content
to make the file into a static overlay, we need to move all the code we added to navigator.xul into a new file tinderstatusoverlay.xul in the same directory: <?xml version="1.0"?> <?xml-stylesheet href="chrome://navigator/content/tinderstatus.css" type="text/css"?> <overlay id="tinderstatusoverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://navigator/content/tinderstatus.js" /> <statusbar id="status-bar"> <statusbarpanel class="statusbarpanel-iconic" id="tinderbox-status" insertbefore="offline-status" status="none"/> ...
... <?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?> <?xml-stylesheet href="chrome://navigator/content/tinderstatus.css" type="text/css"?> <?xul-overlay href="chrome://navigator/content/navigatoroverlay.xul"?> <?xul-overlay href="chrome://navigator/content/navextraoverlay.xul"?> <?xul-overlay href="chrome://navigator/content/linktoolbaroverlay.xul"?> <?xul-overlay href="chrome://navigator/content/tinderstatusoverlay.xul"?>...
... <!-- navigator --> <script type="application/javascript" src="chrome://navigator/content/browser.js"/> <script type="application/javascript" src="chrome://navigator/content/navigator.js"/> <script type="application/javascript" src="chrome://navigator/content/navigatordd.js"/> <script type="application/javascript" src="chrome://navigator/content/sessionhistoryui.js"/> <script type="application/javascript" src="chrome://navigator/content/tinderst...
Code snippets - Archive of obsolete content
let collection = "forms"; components.utils.import("resource://services-sync/main.js"); components.utils.import("resource://services-sync/record.js"); let recordtype = weave.engines.get(collection)._recordobj; let coll = new collection(weave.service.storageurl + collection, recordtype); coll.full = true; coll.recordhandler = function(item) { item.collection = collection; item.decrypt(); console.log(item.cleartext); }; coll.get(); print an individual record let collection = "history"; let id = "guid_goes_here"; components.utils.import("resource://servi...
...ces-sync/main.js"); components.utils.import("resource://services-sync/record.js"); let recordtype = weave.engines.get(collection)._recordobj; let coll = new collection(weave.service.storageurl + collection, recordtype); coll.full = true; coll.ids = [id]; coll.recordhandler = function(item) { item.collection = collection; item.decrypt(); console.log(item.cleartext); }; coll.get(); count types of bookmark records components.utils.import("resource://services-sync/main.js"); components.utils.import("resource://services-sync/record.js"); let deleted = 0; let items = {}; let collection = "bookmarks"; let recordtype = weave.engines.get(collection)._recordobj; let coll = new collection(weave.service.storageurl + collection, recordtype); coll.full = true; coll.limit = nu...
...ll; coll.recordhandler = function(item) { item.collection = collection; item.decrypt(); if (item.deleted) { deleted++; } else { items[item.type] = 1 + (items[item.type] || 0); } }; coll.get(); console.log("deleted: " + deleted + ", " + json.stringify(items)); get a log from xul fennec view about:sync-log.
Creating a Help Content Pack - Archive of obsolete content
the glossary and index data sources will be hidden - information found only in them will not be displayed unless the user conducts a search of the help pack that would return glossary or index results.xxx this sentence is ugly - a little rewording help here would be nice a data source description is pretty much the same no matter which type you're defining, and the syntax is pretty simple.
...e, the following code uses a datasource outside the content pack you have created to include the article in a table of contents: <rdf:li> <rdf:description nc:panelid="toc" nc:datasources="chrome://help/locale/help-toc.rdf chrome://foo/locale/help/glossary.rdf"/> </rdf:li> each of the different data source types (toc, index, glossary, and search) may be used multiple times (and in the case of platform-specific information, must be used multiple times).
... viewing your content pack in the help viewer to launch the help viewer with your content pack, you need to have chrome://help/content/contexthelp.js loaded into the xul file that provides the ui to open the help viewer: <script type="application/javascript" src="chrome://help/content/contexthelp.js"/> this will allow you to access all of the viewer functions.
Helper Apps (and a bit of Save As) - Archive of obsolete content
bird's eye view flow of control uriloader tries to find a content listener for the mime type in question.
... nsimimeinfo lookup look in built-in list which the user cannot override (types we handle internally).
... mailcap/mime.types on linux.
Introducing the Audio API extension - Archive of obsolete content
the following example extracts the data from an audio element: <!doctype html> <html> <head> <title>javascript metadata example</title> </head> <body> <audio id="audio-element" src="song.ogg" controls="true" style="width: 512px;"> </audio> <script> function loadedmetadata() { channels = audio.mozchannels; rate = audio.mozsamplerate; framebufferlength = audio.moz...
... we can extend the previous example to visualize the timestamp and the first two samples in a <div> element: <!doctype html> <html> <head> <title>javascript visualization example</title> </head> <body> <audio id="audio-element" src="revolve.ogg" controls="true" style="width: 512px;"> </audio> <pre id="raw">hello</pre> <script> function loadedmetadata() { channels = audio.mozchannels; rate = audio.mozsamplerate; ...
...you can see an example below: // write samples using a js array var samples = [0.242, 0.127, 0.0, -0.058, -0.242, ...]; var numbersampleswritten = audiooutput.mozwriteaudio(samples); // write samples using a typed array var samples = new float32array([0.242, 0.127, 0.0, -0.058, -0.242, ...]); var numbersampleswritten = audiooutput.mozwriteaudio(samples); in the following example, we create an audio pulse: <!doctype html> <html> <head> <title>generating audio in real time</title> <script type="text/javascript"> function playtone() { var output = new audio(); output.mozsetup(1,...
JavaScript crypto - Archive of obsolete content
web sites which use ssl clientauth login could use the following code to refresh the page on token insertions and removals: <!doctype html> <p>...
...signed blob and any other necessary info to the ca/ra ca/ra verifies signature on signed blob ca/ra validates identity of user ca/ra sends wrapped encryption private key to kra kra sends escrow verification back to ca ca creates and signs certificates ca sends certificates back to the user (importusercertificates) typical use the ca's enrollment page could look something like this: <!doctype html> <h2>request a cert</h2> <form name="reqform" method="post" action="http://your.ra.site.org"> <p><input type=hidden name=cert_request value=""> <p>name: <input type=text name=name value=""> <p>password: <input type=password name="password" value=""> <p><input type=submit name="send" value="submit"> </form> <script> /* the following values could be filled in by the server cgi */ var authentic...
... if (typeof(crypto.version) != "undefined") { crmfobject = crypto.generatecrmfrequest( "cn=" + form.name.value, form.password.value, authenticator, keytransportcert, "setcrmfrequest();", 1024, null, "rsa-dual-use"); } return false; } function setcrmfrequest() { form.cert_request.value = crmfobject.request; form.submit(); } form.onsubmit = validate; </script> on completion of the request, the ca may submit a page that looks something like this: <!doctype html> <h2>certificate request successful</h2> <p>hit 'load' to load your certificate</p> <form name="reqform"> <p><input typ...
Settings - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
...here is an example manifest definition: var manifest = { settings: [ { name: "twitter", type: "group", label: "twitter", settings: [ { name: "username", type: "text", label: "username" }, { name: "password", type: "password", label: "password" } ] }, { name: "facebook", type: "group", label: "facebook", settings: [ { name: "username", type: "text", label: "username", default: "jdoe" }, { name: "password", t...
...ype: "password", label: "secret" } ] }, { name: "music", type: "boolean", label: "music", default: true }, { name: "volume", type: "range", label: "volume", min: 0, max: 10, default: 5 } ] }; // import after defining manifest!
Clipboard - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
...features can get and set the clipboard in various flavors of data type.
...if no other arguments are specified, the flavor of the content is assumed to 'plain'.string flavordata type.
Clipboard Test - Archive of obsolete content
param>.name:after{content: " as "; font-weight: normal; } .method>.params{display: block; color:#555;} .method>.params>.param{display: block; margin-bottom:5px;} .method>.params>.param>.name{font-weight:bold; margin-right:.5em; min-width:80px; display:inline-block;} .method>.params>.param>.description{display:inline-block; width:300px; vertical-align:top;margin-right:30px} .method>.params>.param>.type{display:inline-block; width:100px; vertical-align:top;font-weight:bold;} .method>.params>.param>.type:before{content: "type "; color: #888; font-weight:normal;} .method>.params>.param>.default{display:inline-block; width:100px; vertical-align:top;font-weight:bold;} .method>.params>.param>.default:before{content: "default "; color: #888;font-weight:normal;} ]]></style> clipboard jetpack's clipboar...
...features can get and set the clipboard in various flavors of data type.
...if no other arguments are specified, the flavor of the content is assumed to 'plain'.string flavordata type.
Nanojit - Archive of obsolete content
typedef js_fastcall int32_t (*addtwofn)(int32_t); addtwofn fn = reinterpret_cast<addtwofn>(f->code()); printf("2 + 5 = %d\n", fn(5)); return 0; } code explanation interesting part are the lines 46-50: // write a few lir instructions to the buffer: add the first parameter // to the constant 2.
... typedef js_fastcall int32_t (*addtwofn)(int32_t); addtwofn fn = reinterpret_cast<addtwofn>(f->code()); printf("2 + 5 = %d\n", fn(5)); return 0;</addtwofn> this upper half of this snippet includes code where the raw lir is first converted into machine code.(where compile(fragmento->assm(), f); is called basically).
...(typedef js_fastcall int32_t (*addtwofn)(int32_t); ) then, printf is hardcoded to call it with a parameter 5, and on linking with nanojit library, the following program will display 2+5=7 now, what i need to do is generate output for this: start two = int 2 twoplustwo = add two, two ret twoplustwo this adds two and two in the most hardcoded way possible.
SpiderMonkey coding conventions - Archive of obsolete content
scalar type names are lowercase and js-prefixed: jsdouble.
... aggregate type names are js-prefixed and mixed-case: jsobject.
... linkage dll entry points have their return type expanded within a js_public_api() macro call, to get the right windows secret type qualifiers in the right places for all build variants.
Abc Assembler Tests - Archive of obsolete content
when run, the assembler tests include the abcasm/abs_helper.as file which defines the following functions: start(summary:string):void - start a new test section described by summary end():void - test section finished compare_stricteq(name:string, expected:*, actual:*):void - compare the results of a testcase where name is the testcase name compare_typeerror(name:string, expected:*, actual:*):void - special function for comparing typeerrors (runtimeerrors) - will only compare the first 22 chars of expected and actual so that test can be run in release and releasedebugger configurations.
...ction .function_id(runtest) getlocal0 call 0 findproperty end callpropvoid end 0 returnvoid } function runtest() { // test null <= null == true findproperty compare_stricteq pushstring "null lessequals null" // testname pushtrue // expected pushnull pushnull lessequals // actual callpropvoid compare_stricteq 3 // use .try / .catch to catch typeerror // convert_o null .try { pushnull convert_o pop findproperty fail pushstring "convert_o null" pushstring "exception should have been thrown: typeerror: error #1009: cannot access a property or method of a null object reference." getlocal1 callpropvoid fail 3 jump finished_convert_o_null } .catch { ...
... getlocal0 pushscope setlocal2 // save typeerror findproperty compare_typeerror pushstring "convert_o null" // test name pushstring "typeerror: error #1009" // expected getlocal2 // actual callpropvoid compare_typeerror 3 } finished_convert_o_null: } ...
Using Breakpoints in Venkman - Archive of obsolete content
types of breakpoints venkman has two types of breakpoints.
...the second type of breakpoint, the "future" breakpoint, represents a promise from venkman to set a hard breakpoint as soon as it is possible.
...the following meta comment types are available: the //@jsd_log comment will insert a breakpoint which is set to execute the script that follows without stopping.
Binding Implementations - Archive of obsolete content
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.
spellcheck - Archive of obsolete content
« xul reference home spellcheck type: boolean if true, spell checking is enabled by default for the text box; if false, spell checking is disabled by default.
...--> <input type="text" spellcheck="true" /><br /> <textarea spellcheck="true"></textarea> <div contenteditable="true" spellcheck="true">i am some content</div> <!-- spellcheck nothing!
... --> <input type="text" spellcheck="false" /><br /> <textarea spellcheck="false"></textarea> <div contenteditable="true" spellcheck="false">i am some content</div> you can use spellcheck on input, textarea, and contenteditable elements.
timeout - Archive of obsolete content
« xul reference home timeout type: integer for autocomplete textboxes, the number of milliseconds before the textbox starts searching for completions.
...the timer starts after the user types a character.
... if the user types another character, the timer resets.
Attribute (XUL) - Archive of obsolete content
mandupdater completedefaultindex container containment contentcontextmenu contenttooltip context contextmenu control crop curpos current currentset customindex customizable cycler datasources decimalplaces default defaultbutton defaultset description dir disableautocomplete disableautoselect disableclose disabled disablehistory disablekeynavigation disablesecurity dlgtype dragging editable editortype element empty emptytext deprecated since gecko 2 enablecolumndrag enablehistory equalsize eventnode events expr firstdayofweek firstpage first-tab fixed flags flex focused forcecomplete grippyhidden grippytooltiptext group handlectrltab height helpuri hidden hidechrome hidecolumnpicker hideheader hideseconds hidespinbuttons highlightn...
...1 onextra2 oninput onload onnewtab onpageadvanced onpagehide onpagerewound onpageshow onpaneload onpopuphidden onpopuphiding onpopupshowing onpopupshown onsearchcomplete onselect ontextcommand ontextentered ontextrevert ontextreverted onunload onwizardback onwizardcancel onwizardfinish onwizardnext open ordinal orient pack pageid pageincrement pagestep parent parsetype persist persistence phase pickertooltiptext placeholder popup position predicate preference preference-editable primary priority properties querytype readonly ref rel removeelement resizeafter resizebefore rows screenx screeny searchbutton searchsessions searchlabel selected selectedindex seltype setfocus showcaret showcommentcolumn showpopup size sizemode siz...
...etopopup smoothscroll sort sortactive sortdirection sortresource sortresource2 spellcheck src state statedatasource statusbar statustext style subject substate suppressonselect tabindex tabscrolling targets template timeout title toolbarname tooltip tooltiptext tooltiptextnew top type uri useraction validate value var visuallyselected wait-cursor width windowtype wrap wraparound ...
Working With Directories - Archive of obsolete content
for directories, the first argument to this method should be the constant directory_type (which has a value of 1).
... to create a file instead, you could use the constant normal_file_type instead.
... var dir = io.getfile("desktop", "myfiles"); dir.append("pictures"); if (!dir.exists()) dir.create(dir.directory_type, 0775); this example checks if the directory exists and creates it if it does not.
List of commands - Archive of obsolete content
list of commands (grouped by type) nsdomwindowcontroller commands (generally legal when there is a selection): cmd_copy - copy a selection to the clipboard cmd_cut - cut a selection into the clipboard cmd_paste - paste a selection from the clipboard cmd_selectall cmd_selectnone cmd_copylink cmd_copyimagelocation cmd_copyimagecontents cmd_scrolltop cmd_scrollbottom cmd_scrollpageup cmd_scrollpagedown cmd_scrolllineup cmd_scrolllinedown cmd_scrollleft cmd_scrollright cmd_selectcharprevious cmd_selectcharnext cmd_wordprevious cmd_wordnext cmd_selectwordprevious cmd_selectwordnext cmd_beginline cmd_endline cmd_selectbeginline cmd_selectendline cmd_selectlinepre...
...vious cmd_selectlinenext cmd_selectpageprevious cmd_selectpagenext cmd_selectmovetop cmd_selectmovebottom editor commands (legal when the focus is anywhere where you can type text): cmd_paste - paste a selection from the clipboard cmd_pastequote cmd_delete cmd_deletecharbackward cmd_deletecharforward cmd_deletewordbackward cmd_deletewordforward cmd_deletetobeginningofline cmd_deletetoendofline cmd_scrolltop cmd_scrollbottom cmd_movetop cmd_movebottom cmd_selecttop cmd_selectbottom cmd_linenext cmd_lineprevious cmd_selectlinenext cmd_selectlineprevious cmd_charprevious cmd_charnext cmd_selectcharprevious cmd_selectcharnext cmd_beginline cmd_endline cmd_selectbeginline cmd_selectendline cmd_wordprevious cmd_wordnext cmd_selectwordprevious cmd_selectwordnex...
...ewseparator 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_minimizewindow cmd_neweditor cmd_neweditordraft cmd_neweditortemplate cmd_newnavigator cmd_newnavigatortab cmd_newtabwithtarget cmd_openhelp cmd_paste - paste a selection from the clipboard cmd_printsetup cmd_quit cmd_redo cmd_savepage cmd_scrollpagedown cmd_scrollpageup cmd_selectall cmd_swit...
showPopup - Archive of obsolete content
« xul reference home showpopup( element, x, y, popuptype, anchor, align ) deprecated since gecko 1.9 return type: no return value deprecated in favor of openpopup and openpopupatscreen opens a popup element.
... 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.
Sorting and filtering a custom tree view - Archive of obsolete content
this will not work for other types of trees, for example rdf-backed or ones created with dom methods.
...sort.xul <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <!doctype window> <window title="sorting a custom tree view example" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="init()"> <script type="application/javascript" src="sort.js"/> <hbox align="center" id="search-box"> <label accesskey="f" control="filter">filter</label> <textbox id="filter" oninput="inputfilter(event)" flex="1"/> <button id="clearfilter" oncommand="clearfilter()" label="clear" accesskey="c" disabled="true"/> </hbox> <tree id="tree" flex="1" persist="sortdirection sortresource"...
...for strings, lowercases them function prepareforcomparison(o) { if (typeof o == "string") { return o.tolowercase(); } return o; } function gettopvisiblerow() { return tree.treeboxobject.getfirstvisiblerow(); } function settopvisiblerow(topvisiblerow) { return tree.treeboxobject.scrolltorow(topvisiblerow); } function inputfilter(event) { //do this now rather than doing it at every comparison var value = prepareforcomparison(event.target.value); setfilter(v...
RDF Modifications - Archive of obsolete content
this involves a third type of observer involved in a template builder, an nsirdfobserver, used to listen for modifications to the rdf datasource.
...however, as it is possible to use and/or implement other query types with templates, these additional types may support automatic updating.
...this type of statement can only cause a change when an item is being added or removed from a container.
Static Content - Archive of obsolete content
<menulist datasources="template-guide-photos4.rdf" ref="http://www.daml.org/2001/09/countries/country-ont#country" oncommand="applyfilter(event.target.value);"> <menupopup> <menuitem label="all"/> </menupopup> <template> <query> <content uri="?start"/> <triple subject="?country" predicate="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" object="?start"/> <triple subject="?country" predicate="http://purl.org/dc/elements/1.1/title" object="?countrytitle"/> </query> <action> <menupopup> <menuitem uri="?country" label="?countrytitle" value="?country"/> </menupopup> </action> </template> </menulist> the only difference between the previous example and...
...the technique of looking for an existing element applies to any type of content.
... <radiogroup datasources="template-guide-photos4.rdf" ref="http://www.daml.org/2001/09/countries/country-ont#country" onselect="applyfilter(event.target.value);"> <radio label="all" selected="true"/> <template> <query> <content uri="?start"/> <triple subject="?country" predicate="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" object="?start"/> <triple subject="?country" predicate="http://purl.org/dc/elements/1.1/title" object="?countrytitle"/> </query> <action> <radio uri="?country" label="?countrytitle" value="?country"/> </action> </template> </radiogroup> this example doesn't have any other content to generate outside the radio element with the u...
Template Logging - Archive of obsolete content
template errors the second type of template error is a syntax error is the template rules, for example, a missing attribute or a tag out of place.
... these types of errors are also logged to the console, however, these types of errors are logged whether the logging flag is set or not.
... querytype attribute doesn't specify a valid query processor this error indicates that the querytype attribute is set to an unrecognized value.
Custom toolbar button - Archive of obsolete content
in the file, type some of the special characters that your language uses.
...check that the text you typed looks ok with this setting.
...paste it into the new file: <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/css" href="chrome://custombutton/content/button.css"?> <!doctype overlay > <overlay id="custombutton-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://custombutton/content/button.js"/> <!-- firefox --> <toolbarpalette id="browsertoolbarpalette"> <toolbarbutton id="custom-button-1"/> </toolbarpalet...
Adding HTML Elements - Archive of obsolete content
here is an example as it might be added to the find file window: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" orient="horizontal" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> then, you can use html tags as you would normally, keeping in mind the following: you must add a html: prefix to the beginning of each tag, assuming you declared the html namespace as ab...
...<html:img src="banner.jpg"/> <html:input type="checkbox" value="true"/> <html:table> <html:tr> <html:td> a simple table </html:td> </html:tr> </html:table> these examples will create an image from the file banner.jpg, a checkbox and a single-cell table.
... <html:p> <html:input id="rtd" type="checkbox"/> <html:label for="rtd">remember this decision</html:label> </html:p> </html:p> in this case, one p tag was used to place the text in and another was used to break apart the text into multiple lines.
Adding more elements - Archive of obsolete content
<hbox> <menulist id="searchtype"> <menupopup> <menuitem label="name"/> <menuitem label="size"/> <menuitem label="date modified"/> </menupopup> </menulist> <spacer style="width: 10px;"/> <menulist id="searchmode"> <menupopup> <menuitem label="is"/> <menuitem label="is not"/> </menupopup> </menulist> <spacer style="width: 10px;"/> <textbox id="find-text" flex="1" style="min-width: 15em;"/> </hbox> two drop down b...
...<spacer style="height: 10px"/> <hbox> <menulist id="searchtype"> <menupopup> <menuitem label="name"/> <menuitem label="size"/> <menuitem label="date modified"/> </menupopup> </menulist> <spacer style="width: 10px;"/> <menulist id="searchmode"> <menupopup> <menuitem label="is"/> <menuitem label="is not"/> </menupopup> </menulist> <spacer style="width: 10px;"/> <textbox id="find-text" flex="1" style="mi...
...let us change the box into a groupbox: <groupbox orient="horizontal"> <caption label="search criteria"/> <menulist id="searchtype"> .
List Controls - Archive of obsolete content
« previousnext » xul has a number of types of elements for creating list boxes.
...xul provides two types of elements to create lists, a listbox element to create multi-row list boxes, and a menulist element to create drop-down list boxes.
...for example, the url field in the browser has a drop-down for selecting previously typed urls, but you can also type them in yourself.
The Chrome URL - Archive of obsolete content
the chrome url xul files can be referenced with a regular http url (or any type of url) just like html files.
...another advantage over other url types is that they automatically handle multiple themes and locales.
...this type of reference will automatically select an appropriate file from that right directory.
Trees - Archive of obsolete content
ArchiveMozillaXULTutorialTrees
however, listboxes may contain any type of content, whereas trees may only contain text and images.
...for most trees, especially when you first start to use trees, you will use one of these built-in types.
...to disable multiple selection, place a seltype attribute on the tree, set to the value single.
XBL Inheritance - Archive of obsolete content
the autocomplete textbox adds extra event handling so that when a url is typed, a menu will pop up with possible completions.
...<textbox type="autocomplete" searchsessions="history"/> set the type to autocomplete to add the autocomplete feature to an existing textbox.
... set the searchsessions to indicate what type of data to look up.
Using multiple DTDs - Archive of obsolete content
normally you have a single dtd (document type definition) to localize a specific xul file.
... single dtd to make strings in your xul file localizable, you normally add a dtd declaration at the beginning of the file like this: <!doctype window system "chrome://myextension/locale/mainwindow.dtd"> where "window" is the local name of the document (root) element.
... assuming you have an entity called somebutton.label defined in mainwindow.dtd, you can access the entity like this: <button id="somebutton" label="&somebutton.label"> multiple dtds if you want to use multiple dtds with your xul file, you can simply list all of the dtds inside your dtd declaration: <!doctype window [ <!entity % commondtd system "chrome://myextensions/locale/common.dtd"> %commondtd; <!entity % mainwindowdtd system "chrome://myextension/locale/mainwindow.dtd"> %mainwindowdtd; ]> you can now access the entities declared in the dtds as shown above.
XUL Questions and Answers - Archive of obsolete content
the following is the code they wrote: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="test-window" title="check list test" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gat...re.is.only.xul"> <listbox rows="4"> <listhead> <listheader label="multi-column"/> </listhead> <listcols> <listcol flex="1"/> </listcols> <listitem> <listcell type="checkbox" value="1" label="vghkvghk"/> </listitem> <lis...
...titem> <listcell type="checkbox" value="2" label="vghjkvk" checked="true"/> </listitem> <listitem> <listcell type="checkbox" value="3" label="hukfzgjcfj" disabled="true"/> </listitem> </listbox> <listbox rows="4"> <listhead> <listheader label="single-column"/> </listhead> <listitem type="checkbox" value="1" label="vghkvghk"/> <listitem type="checkbox" value="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.
... while the attributes are always strings per the dom specification, the properties will eventually be fixed to return the value with the correct type.
XUL accessibility guidelines - Archive of obsolete content
accessibility is not difficult, but does require a basic understanding of the different types of disabilities, commonly used assistive technologies, and special accessibility features built into the xul languages.
... <label control="login-username" value="username:"/> <textbox id="login-username"/> <label control="login-password">password:</label> <textbox id="login-password" type="password"/> larger forms can be difficult to layout and structure.
...some users use mouth sticks or movement detection devices such as eye tracking to type.
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.
... 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".
... from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
binding - Archive of obsolete content
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties object type: string the object of the element.
... predicate type: uri the predicate or property to match.
... subject type: string the subject of the element.
bindings - Archive of obsolete content
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 object type: string the object of the element.
... predicate type: uri the predicate or property to match.
... subject type: string the subject of the element.
deck - Archive of obsolete content
ArchiveMozillaXULdeck
attributes selectedindex properties selectedindex, selectedpanel examples <deck selectedindex="2"> <description value="this is the first page"/> <button label="this is the second page"/> <box> <description value="this is the third page"/> <button label="this is also the third page"/> </box> </deck> attributes selectedindex type: integer gets and sets the index of the currently selected panel.
... from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties selectedindex type: integer returns the index of the currently selected item.
... selectedpanel type: element holds a reference to the currently selected panel within a deck element.
dialogheader - Archive of obsolete content
attributes crop, description, title examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog id="donothing" title="dialog example" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <dialogheader title="my dialog" description="example dialog"/> <!-- other widgets --> </dialog> attributes crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the...
...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.
listhead - Archive of obsolete content
attributes disabled properties acesssibletype, disabled examples (example needed) attributes disabled type: boolean indicates whether the element is disabled or not.
... from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties 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.
listheader - Archive of obsolete content
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.
... label type: string the label that will appear on the element.
... from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element.
observes - Archive of obsolete content
attributes attribute, element examples (example needed) attributes attribute type: attribute name the attribute that the observer is observing.
... element type: id the id of the broadcaster element that the observer is observing.
... from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
param - Archive of obsolete content
ArchiveMozillaXULparam
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.
... type type: one of the values below the type of the parameter's value integer 32 bit integer int64 64 bit integer double double-precision floating-point number string string literal, the default value 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 methods addeventlistener(), appendchild(), blur, click, clonenode(), comp...
query - Archive of obsolete content
ArchiveMozillaXULquery
the attributes and content of the query are dependent on the type of datasource being used.
... attributes expr examples (example needed) attributes expr type: string for xml queries, an xpath expression which returns results.
... from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
script - Archive of obsolete content
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.
... from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
separator - Archive of obsolete content
this type of separator should be used to separate parts of a dialog.
... 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.
... from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
template - Archive of obsolete content
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.
... member type: string may optionally be set to the variable to use as the member variable.
... from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
Debugging a XULRunner Application - Archive of obsolete content
add the following code to your xul app: components.utils.import('resource://gre/modules/devtools/dbg-server.jsm'); if (!debuggerserver.initialized) { debuggerserver.init(); // don't specify a window type parameter below if "navigator:browser" // is suitable for your app.
... debuggerserver.addbrowseractors("myxulrunnerappwindowtype"); } debuggerserver.openlistener(6000); for xulrunner version 37+ the code to enable the debugger has changed: components.utils.import('resource://gre/modules/devtools/dbg-server.jsm'); if (!debuggerserver.initialized) { debuggerserver.init(); debuggerserver.addbrowseractors(); debuggerserver.allowchromeprocess = true; } let dbglistener=debuggerserver.createlistener(); dbglistener.portorpath=6000; dbglistener.open(); add the following to your prefs.js: (in recent ffox, edit about:config instead) pref("devtools.debugger.remote-enabled", true); in firefox, go to tools > web developer > connect...
... function toopenwindowbytype is not defined if you get an error that "function toopenwindowbytype is not defined" you may add the following function to your scripts (doesn't seem to be in the venkman overlay): function toopenwindowbytype(intype, uri) { var winopts = "chrome,extrachrome,menubar,resizable,scrollbars,status,toolbar"; window.open(uri, "_blank", winopts); } i can't see my pages, functions ...
MacFAQ - Archive of obsolete content
to do this, type: xulrunner-bin --install-app /path/to/appdir note the path to your application must end with the directory containing application.ini; you should not reference application.ini in this command.
...s to your new "hiddenwindow" as such: "chrome://myxul/content/hiddenwindow.xul" next take the code below and drop it in, to create the hiddenwindow.xul (note: the debug function and nsicommandline try/catch can be removed, all you need is the window.arguments[0]) <?xml version="1.0"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="myxul_hidden" windowtype="myxul:hiddenwindow" title="" width="0" height="0" persist="screenx screeny width height sizemode" > <!-- load the mozilla helpers --> <script type="application/javascript" src="chrome://global/content/nsusersettings.js" /> <script><![cdata[ function debug(alogstring) { var mconsoleservice = components.classes["@mozilla.org/consoleservice;1"] ...
... .getservice(components.interfaces.nsiconsoleservice) mconsoleservice.logstringmessage("myxul: " + alogstring + "\n"); } function checkotherwindows() { var singletonwindowtype = nspreferences.copyunicharpref("toolkit.singletonwindowtype"); var windowmediator = components.classes["@mozilla.org/appshell/window-mediator;1"] .getservice(components.interfaces.nsiwindowmediator); var win = windowmediator.getmostrecentwindow(singletonwindowtype); if (win) { window.close(); win.focus(); } } if (window.arguments && window.arguments[0]){ try { var cmdline = window.arguments[0] .queryinterface(components.interfaces.nsicommandline); for (var i = 0; ...
2006-10-27 - Archive of obsolete content
./configure --prefix=/export/home/alex/thunderbird --enable-application=browser --disable-tests --disable-debug -disable-auto-deps --disable-freetype2 -enable-official-branding --enable-default-toolkit=gtk2 --enable-optimize=-xo5 --enable-static --disable-shared --enable-xft --enable-svg the build tools that he used to build firefox 2 are listed in his posting along with the error that he receives when he tries to build it.
... peter weilbacher responded to alex's posting on the same day, stating that he is not sure what packaging system solaris 10 x86 uses but thinks that he might need to install the developer packages of x and/or xrender and freetype which should contain the libxrender.* and libfreetype.* files that are need for the linking.
... moz_cairo_libs = -l$(libxul_dist)/lib -lmozcairo -lmozlibpixman \ -l/usr/sfw/lib -lxrender -lfreetype -lfontconfig october 27: alex replied to masaki posting, stating that he was going to use the work around that he provided and would provide feedback if it was successful or not.
NPClass - Archive of obsolete content
function pointer syntax typedef npobject *(*npallocatefunctionptr)(npp npp, npclass *aclass); typedef void (*npdeallocatefunctionptr)(npobject *npobj); typedef void (*npinvalidatefunctionptr)(npobject *npobj); typedef bool (*nphasmethodfunctionptr)(npobject *npobj, npidentifier name); typedef bool (*npinvokefunctionptr)(npobject *npobj, npidentifier name, const npvariant *args, uint32_t ar...
...gcount, npvariant *result); typedef bool (*npinvokedefaultfunctionptr)(npobject *npobj, const npvariant *args, uint32_t argcount, npvariant *result); typedef bool (*nphaspropertyfunctionptr)(npobject *npobj, npidentifier name); typedef bool (*npgetpropertyfunctionptr)(npobject *npobj, npidentifier name, npvariant *result); typedef bool (*npsetpropertyfunctionptr)(npobject *npobj, npidentifier name, const npvariant *value); typedef bool (*npremovepropertyfunctionptr)(npobject *npobj, npidentifier name); typed...
...ef bool (*npenumerationfunctionptr)(npobject *npobj, npidentifier **value, uint32_t *count); typedef bool (*npconstructfunctionptr)(npobject *npobj, const npvariant *args, uint32_t argcount, npvariant *result); see also npobject ...
NPN_SetValueForURL - Archive of obsolete content
(while the api theoretically allows the preferred proxy for a given url to be changed, doing so does not have much meaning given how proxies are configured, and is not supported.) syntax #include <npapi.h> typedef enum { npnurlvcookie = 501, npnurlvproxy } npnurlvariable; nperror npn_setvalueforurl(npp instance, npnurlvariable variable, const char *url, const char *value, uint32_t len); parameters this function has the following parameters: instance pointer to the current plug-in instance.
... variable selects the type of information to be changed.
... the only supported type is npnurlvcookie.
NPRegion - Archive of obsolete content
syntax windows: typedef hrgn npregion; mac os x: typedef rgnhandle npregion; note: this may need to be updated for the cocoa event model.
... xwindows: typedef region npregion; description npregion defines the region of the plug-in window to be updated, painted, invalidated, or clipped to.
... for information about the region type definition used by your platform, see your platform documentation.
Syndicating content with RSS - Archive of obsolete content
when this is the case, the html web page can let people and machines know about the feed by using the <link> element, like this: <link rel="alternate" type="application/rss+xml" href="http://example.com/feed" /> adding the <a> while use of the html <link> element is powerful, it is mostly hidden.
... linking from the the html web page where the data in an rss feed is also contained makes the rss feed available for use: <a rel="alternate" type="application/rss+xml" href="http://example.com/feed">...</a> feed icons rss (and other) feeds use a special icon.
... the http protocol, one of the core technologies behind the web, provides a way of prioritizing the content type that an http client prefers to receive.
What is RSS - Archive of obsolete content
you want to.</description> <lastbuilddate>tue, 23 aug 2005 21:02:05 -0800</lastbuilddate> <link>http://katetv.example.com/</link> <item> <title>this is fun</title> <guid>http://katetv.example.com/show/4</guid> <pubdate>tue, 23 aug 2005 21:02:05 -0800</pubdate> <enclosure url="http://katetv.example.com/show/4" length="1911146" type="application/ogg"/> </item> <item> <title>watch this</title> <guid>http://katetv.example.com/show/3</guid> <pubdate>tue, 16 aug 2005 16:11:57 -0400</pubdate> <enclosure url="http://katetv.example.com/show/3" length="1387442" type="application/ogg"/> </item> <item> <title>it is me again</title> ...
...<guid>http://katetv.example.com/show/2</guid> <pubdate>tue, 9 aug 2005 13:12:12 -0400</pubdate> <enclosure url="http://katetv.example.com/show/2" length="1894877" type="video/mpeg"/> </item> <item> <title>hello</title> <guid>http://katetv.example.com/show/1</guid> <pubdate>tue, 2 aug 2005 18:22:14 -0400</pubdate> <enclosure url="http://katetv.example.com/show/1" length="17442215" type="application/ogg"/> </item> </channel> </rss> the observant reader may have noticed that the news web site and blogger examples were the same type of rss.
... and also that the internet radio and internet television examples were the same type of rss.
TCP/IP Security - Archive of obsolete content
data link layer controls for dedicated circuits are most often provided by specialized hardware devices known as data link encryptors; data link layer controls for other types of connections, such as dial-up modem communications, are usually provided through software.
... transport layer protocols such as ssl are most commonly used to provide security for communications with individual http-based applications, although they are also used to provide protection for communication sessions of other types of applications such as smtp, point of presence (pop), internet message access protocol (imap), and file transfer protocol (ftp).
... depending on how ssl is implemented and configured, it can provide any combination of the following types of protection: confidentiality.
Theme changes in Firefox 2 - Archive of obsolete content
menu.css the following style is no longer used in firefox 2 and has been removed: menulist > menupopup > menuitem[_moz-menuactive="true"] the firefox 2 theme also adds the following new styles: .menu-iconic-icon menubar > menu menubar > menu[_moz-menuactive="true"][open="true"] menuitem[type="checkbox"] > .menu-iconic-left menuitem[type="radio"] > .menu-iconic-left you may wish to change the definitions of other styles as well.
...you should define the following styles: .messagebutton .messageclosebutton .messageimage .messagetext .notification-inner notification notification[type="info"] notification[type="warning"] notification[type="critical"] scrollbox.css the following new styles have been added to this file for firefox 2 themes: .autorepeatbutton-down[disabled="true"] .autorepeatbutton-down[orient="horizontal"] .autorepeatbutton-down[orient="horizontal"][disabled="true"] .autorepeatbutton-up[disabled="true"] .autorepeatbutton-up[orient="horizontal"] .aut...
....updatecategoryicon .updatecategorylabel[selected="true"] .updateicon .updateicon[severity="0"] .updateicon[severity="1"] .updateicon[severity="2"] .updateindicator > label .updateindicator[updatecount="0"] .updateitemchecked .updateitemchecked .checkbox-label-box .updateitemfromlabel .updateitemicon .updateitemicon .updateitemname .updateitemnamerow .updateitemurl .warning radio[type="update-type"] radiogroup[type="update-types"] toolbarbutton[type="updates"] toolbarbutton[type="updates"] > .toolbarbutton-icon toolbarbutton[type="updates"][severity="0"] > .toolbarbutton-icon toolbarbutton[type="updates"][severity="1"] > .toolbarbutton-icon toolbarbutton[type="updates"][severity="2"] > .toolbarbutton-icon toolbarbutton[type="updates"][updatecount="0"] updateitem the ...
-ms-scroll-snap-points-x - Archive of obsolete content
initial valuesnapinterval(0px, 100%)applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values note: a <length-percentage> is a value that can be either a <length> or a <percentaqe>.
... formal syntax snapinterval( <length-percentage>, <length-percentage> ) | snaplist( <length-percentage># )where <length-percentage> = <length> | <percentage> examples this example demonstrates both types of values for the -ms-scroll-snap-points-x property.
...(the -ms-scroll-snap-points-x property behaves identically to the -ms-scroll-snap-points-y property, but along the x-axis.) .container { overflow-x: auto; overflow-y: hidden; -ms-scroll-snap-type: mandatory; -ms-scroll-snap-points-x: snapinterval(0%, 100%); width: 480px; height: 270px; } .imagecontainer { -ms-scroll-chaining: chained; -ms-overflow-style: none; -ms-content-zooming: zoom; -ms-scroll-rails: none; -ms-scroll-limit-x-min: 100%; -ms-scroll-limit-x-max: 500%; -ms-scroll-snap-type: proximity; -ms-scroll-snap-points-x: snaplist(100%, 200%, 300%, 400%, 500%); -ms-overflow-styl...
-ms-scroll-snap-points-y - Archive of obsolete content
initial valuesnapinterval(0px, 100%)applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values note: a <length-percentage> is a value that can be either a <length> or a <percentaqe>.
... formal syntax snapinterval( <length-percentage>, <length-percentage> ) | snaplist( <length-percentage># )where <length-percentage> = <length> | <percentage> examples this example demonstrates both types of values for the -ms-scroll-snap-points-y property.
...(the -ms-scroll-snap-points-y property behaves identically to the -ms-scroll-snap-points-x property, but along the y-axis.) .container { overflow-x: auto; overflow-y: hidden; -ms-scroll-snap-type: mandatory; -ms-scroll-snap-points-y: snapinterval(0%, 100%); width: 480px; height: 270px; } .imagecontainer { -ms-scroll-chaining: chained; -ms-overflow-style: none; -ms-content-zooming: zoom; -ms-scroll-rails: none; -ms-scroll-limit-y-min: 100%; -ms-scroll-limit-y-max: 500%; -ms-scroll-snap-type: proximity; -ms-scroll-snap-points-y: snaplist(100%, 200%, 300%, 400%, 500%); -ms-overflow-styl...
::-ms-check - Archive of obsolete content
the ::-ms-check css pseudo-element is a microsoft extension that represents checkboxes and radio button groups created by <input type="checkbox"> and <input type="radio">.
...ay (values block, inline-block, none) @font-face font-size font-style font-weight height margin-bottom margin-left margin-right margin-top opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin visibility width syntax ::-ms-check example html <form> <label for="redbutton">red</label> <input type="radio" id="redbutton"><br> <label for="greencheckbox">green</label> <input type="checkbox" id="greencheckbox"> </form> css input, label { display: inline; } input[type=radio]::-ms-check { border-color: red; /* this will make the border red when the button is checked.
...*/ } input[type=checkbox]::-ms-check { border-color: green; /* this will make the box green when the button is checked.
Accessing XML children - Archive of obsolete content
can also be used to replace particular child nodes var elem1 = <foo> <bar/> </foo>; var elem2 = <red> <blue/> </red>; elem1.bar = elem2; replaces the <bar/> element with all of the content in elem2, giving: <foo> <red> <blue/> </red> <foo> xml lists many times, however, a single element will have two or more children of the same type.
... in this case, accessing foo.bar will return an xml list object, of all child elements of the type "bar".
... list[1] = "green"; changes the xml document to read <foo> <bar baz="1">red</bar> <bar baz="2">green</bar> </foo> special types of nodes xml objects have methods for accessing xml lists of certain common types of nodes as well.
Iterator - Archive of obsolete content
keyonly if keyonly is truthy value, iterator.prototype.next returns property_name only.
... 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.
ECMAScript 2016 to ES.Next support in Mozilla - Archive of obsolete content
ecmascript 2016 array.prototype.includes() (firefox 43) typedarray.prototype.includes() (firefox 43) exponentiation operator (firefox 52) ecmascript 2017 object.values() (firefox 47) object.entries() (firefox 47) string.prototype.padstart() (firefox 48) string.prototype.padend() (firefox 48) object.getownpropertydescriptors() (firefox 50) async functions async function (firefox 52) async function expression...
... additions to the arraybuffer object arraybuffer.transfer() (spec) new typedobject objects based on typed objects draft, and exposed via a global typedobject object, e.g.
... typedobject.structtype & typedobject.arraytype.
Debug.msUpdateAsyncCallbackRelation - Archive of obsolete content
syntax debug.msupdateasynccallbackrelation(relatedasyncoperationid, relationtype) parameters relatedasyncoperationid the id associated with the asynchronous operation.
... relationtype optional the value that specifies the relationship status.
... the possible values for relationtype include: debug.ms_async_callback_status_assign_delegate debug.ms_async_callback_status_join debug.ms_async_callback_status_chooseany debug.ms_async_callback_status_cancel debug.ms_async_callback_status_error for more information, see debug constants.
New in JavaScript 1.8.5 - Archive of obsolete content
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 510537 date.prototype.tojson() returns a json format string for a date object.
... function.prototype.bind() creates a new function that, when called, itself calls this function in the context provided (with a given sequence of arguments).
JSObject - Archive of obsolete content
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.
... any javascript data brought into java is converted to java data types.
...see the core javascript 1.5 guide for more information about data type conversions.
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
listing 5 - demonstration of server-proxy <script runat="server"> function notexposed() { // runs on the server, hidden from the browser return "can't see me!"; } function exposed() { // runs on the server, callable from the browser return "exposed to the browser"; } exposed.proxy = true; // tell jaxer this function is ok to be called from the browser </script> <script runat="client" type="text/javascript"> alert( exposed() ); //works like a charm alert( notexposed() ); //produces an object not found error since it server-side only </script> understanding the concept of operating context in jaxer is central to moving forward with the example application which is what we'll examine next.
... listing 6 - creating the user interface <link href="/jaxer_examples/js/ext-2.1/resources/css/ext-all.css" type="text/css" rel="stylesheet"/> <script src="/jaxer_examples/js/ext-2.1/adapter/ext/ext-base.js"/> <script src="/jaxer_examples/js/ext-2.1/ext-all.js"/> <link href="/jaxer_examples/css/main.css" type="text/css" rel="stylesheet"/> <script runat="both" src="/jaxer_examples/js/validatecomments.js"/> <script> var txt_name; var txt_email; var txt_message; var btn_comments; var form_comments; ext.onr...
...you can see the field names and data types which make sense for the type of data that's been added.
XForms Secret Element - Archive of obsolete content
each character typed by the user is represented by an asterisk on the screen (see the spec).
... type restrictions the secret element can be bound to a node containing simple content of any data type except xsd:base64binary, xsd:hexbinray or any data type derived from these.
...characteristics analogous widgets are <xhtml:input type="password"/> and <xul:textbox type="password"/> if the incremental attribute is present and has the value true, then the bound instance node is updated on every user input.
XForms Select Element - Archive of obsolete content
attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control.
... incremental - supported, default value is true properties selection - see corresponding attribute incremental - see corresponding attribute type restrictions the select element can be bound to a node containing simple content capable of holding a sequence.
...characteristics analogous widgets are <html:select size="5" multiple="true"/> and <xul:listbox seltype="multiple"/> visual grouping by choices element isn't implemented if incremental attribute value is false, the bound node is updated when the select control is blurred (i.e.
XForms Submit Element - Archive of obsolete content
attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control.
... type restrictions the submit element can be bound to a node containing data of any type.
...characteristics analogous widgets are <html:input type="submit"/> and <xul:button/> link/clickable text xforms authors can use this representation if they want to have a widget like a xhtml anchor (xhtml only).
Fixing Table Inheritance in Quirks Mode - Archive of obsolete content
for example, if an author writes: <style type="text/css"> body {font-size: 11px;} </style> ...then the text inside table cells should also be 11 pixels in size.
...this represented a violation of css inheritance rules, and led many authors to create workarounds such as: <style type="text/css"> body, table, td {font-size: 11px;} </style> recreating legacy behavior to avoid "breaking" older pages that were authored with old-browser behaviors in mind, mozilla and related browsers will mimic old browsers when in "quirks" mode.
... related resources mozilla's doctype sniffing original document information author(s): eric a.
RDF in Mozilla FAQ - Archive of obsolete content
statements about the same rdf resource can then be intermingled: for example, the "last visit date" of a particular website comes from the "browser global history" datasource, and the "shortcut keyword" that you can type to reach that website comes from the "browser bookmarks" datasource.
... the most common cause for rdf/xml not to load from a web server is incorrect mime type.
...if xul isn't loading your rdf, and the mimetype is ok, this could well be your problem.
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
so the plugin project should be aware of two new additions to nppvariable enumeration type which are now defined in npapi.h as: nppvpluginscriptableinstance = 10, nppvpluginscriptableiid = 11 and two analogous additions to nsplugininstancevariable type in nsplugindefs.h as: nsplugininstancevariable_scriptableinstance = 10, nsplugininstancevariable_scriptableiid = 11 what's in the plugin code?
... how to call plugin native methods the following html code will do the job:</p> this should be changed, we shouldn't advocate embed <embed type="application/plugin-mimetype"> <script language="javascript"> var embed = document.embeds[0]; embed.nativemethod(); </script> how to build and install having the built mozilla tree is probably not necessary, but building the plugin with a scriptable instance interface will require mozilla headers and the xpcom compatible idl compiler -- xpidl.exe.
...npp_getvalue implementation and possible scenario of scriptable object life cycle #include "nsitestplugin.h" nperror npp_new(npmimetype plugintype, npp instance, uint16 mode, int16 argc, char* argn[], char* argv[], npsaveddata* saved) { if(instance == null) return nperr_invalid_instance_error; // just prime instance->pdata with null for the purpose of this example // it will be assigned to the scriptable interface later to keep its // association with the specific plugin instance instanc...
Game distribution - Game development
web and native stores you can also upload and publish your game directly to different types of stores, or marketplaces.
...see marketplaces — distribution platforms for more details of what marketplace types are available.
... if you're looking for more information about the different types of app stores you can check the list of mobile software distribution platforms article on wikipedia.
2D collision detection - Game development
algorithms to detect collision in 2d games depend on the type of shapes that can collide (e.g.
...green means collision, blue means no collision.</p> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/crafty/0.5.4/crafty-min.js"></script> crafty.init(200, 200); var dim1 = {x: 5, y: 5, w: 50, h: 50} var dim2 = {x: 20, y: 10, w: 60, h: 40} var rect1 = crafty.e("2d, canvas, color").attr(dim1).color("red"); var rect2 = crafty.e("2d, canvas, color, keyboard, fourway").fourway(2).attr(dim2).color("blue"); rect2.bind("enterframe", fu...
...green means collision, blue means no collision.</p> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/crafty/0.5.4/crafty-min.js"></script> #cr-stage { position: static !important; height: 200px !important; } crafty.init(200, 200); var dim1 = {x: 5, y: 5} var dim2 = {x: 20, y: 20} crafty.c("circle", { circle: function(radius, color) { this.radius = radius; this.w = this.h = radius * 2; this.colo...
BigInt - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript, bigint is a numeric data type that can represent integers in the arbitrary precision format.
... in other programming languages different numeric types can exist, for examples: integers, floats, doubles, or bignums.
... learn more general knowledge numeric types on wikipedia technical reference the javascript data structure: bigint the javascript global object bigint ...
CORS-safelisted request header - MDN Web Docs Glossary: Definitions of Web-related terms
a cors-safelisted request header is one of the following http headers: accept, accept-language, content-language, content-type.
... for accept and content-type: can't contain a cors-unsafe request header byte: 0x00-0x1f (except 0x09 (ht)), "():<>?@[\]{}, and 0x7f (del).
... for content-type: needs to have a mime type of its parsed value (ignoring parameters) of either application/x-www-form-urlencoded, multipart/form-data, or text/plain.
Number - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript, number is a numeric data type in the double-precision 64-bit floating point format (ieee 754).
... in other programming languages different numeric types exist; for example, integers, floats, doubles, or bignums.
... learn more general knowledge numeric types on wikipedia technical reference the javascript data structure: number the javascript global object number ...
Static typing - MDN Web Docs Glossary: Definitions of Web-related terms
a statically-typed language is a language (such as java, c, or c++) where variable types are known at compile time.
... in most of these languages, types must be expressly indicated by the programmer; in other cases (such as ocaml), type inference allows the programmer to not indicate their variable types.
... learn more general knowledge type system on wikipedia ...
Organizing your CSS - Learn web development
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.
...for example, look at the classes applied to this html from the page about bem naming conventions: <form class="form form--theme-xmas form--simple"> <input class="form__input" type="text" /> <input class="form__submit form__submit--disabled" type="submit" /> </form> the additional classes are similar to those used in the oocss example, however they use the strict naming conventions of bem.
... previous overview: building blocks in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Styling tables - Learn web development
link the css to the html by placing the following line of html inside your <head>: <link href="style.css" rel="stylesheet" type="text/css"> spacing and layout the first thing we need to do is sort out the spacing/layout — default table styling is so cramped!
... first, add the following <link> element into your html head, just above your existing <link> element: <link href='https://fonts.googleapis.com/css?family=rock+salt' rel='stylesheet' type='text/css'> now add the following css into your style.css file, below the previous addition: /* typography */ html { font-family: 'helvetica neue', helvetica, arial, sans-serif; } thead th, tfoot th { font-family: 'rock salt', cursive; } th { letter-spacing: 2px; } td { letter-spacing: 1px; } tbody td { text-align: center; } tfoot th { text-align: right; } there is nothing re...
... previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
CSS building blocks - Learn web development
this module looks at the cascade and inheritance, all the selector types we have available, units, sizing, styling backgrounds and borders, debugging, and lots more.
...in this article and its sub-articles, we'll run through the different types in great detail, seeing how they work.
... the sub-articles are as follows: type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model everything in css has a box around it, and understanding these boxes is key to being able to create layouts with css, or to align items with other items.
What is the difference between webpage, website, web server, and search engine? - Learn web development
a web page can embed a variety of different types of resources such as: style information — controlling a page's look-and-feel scripts — which add interactivity to the page media — images, sounds, and videos.
...to access a page, just type its address in your browser address bar: web site a website is a collection of linked web pages (plus their associated resources) that share a unique domain name.
... to access a website, type its domain name in your browser address bar, and the browser will display the website's main web page, or homepage (casually referred as "the home"): the ideas of a web page and a website are especially easy to confuse for a website that contains only one web page.
How do I use GitHub Pages? - Learn web development
here's what you'd type if you've put your website in a directory called test-site on your desktop: cd desktop/test-site when the command line is pointing inside your website directory, type the following command, which tells the git tool to turn the directory into a git repository: git init an aside on command line interfaces the best way to upload your code to github is via the command line — this is a ...
...window where you type in commands to do things like create files and run programs, rather than clicking inside a user interface.
...the command should look something like this: git remote add origin https://github.com/chrisdavidmills/my-repository.git next, type the following two commands, pressing enter after each one.
What are hyperlinks? - Learn web development
being human-readable, urls already made things easier, but it's hard to type a long url whenever you want to access a document.
...in the rest of this article, we discuss the various types of links and their importance to modern web design.
...that said, there are some nuances worth considering: types of links internal link a link between two webpages, where both webpages belong to the same website, is called an internal link.
What is a Domain Name? - Learn web development
alternatively, if you use a system with a built-in shell, type a whois command into it, as shown here for mozilla.org: $ whois mozilla.org domain name:mozilla.org domain id: d1409563-lror creation date: 1998-01-24t05:00:00z updated date: 2013-12-08t01:16:57z registry expiry date: 2015-01-23t05:00:00z sponsoring registrar:markmonitor inc.
... as we already saw, when you want to display a webpage in your browser it's easier to type a domain name than an ip address.
... let's take a look at the process: type mozilla.org in your browser's location bar.
How to build custom form controls - Learn web development
because nodelist really looks like an array and because foreach is so convenient to use, we can easily add the support of foreach to nodelist in order to make our life easier, like so: nodelist.prototype.foreach = function (callback) { array.prototype.foreach.call(this, callback); } if you need to support legacy browsers, ensure the browsers support these features.
... <fieldset> <legend>pick a fruit</legend> <ul class="styledselect"> <li><input type="radio" name="fruit" value="cherry" id="fruitcherry" checked><label for="fruitcherry">cherry</label></li> <li><input type="radio" name="fruit" value="lemon" id="fruitlemon"><label for="fruitlemon">lemon</label></li> <li><input type="radio" name="fruit" value="banana" id="fruitbanana"><label for="fruitbanana"">banana</label></li> <li><input type="radio" name="fruit" value="strawb...
...erry" id="fruitstrawberry"><label for="fruitstrawberry">strawberry</label></li> <li><input type="radio" name="fruit" value="apple" id="fruitapple"><label for="fruitapple">apple</label></li> </ul> </fieldset> we'll do a little styling of the radio button list (not the legend/fieldset) to make it look somewhat like the earlier example, just to show that it can be done: .styledselect { display: inline-block; padding: 0; } .styledselect li { list-style-type: none; padding: 0; display: flex; } .styledselect [type=radio] { position: absolute; left: -100vw; top: -100vh; } .styledselect label { margin: 0; line-height: 2; padding: 0 0 0 4px; } .styledselect:not(:focus-within) input:not(:checked) + label { height: 0; outline: none; overflow: hidden; } .styledse...
CSS basics - Learn web development
for example: p, li, h1 { color: red; } different types of selectors there are many different types of selectors.
... the examples above use element selectors, which select all elements of a given type.
...here are some of the more common types of selectors: selector name what does it select example element selector (sometimes called a tag or type selector) all html elements of the specified type.
Dealing with files - Learn web development
note: on windows computers, you might have trouble seeing the file names, because windows has an option called hide extensions for known file types turned on by default.
...option, unchecking the hide extensions for known file types check box, then clicking ok.
... <!doctype html> <html> <head> <meta charset="utf-8"> <title>my test page</title> </head> <body> <img src="" alt="my test image"> </body> </html> the line <img src="" alt="my test image"> is the html code that inserts an image into the page.
HTML basics - Learn web development
let's revisit the code we put into our index.html example (which we first met in the dealing with files article): <!doctype html> <html> <head> <meta charset="utf-8"> <title>my test page</title> </head> <body> <img src="images/firefox-icon.png" alt="my test image"> </body> </html> here, we have the following: <!doctype html> — the doctype.
...in the mists of time, when html was young (around 1991/92), doctypes were meant to act as links to a set of rules that the html page had to follow to be considered good html, which could mean automatic error checking and other useful things.
...the most common list types are ordered and unordered lists: unordered lists are for lists where the order of the items doesn't matter, such as a shopping list.
Responsive images - Learn web development
however, they aren't suitable for all image types.
...you can supply mime types inside type attributes so the browser can immediately reject unsupported file types: <picture> <source type="image/svg+xml" srcset="pyramid.svg"> <source type="image/webp" srcset="pyramid.webp"> <img src="pyramid.png" alt="regular pyramid built from four equilateral triangles"> </picture> do not use the media attribute, unless you also need art direction.
... in a <source> element, you can only refer to images of the type declared in type.
Video and Audio APIs - Learn web development
as we showed in video and audio content, a typical implementation looks like this: <video controls> <source src="rabbit320.mp4" type="video/mp4"> <source src="rabbit320.webm" type="video/webm"> <p>your browser doesn't support html5 video.
...you'll see a number of features; the html is dominated by the video player and its controls: <div class="player"> <video controls> <source src="video/sintel-short.mp4" type="video/mp4"> <source src="video/sintel-short.webm" type="video/webm"> <!-- fallback content here --> </video> <div class="controls"> <button class="play" data-icon="p" aria-label="play pause toggle"></button> <button class="stop" data-icon="s" aria-label="stop"></button> <div class="timer"> <div></div> <span aria-label="timer">00:00</span> </div> <butto...
... next, let's look at our button icons: @font-face { font-family: 'heydingscontrolsregular'; src: url('fonts/heydings_controls-webfont.eot'); src: url('fonts/heydings_controls-webfont.eot?#iefix') format('embedded-opentype'), url('fonts/heydings_controls-webfont.woff') format('woff'), url('fonts/heydings_controls-webfont.ttf') format('truetype'); font-weight: normal; font-style: normal; } button:before { font-family: heydingscontrolsregular; font-size: 20px; position: relative; content: attr(data-icon); color: #aaa; text-shadow: 1px 1px 0px black; } first of all, at the top of th...
JavaScript object basics - Learn web development
while working with this example you should have your developer tools javascript console open and ready to type in some commands.
...let's say we wanted users to be able to store custom value types in their people data, by typing the member name and value into two text inputs.
... overview: objects next in this module object basics object-oriented javascript for beginners object prototypes inheritance in javascript working with json data object building practice adding features to our bouncing balls demo ...
Aprender y obtener ayuda - Learn web development
different learning materials it is also worth looking at the different types of learning materials that are available, to see which ones are most effective for you to learn with.
...some of the articles will be tutorials, to teach you a certain technique or important concept (such as "learn how to create a video player" or "learn the css box model"), and some of the articles will be reference material, to allow you to look up details you may have forgotten (such as "what is the syntax of the css background property"?) mdn web docs is very good for both types — the area you are currently in is great for learning techniques and concepts, and we also have several giant reference sections allowing you to look up any syntax you can't remember.
...solution like this: a nav menu is usually created from a list of links, something like: <ul> <li>first menu item</li> <li>second menu item</li> <li>third menu item</li> <li>etc.</li> </ul> to make all the items sit horizontally on a line, the easiest modern way is to use flexbox: ul { display: flex; } to remove unneeded spacing and bullet points, we can do this: ul { list-style-type: none; padding: 0; } etc.
Ember Interactivity: Footer functionality, conditional rendering - Learn web development
first of all, replace this line: <strong>0</strong> todos left with this, which populates the incomplete number with the length of the incomplete array: <strong>{{this.todos.incomplete.length}}</strong> todos left next, replace this: <button type="button" class="clear-completed"> with this: <button type="button" class="clear-completed" {{on 'click' this.todos.clearcompleted}}> so now when the button is clicked, the clearcompleted() action we added earlier is run.
... in todo.hbs, first find the following line: <li> and replace it with this — you'll notice that here we're using some more conditional content to add the class value if appropriate: <li class="{{ if @todo.iscompleted 'completed' }}"> next, find the following line: <input aria-label="toggle the completion of this todo" class="toggle" type="checkbox" > and replace it with this: <input class="toggle" type="checkbox" aria-label="toggle the completion of this todo" checked={{ @todo.iscompleted }} {{ on 'change' (fn this.todos.togglecompletion @todo) }} > note: the above snippet uses a new ember-specific keyword — fn.
... 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 svelte deployment and next steps ...
Working with Svelte stores - Learn web development
in the next article we will learn how add typescript support to our svelte application.
... to take advantage of all its features, we will also port our entire application to typescript.
... 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 svelte deployment and next steps ...
Focus management with Vue refs - Learn web development
update it like this: <button type="button" class="btn" ref="editbutton" @click="toggletoitemeditform"> edit <span class="visually-hidden">{{label}}</span> </button> to access the value associated with our ref, we use the $refs property provided on our component instance.
... in todoitemeditform.vue, attach ref="labelinput" to the <input> element, like so: <input :id="id" ref="labelinput" type="text" autocomplete="off" v-model.lazy.trim="newname" /> next, add a mounted() property just inside your component object — note that this should not be put inside the methods property, but rather at the same hierarchy level as props, data(), and methods.
... 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 svelte deployment and next steps ...
Rendering a list of Vue components - Learn web development
make it required, and make its type a string.
... the <script> contents in your todoitem component should now look something like this: export default { props: { label: {required: true, type: string}, done: {default: false, type: boolean}, id: {required: true, type: string} }, data() { return { isdone : this.done, } }, } now, over in your app.vue component, pass item.id as a prop to the todoitem component.
... 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 svelte deployment and next steps ...
Introduction to automated testing - Learn web development
type yes and press enter/return and npm will generate a package.json file in your directory.
... note: the * character is a wildcard character — here we're saying "run these tasks when any files of these types are saved.
... in the next screen, type in the url of a page you want to test (use http://mdn.github.io/learning-area/javascript/building-blocks/events/show-video-box-fixed.html, for example), then choose a browser/os combination you want to test by using the different buttons and lists.
Introducing a complete toolchain - Learn web development
jsx or typescript) in our development process, and then transforms our code so that the production version still runs on a wide variety of browsers, modern and older.
... next up, we’ll configure eslint — create another file in the root of your will-it-miss directory called .eslintrc.json, and give it the following contents: { "env": { "es6": true, "browser": true }, "extends": "eslint:recommended", "parseroptions": { "ecmaversion": 6, "sourcetype": "module" }, "rules": { "no-console": 0 } } the above eslint configuration says that we want to use the "recommended" eslint settings, that we're going to allow usage of es6 features (such as map() or set()), that we can use module import statements, and that using console.log() is allowed.
... the final config file should look like this — add in the bolded parts and save it: { "env": { "es6": true, "browser": true }, "extends": ["eslint:recommended", "plugin:react/recommended"], "parseroptions": { "ecmaversion": 6, "sourcetype": "module", "ecmafeatures": { "jsx": true } }, "plugins": ["react"], "rules": { "semi": "error", "no-console": 0, "react/jsx-uses-vars": "error" } } as the configuration now uses a plugin called "react", this development dependency also needs to be installed, so that the code is there to actually run that part of the linting process.
Tools and testing - Learn web development
working out what tools you should be using can be a difficult process, so we have written this set of articles to inform you of what types of tool are available, what they can do for you, and how to make use of the current industry favourites.
... modules understanding client-side web development tools client-side tooling can be intimidating, but this series of articles aims to illustrate the purpose of some of the most common client-side tool types, explain the tools you can chain together, how to install them using package managers, and control them using the command line.
...what users, browsers and devices do you most need to worry about?), how to go about testing, the main issues that you'll face with different types of code and how to fix/mitigate those, what tools are most useful in helping you test and fix problems, and how to use automation to speed up testing.
Mozilla accessibility architecture
traversal method → nsaccessibletreewalker method which traverses dom & anonymous content → nsiaccessibilityservice::getaccessible() with the content node → nsdocaccessible::getcachedaccessnode() and returns if successful, or → nsiaccessibleprovider::getaccessible() (if xul) or → nsiframe::getaccessible() (if html), which either return nothing or → nsiaccessibilityservice::create[inserttypenamehere]accessible() → operator new, which finally constructs the object.
... whether via nsiaccessibleprovider::getaccessible() or nsiframe::getaccessible(), new accessibles are created by calling back to the accessibility service, and using a specific method for creating each type of accessible.
... gecko events (or callback) event type accessibility event focus, select standard html dom event event_focus dommenuitemactive, dommenubaractive mozilla dom event_focus domnodeinserted w3c dom mutation event event_create (atk) event_reorder (msaa) domsubtreemodified w3c dom mutation event event_reorder ...
CSUN Firefox Materials
" - alan cantor, cantor access consulting (http://www.cantoraccess.com) firefox includes keyboard access to all of its amazing features: find as you type allows for quick navigation to links and text searching without opening a separate dialog -- this allows more convenient use by screen magnification users because there is a single point of regard for the search.
... it also assists users of input aids because there are far fewer keys to type to get the desired location.
... bookmarks can have a keyword assigned to them which can be typed into the address bar to bring up the bookmark.
Continuous Integration
when you push a commit to mozilla-central or a related repository, it initiates a large chain of builds and tests across multiple types of infrastructure.
... the label text indicates the job type.
... for a full list of job types, see the help menu in treeherder's upper-right corner.
Creating a spell check dictionary add-on
<?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:id>locale-code@dictionaries.addons.mozilla.org</em:id> <em:version>version number</em:version> <em:type>64</em:type> <em:unpack>true</em:unpack> <em:name>name</em:name> <!-- other install.rdf metadata such as em:localized, em:description, em:creator, em:developer, em:translator, em:contributor or em:homepageurl --> <!-- firefox --> <em:targetapplication> <description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:min...
... don't change em:type or em:unpack, and don't add a em:bootstrap element.
... type = 64 indicates that the add-on is in the restartless format, and unpack is required for hunspell to read the dictionary.
Creating Sandboxed HTTP Connections
reate an nsiuri var uri = ioservice.newuri(myurlstring, null, null); // get a channel for that nsiuri gchannel = ioservice.newchannelfromuri(uri); // get an listener var listener = new streamlistener(callbackfunc); gchannel.notificationcallbacks = listener; gchannel.asyncopen(listener, null); function streamlistener(acallbackfunc) { this.mcallbackfunc = acallbackfunc; } streamlistener.prototype = { mdata: "", // nsistreamlistener onstartrequest: function (arequest, acontext) { this.mdata = ""; }, ondataavailable: function (arequest, acontext, astream, asourceoffset, alength) { var scriptableinputstream = components.classes["@mozilla.org/scriptableinputstream;1"] .createinstance(components.interfaces.nsiscriptableinputstream); scriptableinputstream.i...
...} myclass.prototype.streamlistener = function (acallbackfunc) { return ({ mdata: "", // ...
...its setuploadstream method is called, passing in the nsiinputstream and the type (in this case, "application/x-www-form-urlencoded"): var uploadchannel = gchannel.queryinterface(components.interfaces.nsiuploadchannel); uploadchannel.setuploadstream(inputstream, "application/x-www-form-urlencoded", -1); due to a bug, calling setuploadstream will reset the nsihttpchannel to be a put request, so now the request type is set to post: // order important - setuploadstream resets ...
Debugging on Mac OS X
select the "cross-platform" tab then under the "other" template group select the "empty" project type.
...click the plus icon under the "arguments" list and type "-p <profile name>" (e.g.
...for example, type js to see the javascript stack.
How Mozilla's build system works
phases when you type mach build to build the tree, three high-level phases occur within the build system: system detection and validation preparation of the build backend invocation of the build backend phase 1: configure phase 1 centers around the configure script.
... examples standard makefile header installing headers using exports compiling interfaces using xpidlsrcs installing a javascript component building a component dll building a static library building a dynamic library makefiles - best practices and suggestions makefile - targets makefile - variables, values makefile - *.mk files & user config building libraries there are three main types of libraries that are built in mozilla: components are shared libraries (except in static builds), which are installed to dist/bin/components.
...you will probably not need to create a new library of this type.
Process scripts
}); the process script's global is a child process message manager, which enables the process script to receive messages from the chrome side, and to send messages to the chrome side: // process-script.js if (services.appinfo.processtype == services.appinfo.process_type_content) { dump("welcome to the process script in a content process"); } else { dump("welcome to the process script in the main process"); } // message is sent using contentprocessmessagemanager sendasyncmessage("hello"); in this example, the dump() statement will run once in each content process as well as in the main process.
... this example also figures out whether it is running in the chrome or in a content process by looking at the process type in services.appinfo.
... this can be achieved by traversing the docshell tree up to the top window and then retrieving its content message manager, as follows: function contentmmfromcontentwindow(window) { let tree = window.queryinterface(ci.nsiinterfacerequestor).getinterface(ci.nsidocshelltreeitem); let top = tree.sametyperoottreeitem; let iface = queryinterface(ci.nsidocshell).queryinterface(ci.nsiinterfacerequestor); return iface.getinterface(ci.nsicontentframemessagemanager); } this is intended for unprivileged pages running in a content process.
mozbrowsererror
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.
... 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 proxyresolvefailure proxyconnectfailure contentencodingfailure remotexul unsafecontenttype corruptedcontenterror certerror other example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsererror", function( event ) { console.log("an error occurred:" + event.detail); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserl...
mozbrowsershowmodalprompt
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.
... details the details property is an anonymous javascript object with the following properties: prompttype a domstring defining the type of the prompt.
... obsolete properties of details msg_name a string representing the type of message.
Chrome-only API reference
MozillaGeckoChromeAPI
it currently works in (privileged) chrome code on firefox desktop (version 47 and above).chromeworkerif you're developing privileged code, and would like to create a worker that can use js-ctypes to perform calls to native code, you can do so by using chromeworker instead of the standard worker object.
... it works exactly like a standard worker, except that it has access to js-ctypes via a global ctypes object available in the global scope of the worker.
... examples of chromeworker's using js-ctypes are availabe on github and are linked to from the see also section below.
HTML parser threading
attribute values, public identifiers (in doctype) and system identifiers (in doctype) are heap-allocated nsstring objects (i.e.
...(aside: it would make more sense to make the parser deal with nsstringbuffers directly without having heap-allocated nsstrings involved.) element names, attribute names and the doctype name are represented as nsiatoms.
...references to dom nodes in tree ops are of type nsicontent** and are called content handles.
Getting Started with Chat
simply type them into the message box at the bottom of the screen and press enter: /join #channel joins you to the specified channel until you quit your irc client or quit the channel /leave leave the current channel /mode #channel +k password sets a password for the channel.
...if this happens, you can type this command to resolve this issue.
... /msg nickserv identify password once registered, you need to type this every time you want to sign into channels using your registered nickname /msg nickserv help this displays a list of commands which can be used with nickserv /msg nickserv help register this displays helpful information about nickname registration /msg nickserv help identify this displays helpful information about identifying yourself upon sign in fo...
Sqlite.jsm
these are arguably the most important apis in this type.
... executetransaction(func, type) this function is used to execute a database transaction.
... type the type of transaction to perform.
Bootstrapping a new locale
(you should "cd" to the directory before beginning.) in the terminal, type the following command: $ hg clone http://hg.mozilla.org/releases/mozilla-x.x.x/ where "x.x.x" is the existing release branch version.
...we'll first navigate to the directory called "browser" by running the following commands one after the other from your command line: $ cd [ab-cd]/browser/chrome/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 ...
... (read more about tools at l10n:tools.) after you have downloaded your editor of choice, type the following command in the same path from above (~/ab-cd/browser/chrome/browser) $ edit ab-cd/browser/chrome/browser/aboutcerterror.dtd read the top of the file to get any context on how to translate contained in the notes written by the developers or l10n-drivers.
Localizing with Mercurial
type cmd.exe and click ok.
... type hg --version in the new shell window.
... open a terminal window and type hg --version.
Fonts for Mozilla's MathML engine
enhancement requests have been submitted to apple to ship opentype math fonts in the default installation.
...typically, use a fontconfig configuration /etc/fonts/conf.avail/09-texlive-fonts.conf that points to the opentype directory of texlive, such as: <?xml version="1.0"?> <!doctype fontconfig system "fonts.dtd"> <fontconfig> <dir>/your/path/to/texmf-dist/fonts/opentype</dir> </fontconfig> finally, add this configuration file to the system font location list and regenerate the fontconfig cache: ln -sf /etc/fonts/conf.avail/09-texlive-fonts.conf /etc/fonts/conf.d/ fc-cache -sf android you must use the math...
... asana math cambria math dejavu math tex gyre garamond math (under development) latin modern math libertinus math lucida bright math minion math stix math tex gyre bonum math tex gyre pagella math tex gyre schola math tex gyre termes math xits math fira math (sans-serif typeface, under development) gfs neohellenic math (sans-serif typeface) using mathematical fonts on web pages starting with gecko 31.0 (firefox 31.0 / thunderbird 31.0 / seamonkey 2.28), it is now easy to set up the css style (and optional woff fonts) to use on your web site.
Fonts for Mozilla 2.0's MathML engine
these fonts are opentype postscript fonts, which are supported by most modern operating systems.
...for example asana math is available in truetype format and there is an unofficial truetype conversion for stix fonts.
...s add-on ; the xpi is just a zip archive that you can fetch and extract for example with the following command: wget https://addons.mozilla.org/firefox/downloads/latest/367848/addon-367848-latest.xpi -o mathml-fonts.zip; \ unzip mathml-fonts.zip -d mathml-fonts then copy the mathml-fonts/resource/ directory somewhere on your web site and ensure that the woff files are served with the correct mime type.
MathML Torture Test
it compares the rendering by the xetex engine using the default latin modern math font against the mathml rendering by your browser using the default math font, or an alternative opentype math fonts.
... to get the best rendering, be sure to have appropriate mathematical fonts installed on your system and to use a browser with opentype math support such as gecko 31.0 (firefox 31.0 / thunderbird 31.0 / seamonkey 2.28) or higher.
... you may also try this test page for mathematical opentype fonts which instead relies on web fonts.
Mozilla Web Services Security Model
the type attribute the type attribute of the allow element can take the following values: any means that the allow element applies to all services that use web-scripts-access.xml for security checks.
...this is the same as not having a type attribute.
...in the root directory of the server: <webscriptaccess xmlns="http://www.mozilla.org/2002/soap/security"> <delegate/> <allow type="none"/> </webscriptaccess> and in the services directory: <webscriptaccess xmlns="http://www.mozilla.org/2002/soap/security"> <allow type="soapv"/> <allow type="soap"/> </webscriptaccess> good examples (needed.) references new security model for web services, the original proposal for the web-scripts-access.xml file format web services roadmap, documenting when web services features, in...
Mozilla Development Strategies
minimize how you are affected by regressions unless you are the type to go out and tackle daily regressions, you need to find a way to not let them affect you.
...-type d \!
...-type d \!
BloatView
79 |messagepump | 8 8| 30 1| 285 |mutex | 20 60| 89987 3| 302 |pcompositorchild | 412 412| 1 1| 308 |pimagebridgechild | 416 416| 1 1| the first line tells you the pid of the leaking process, along with the type of process.
...the following sample code shows what must be done: mytype::mytype() { moz_count_ctor(mytype); ...
... } mytype::~mytype() { moz_count_dtor(mytype); ...
Investigating leaks using DMD heap scan mode
from this chart, you can see how many objects of a particular type were leaked through shutdown.
...the allowed values here are the same as those returned by xre_getprocesstype(), so adjust as needed.
... the output will look something like this, after a message about loading progress: 0x7f0882fe3230 [fragmentorelement (xhtml) script https://www.example.com] --[[via hash] mlistenermanager]--> 0x7f0899b4e550 [eventlistenermanager] --[mlisteners event=onload listenertype=3 [i]]--> 0x7f0882ff8f80 [callbackobject] --[mincumbentglobal]--> 0x7f0897082c00 [nsglobalwindowinner # 2147483662 inner https://www.example.com] root 0x7f0882fe3230 is a ref counted object with 1 unknown edge(s).
JS::PerfMeasurement
the current implementation can measure eleven different types of low-level hardware and software events: events that can be measured bitmask passed to constructor counter variable what it measures perfmeasurement::cpu_cycles .cpu_cycles raw cpu clock cycles ::instructions .instructions total instructions executed ::cache_references .cache_references total number of memory accesses ::cache_miss...
... we also can't guarantee that all platforms will support all event types, once we have more than one back end for this interface.
... it will return null if javascript passed in something with the wrong dynamic type.
TraceMalloc
this file can be post-processed by tools in mozilla/tools/trace-malloc as follows: histogram.pl, which produces a type histogram that can be diffed with histogram-diff.sh to produce output that looks like this: ---- base ---- ---- incr ---- ----- difference ---- type count bytes count bytes count bytes %total total 48942 4754774 76136 6566453 27194 1811679 100.00 nstokenallocator 17 110007 60 388260 43 278253 15.36 nsimagegtk...
... 253 25070 842 91548 589 66478 3.67 nshtmldocument.mreferrer 177 21550 691 85460 514 63910 3.53 nshtmlvalue 139 7846 1215 68734 1076 60888 3.36 htmlcontentsink 6 4816 12 57782 6 52966 2.92 uncategorized.pl, which lists all the void* allocations (the ones that couldn't be categorized by type), sorted by size.
...<script type="text/javascript"> var filename = window.prompt("filename to log: "); if (filename) tracemallocdumpallocations(filename); </script> one can then use the script tools/trace-malloc/diffbloatdump.pl to compare trace-malloc dumps before and after doing an action that might leak.
Interval Timing
nspr defines a platform-dependent type, printervaltime, for timing intervals of fewer than approximately 6 hours.
... this chapter describes printervaltime and the functions that allow you to use it for timing purposes: interval time type and constants interval functions interval time type and constants all timed functions in nspr require a parameter that depicts the amount of time allowed to elapse before the operation is declared failed.
... the type of such arguments is printervaltime.
Network Addresses
this chapter describes the nspr types and functions used to manipulate network addresses.
... network address types and constants network address functions the api described in this chapter recognizes the emergence of internet protocol version 6 (ipv6).
... network address types and constants prhostent prprotoent pr_netdb_buf_size network address functions initializing a network address pr_initializenetaddr facilitates the use of prnetaddr, the basic network address structure, in a polymorphic manner.
PLHashComparator
syntax #include <plhash.h> typedef printn (pr_callback *plhashcomparator)( const void *v1, const void *v2); description plhashcomparator is a function type that compares two values of an unspecified type.
...plhashcomparator defines the meaning of equality for the unspecified type.
... remark the return value of plhashcomparator functions should be of type prbool.
PLHashNumber
syntax #include <plhash.h> typedef pruint32 plhashnumber; #define pl_hash_bits 32 description plhashnumber is an unsigned 32-bit integer.
... plhashnumber is the data type of the return value of a hash function.
... the macro pl_hash_bits is the size (in bits) of the plhashnumber data type and has the value of 32.
PRBool
syntax #include <prtypes.h> typedef enum { pr_false = 0, pr_true = 1 } prbool; description wherever possible, do not use prbool in mozilla c++ code.
...otherwise, use prbool for variables and parameter types.
... use pr_false and pr_true for clarity of target type in assignments and actual arguments.
PRFileInfo
syntax #include <prio.h> struct prfileinfo { prfiletype type; pruint32 size; prtime creationtime; prtime modifytime; }; typedef struct prfileinfo prfileinfo; fields the structure has the following fields: type type of file.
... see prfiletype.
... description the prfileinfo structure provides information about a file, a directory, or some other kind of file system object, as specified by the type field.
PRFileInfo64
syntax #include <prio.h> struct prfileinfo64 { prfiletype type; pruint64 size; prtime creationtime; prtime modifytime; }; typedef struct prfileinfo64 prfileinfo64; fields the structure has the following fields: type type of file.
... see prfiletype.
... description the prfileinfo64 structure provides information about a file, a directory, or some other kind of file system object, as specified by the type field.
PRIntn
this type is one of the most appropriate for automatic variables.
...this types is never valid for fields of a structure.
... syntax #include <prtypes.h> typedef int printn; ...
PRSize
a type for representing the size of an object (not the size of a pointer).
... this is the same as the corresponding type in libc.
... syntax #include <prtypes.h> typedef size_t prsize; ...
PRUintn
this (unsigned) type is one of the most appropriate for automatic variables.
...this types is never valid for fields of a structure.
... syntax #include <prtypes.h> typedef unsigned int pruintn; ...
PR_EXTERN
used to define the prototypes for functions or variables that are to be exported from a shared library.
... syntax #include <prtypes.h> pr_extern(type)prototype description pr_extern is used to define externally visible routines and globals.
... for syntax details for each platform, see prtypes.h.
PR_FindSymbol
pr_findsymbol() will return an untyped reference to a symbol in a particular library given the identity of the library and a textual representation of the symbol in question.
... returns an untyped pointer.
... description this function finds and returns an untyped reference to the specified symbol in the specified library.
Threads
threading types and constants threading functions a thread has a limited number of resources that it truly owns.
...to an nspr client, a thread is represented by a pointer to an opaque structure of type prthread.
... threading types and constants prthread prthreadtype prthreadscope prthreadstate prthreadpriority prthreadprivatedtor threading functions most of the functions described here accept a pointer to the thread as an argument.
NSS 3.15.1 release notes
new types in sslprot.h ssl_library_version_tls_1_2 - the protocol version of tls 1.2 on the wire, value 0x0303.
... in sslt.h ssl_hmac_sha256 - a new value in the sslmacalgorithm enum type.
... ssl_signature_algorithms_xtn - a new value in the sslextensiontype enum type.
NSS 3.16.2 release notes
the algorithm is specified with a ck_mechanism_type.
...the algorithm is specified with a ck_mechanism_type.
... the certutil commands supports additionals types of subject alt name extensions: --extsan type:name[,type:name]...
NSS Sample Code sample2
*/ #include "nss.h" #include "pk11pub.h" /* example key & iv */ unsigned char gkey[] = {0xe8, 0xa7, 0x7c, 0xe2, 0x05, 0x63, 0x6a, 0x31}; unsigned char giv[] = {0xe4, 0xbb, 0x3b, 0xd3, 0xc3, 0x71, 0x2e, 0x58}; int main(int argc, char **argv) { ck_mechanism_type ciphermech; pk11slotinfo* slot = null; pk11symkey* symkey = null; secitem* secparam = null; pk11context* enccontext = null; secitem keyitem, ivitem; secstatus rv, rv1, rv2; unsigned char data[1024], buf1[1024], buf2[1024]; int i, result_len, tmp1_outlen, tmp2_outlen; /* initialize nss * if your application ...
...*/ keyitem.type = sibuffer; keyitem.data = gkey; keyitem.len = sizeof(gkey); /* turn the raw key into a key object.
... * when not using cbc mode, ivitem.data and ivitem.len can be 0, or you * can simply pass null for the iv parameter in pk11_paramfromiv func */ ivitem.type = sibuffer; ivitem.data = giv; ivitem.len = sizeof(giv); secparam = pk11_paramfromiv(ciphermech, &ivitem); if (secparam == null) { fprintf(stderr, "failure to set up pkcs11 param (err %d)\n", pr_geterror()); goto out; } /* sample data we'll encrypt and decrypt */ strcpy(data, "encrypt me!"); fprintf(stderr, "clear data: %s\n", data); /* ==================...
PKCS11 Implement
table 1.2 summarizes the pkcs #11 functions (in addition to the other functions described in this document) that nss expects each type of token to support.
... installation you can install your module in any convenient location on the user's hard disk, but you must tell the user to type the module name and location in the cryptographic modules portion of the communicator security info window.
... to avoid requiring the user to type long pathnames, make sure your module is not buried too deeply.
FC_GetMechanismList
name fc_getmechanismlist - get a list of mechanism types supported by a token.
... syntax ck_rv fc_getmechanismlist( ck_slot_id slotid, ck_mechanism_type_ptr pmechanismlist, ck_ulong_ptr puscount ); parameters fc_getmechanismlist takes three parameters: slotid [input] pinfo [output] the address of a variable that will receive a pointer to the list of function pointers.
... description fc_getmechanismlist obtains a list of mechanism types supported by a token.
FC_Login
syntax ck_rv fc_login( ck_session_handle hsession, ck_user_type usertype, ck_char_ptr ppin, ck_ulong ulpinlen ); parameters fc_login() takes four parameters: hsession [in] a session handle usertype [in] the user type (cku_so or cku_user) ppin [in] a pointer that points to the user's pin ulpinlen [in] the length of the pin description fc_login() logs a user into a token.
... ckr_user_type_invalid the token can't authenticate the user because there is no key database or the user's password isn't initialized.
... usertype is cku_so and the normal user's pin is already initialized.
NSC_Login
syntax ck_rv nsc_login( ck_session_handle hsession, ck_user_type usertype, ck_char_ptr ppin, ck_ulong ulpinlen ); parameters nsc_login() takes four parameters: hsession [in] a session handle usertype [in] the user type (cku_so or cku_user) ppin [in] a pointer that points to the user's pin ulpinlen [in] the length of the pin description nsc_login() logs a user into a token.
... ckr_user_type_invalid the token can't authenticate the user because there is no key database or the user's password isn't initialized.
... usertype is cku_so and the normal user's pin is already initialized.
NSS environment variables
variable type description introduced in version nsrandcount integer (byte count) sets the maximum number of bytes to read from the file named in the environment variable nsrandfile (see below).
...pkcs #11 module logger 3.6 nss_default_db_type string ("dbm", "sql", or "extern") determines the default database type to open if the app does not specify.
... variable type description introduced in version build_opt boolean (1 to enable) do an optimized (not debug) build.
NSS_3.12.3_release_notes.html
the information in this table is excerpted from https://developer.mozilla.org/en/nss_reference/nss_environment_variables environment variable value type description nsrandcount integer (byte count) sets the maximum number of bytes to read from the file named in the environment variable nsrandfile (see below).
... bug 426413: audit messages need distinct types bug 438870: free freebl hashing code of dependencies on nspr and libutil bug 439115: db merge allows nickname conflicts in merged db bug 439199: sse2 instructions for bignum are not implemented on windows 32-bit bug 441321: tolerate incorrect encoding of dsa signatures in ssl 3.0 handshakes bug 444404: libpkix reports unknown issuer for nearly all certificate errors bug 452391: certu...
... bug 478931: object leak in pkix_list_mergelists function bug 478994: allow softoken's fork check to be disabled bug 479029: ocsp response signature cert found invalid if issuer is trusted only for ssl bug 479601: wrong type (utf8 string) for email addresses in subject by cert_asciitoname bug 480142: use sizeof on the correct type of ckc_x509 in lib/ckfw bug 480257: ocsp fails when response > 1k byte bug 480280: the cka_ec_point pkcs#11 attribute is encoded in the wrong way: missing encapsulating octet string bug 480442: remove (empty) watcomfx.h from nss bug 481216: fix specific spelling errors in nss bu...
Rebranding SpiderMonkey (1.8.5)
for example: ../configure --enable-ctypes --with-system-nspr note: your desired configuration may be different.
...in the unix world we would issue the following command: find ./ -type f -exec sed -i "s/mozjs185/$brand/" {} \; windows users: notepad++ can be used to perform the recursive find and replace text operation.
...find ./ -type f -exec sed -i "s/$brand.pc/mozjs185.pc/" {} \; the last recursive search and replace, changes the file name of the static library: find ./ -type f -exec sed -i "s/js_static/$brand_static/" {} \; allright, almost there.
Creating JavaScript jstest reftests
non262 tests the directory js/src/tests/non262/ should contain all tests of the following type: regressions of spidermonkey non-standard spidermonkey extensions to the javascript language test of "implementation-defined" details of the ecmascript standard for example, the exact definition of pi or some details of array sorting.
... you should not add tests of the following type: tests of the jit test of jit correctness belong in the jit-test suite, read more here.
... it is easy to make a test silently pass; anyone who has written js code for the web has written this kind of if-statement: if (typeof gc === 'function') { var arr = []; arr[10000] = 'item'; gc(); asserteq(arr[10000], 'item', 'gc must not wipe out sparse array elements'); } else { print('test skipped: no gc function'); } reportcompare(0, 0, 'ok'); handling abnormal test terminations some tests can terminate abnormally even though the test has technically passed.
Garbage collection
for each type t such that fields of type t* need a write barrier, there is a functiont::writebarrierpre(old).
... for example, fields of type jsobject* need a write barrier, so there is a function jsobject::writebarrierpre(jsobject* old).
...thus, object fields of gc-pointer type should normally be defined as type heap<t>.
Introduction to the JavaScript shell
you can use it as an interactive shell, in which you type javascript code at a prompt and get instant gratification, which is handy for experimenting or testing new features.
... read(filename[, type]) reads and returns the contents of file.
... if type is "binary" returns an uint8array, otherwise returns an utf-8 decoded string.
DOUBLE_TO_JSVAL
casts a pointer to a gc-allocated jsdouble to type jsval.
... syntax jsval double_to_jsval(double d); name type description d double c double to convert to a jsval.
... to convert a c float, double to type js::value, use js_numbervalue instead.
JS::AutoVectorRooter
this article covers features introduced in spidermonkey 17 base class that roots an internal variable-size array of type t.
... description js::autovectorrooter<t> holds a variable-size rooted array of type t.
... there are derived classes for the main types: class parent class js::autovaluevector autovectorrooter<value> js::autoidvector autovectorrooter<jsid> js::autoobjectvector added in spidermonkey 24 autovectorrooter<jsobject *> js::autofunctionvector added in spidermonkey 31 autovectorrooter<jsfunction *> js::autoscriptvector autovectorrooter<jsscript *> see also mxr id search for js::autovectorrooter mxr id search for js::autovaluevector mxr id search for js::autoidvector mxr id search for js::autoobjectvector mxr id search for js::autofunctionvector mxr id search for js::autoscriptvector js::autovaluearray&lt;n&gt; - fixed-size array of js::value bug 677079 bug 868580 - expose js::autoobjectvector bug 8...
JS::BooleanValue
this article covers features introduced in spidermonkey 24 convert a c boolean of type bool to a js::value.
... syntax js::value js::booleanvalue(bool boo) name type description boo bool c bool to convert.
... description js::booleanvalue converts a c boolean of type bool to js::value, the type of javascript values.
JS::CloneFunctionObject
syntax jsobject * js::clonefunctionobject(jscontext *cx, js::handleobject funobj); jsobject * js::clonefunctionobject(jscontext *cx, js::handleobject funobj, js::autoobjectvector &scopechain); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... the new object's prototype is function.prototype; js_newobject : choosing a default prototype explains exactly how this is computed.
... js::clonefunctionobject takes care to choose a prototype that shares a global object with the given parent whenever possible.
JS::DoubleValue
this article covers features introduced in spidermonkey 24 convert a c floating-point number of type double to a js::value.
... syntax js::value js::doublevalue(double dbl) name type description dbl double c double to convert.
... description js::doublevalue converts a c floating-point number of type double to js::value, the type of javascript values.
JS::Float32Value
this article covers features introduced in spidermonkey 24 convert a c floating-point number of type float to a js::value.
... syntax js::value js::float32value(float f) name type description f float c float to convert.
... description js::float32value converts a c floating-point number of type float to js::value, the type of javascript values.
JS::Handle
this is most useful as a parameter type, which guarantees that the t value is properly rooted.
...} methods here, ptr represents the private member of js::handle<t>, typed with t.
... there are typedefs available for the main types: namespace js { typedef handle<jsfunction*> handlefunction; typedef handle<jsid> handleid; typedef handle<jsobject*> handleobject; typedef handle<jsscript*> handlescript; typedef handle<jsstring*> handlestring; typedef handle<js::symbol*> handlesymbol; // added in spidermonkey 38 typedef handle<value> handlevalue; } see also mxr id search ...
JS::Int32Value
this article covers features introduced in spidermonkey 24 convert a c signed 32-bit integer of type int32_t to a js::value.
... syntax js::value js::int32value(int32_t i32) name type description i32 int32_t c integer to convert.
... description js::int32value converts a c signed 32-bit integer of type int32_t to js::value, the type of javascript values.
JS::OrdinaryToPrimitive
syntax bool js::ordinarytoprimitive(jscontext *cx, js::handleobject obj, jstype type, js::mutablehandlevalue vp); name type description cx jscontext * the context in which to perform the conversion.
... type jstype the type of converted value.
... description js::ordinarytoprimitive converts a javascript object to a specified type value, by the algorithm specified in es6 draft rev 28 (2014 oct 14) 7.1.1, second algorithm.
JS::ProtoKeyToId
syntax void js::protokeytoid(jscontext *cx, jsprotokey key, js::mutablehandleid idp); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... key jsprotokey the prototype key to convert.
... description js::protokeytoid converts a specified js prototype key key, to a js id.
JSCheckAccessOp
jscheckaccessop is the type for jsclass.checkaccess.
... (it is also the type of the callback set by js_setcheckobjectaccesscallback.) syntax typedef jsbool (* jscheckaccessop)(jscontext *cx, jsobject *obj, jsval id, jsaccessmode mode, jsval *vp); name type description cx jscontext * the js context in which the property access attempt is occurring.
... mode jsaccessmode the type of access being checked.
JSClass
all; jshasinstanceop hasinstance; jsnative construct; jsxdrobjectop xdrobject; /* obsolete since spidermonkey 13 */ jstraceop trace; /* added in spidermonkey 17 */ jsclassinternal reserved1; /* obsolete since spidermonkey 13 */ void *reserved[n]; /* sizeof 'reserved' depends on version */ }; name type description name const char * class name flags uint32_t class flags.
...to do this, use the jsclass_has_private (jsclass_construct_prototype wad removed) flags.
..._set_rval(cx, vp, object_to_jsval(obj)); */ return true; } { js_initclass(cx, global, js::null(), &printer_class, printer_construct, 1, null, null, null, null); } see also mxr id search for jsclass jsclass.flags js_getclass js_initclass js_newobject js_newobjectforconstructor js_instanceof bug 638291 - added trace bug 702507 - removed jsclass_construct_prototype bug 726944 - removed xdrobject, reserved0 and reserved1 bug 886829 - made finalize optional bug 957688 - removed checkaccess bug 1103368 - made most of members optional bug 1097267 - removed jsclass_new_enumerate bug 1054756 - removed convert bug 1261723 - class ops are moved to a sub-structure jsclassops ...
JSDeletePropertyOp
this article covers features introduced in spidermonkey 24 the type of the jsclass.delproperty.
... syntax typedef bool (* jsdeletepropertyop)(jscontext *cx, js::handleobject obj, js::handleid id, bool *succeeded); name type description cx jscontext * the context in which the property access is taking place.
...this will cause delete obj[id] to evaluate to false in non-strict mode code, and to throw a typeerror in strict mode code.
JSErrorReport
syntax jserrorreport(); properties name type description filename const char * indicates the source file or url that produced the error condition.
... exntype int16_t one of the jsexntype constants.
...to use jserrorreport, your application must define a variable of type jserrorreport and allocate a buffer to hold the text that generated the error condition.
JSFastNative
this article covers features introduced in spidermonkey 1.8 jsfastnative is the type of fast native functions in the jsapi.
... apis such as js_initclass and js_definefunctions can create custom methods that are implemented as c/c++ functions of this type, instead of jsnative.
... syntax typedef jsbool (*jsfastnative)(jscontext *cx, unsigned int argc, jsval *vp); name type description cx jscontext * the context in which the fast native is being called.
JSObjectOps.defaultValue
syntax typedef jsbool (*jsconvertop)(jscontext *cx, jsobject *obj, jstype type, jsval *vp); name type description cx jscontext * pointer to the js context in which the conversion is needed.
... type jstype the target type.
... the jsclass.convert callback should convert obj to the given type, returning js_true with the resulting value in *vp on success, and returning js_false on error or exception.
JSObjectOps.getProperty
each of these callbacks is responsible for everything involved with an individual property access operation, including: any locking necessary for thread safety; security checks; finding the property, including walking the prototype chain if needed; calling the lower-level jsclass hooks; calling getters or setters; and actually getting, setting, or deleting the property once it is found.
... syntax typedef jsbool (*jspropertyidop)( jscontext *cx, jsobject *obj, jsid id, jsval *vp); name type description cx jscontext * pointer to the js context in which the property access is happening.
... if deleting without error, *vp will be jsval_false if obj[id] is permanent, and jsval_true if id named a direct property of obj that was in fact deleted, or if id names no direct property of obj (id could name a property of a prototype, or no property in obj or its prototype chain).
JSObjectOps.lookupProperty
syntax typedef jsbool (*jslookuppropop)(jscontext *cx, jsobject *obj, jsid id, jsobject **objp, jsproperty **propp); name type description cx jscontext * pointer to the js context in which the property lookup is happening.
... description look for id in obj and its prototype chain, returning js_false on error or exception, js_true on success.
...if id was found, return the first object searching from obj along its prototype chain in which id names a direct property in *objp, and return a non-null, opaque property pointer in *propp.
JSResolveOp
jsresolveop is the type of the jsclass.resolve.
... syntax typedef bool (* jsresolveop)(jscontext *cx, js::handleobject obj, 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.
...if not, the process is repeated with obj's prototype.
JSTraceOp
jstraceop is the type of the jsclass.trace.
... syntax typedef void (* jstraceop)(jstracer *trc, jsobject *obj); name type description trc jstracer * the tracer visiting obj.
... description jstraceop is the function type for trace operation of the class called to enumerate all traceable things reachable from obj's private data structure.
JSVAL_TO_DOUBLE
casts a given jsval to a jsdouble without any type checking or error handling.
... syntax jsdouble jsval_to_double(jsval v); description jsval_to_double casts a specified js value, v, to a c floating-point number of type jsdouble.
...this function is not type-safe: if v is an integer, string, null, or anything else, the behavior is undefined.
JSVAL_TO_INT
converts an integer jsval to a c integer without any type checking or error handling.
...if v is any other type of value, the result is unspecified.
... note that although jsval is an integer type, it must be treated as opaque.
JSVAL_TO_OBJECT
cast a jsval to a jsobject * without a type check.
... syntax jsobject * jsval_to_object(jsval v); description jsval_to_object casts the argument, v, to type jsobject *.
...this function is not type-safe: if v is not an object or jsval_null, the behavior is undefined.
JS_CheckAccess
syntax jsbool js_checkaccess(jscontext *cx, jsobject *obj, jsid id, jsaccessmode mode, jsval *vp, unsigned int *attrsp); name type description cx jscontext * the context in which to perform the access check.
... mode jsaccessmode the type of access requested (read, write, etc.) vp jsval * out parameter.
...it is one of the following values: value description jsacc_proto check for permission to read to obj's prototype.
JS_ClearNewbornRoots
syntax void js_clearnewbornroots(jscontext *cx); name type description cx jscontext * the context to clear.
... description the last gc thing of each type (object, string, double, external string types) created on a given context is kept alive until another thing of the same type is created, using a newborn root in the context.
...using js_enterlocalrootscope disables updating of the context's per-gc-thing-type newborn roots, until control flow unwinds and leaves the outermost nesting local root scope.
JS_CloneFunctionObject
syntax jsobject * js_clonefunctionobject(jscontext *cx, jsobject *funobj, jsobject *parent); name type description cx jscontext * pointer to a js context from which to derive runtime information.
...the new object's prototype is function.prototype; js_newobject: choosing a default prototype explains exactly how this is computed.
... js_clonefunctionobject takes care to choose a prototype that shares a global object with the given parent whenever possible.
JS_DumpNamedRoots
syntax void js_dumpnamedroots(jsruntime *rt, void (*dump)(const char *name, void *rp, void *data), void *data); name type description rt jsruntime * pointer to a jsruntime from which to dump named roots.
...when js_dumpnamedroots calls it, it passes three arguments: argument type description name const char * the name of the named root.
...it points to a variable, array element, or field of type jsval, jsobject *, jsstring *, or jsdouble *.
JS_GetNaNValue
get the not-a-number (nan) floating-point number as a value of type js::value.
... syntax // added in spidermonkey 42 js::value js_getnanvalue(jscontext *cx); // obsolete since spidermonkey 42 jsval js_getnanvalue(jscontext *cx); name type description cx jscontext * a context.
... description js_getnanvalue returns a value of type js::value that represents an ieee floating-point quiet not-a-number (nan).
JS_GetPrivate
syntax void * js_getprivate(jsobject *obj); name type description obj jsobject * an object whose jsclass has the jsclass_has_private flag.
...if the object is not of the expected jsclass, the result of js_getprivate would probably be null or a pointer to some unexpected type of data.
... casting that pointer to the desired type and using it could then cause a crash or worse.
JS_GetPropertyDescriptor
syntax bool js_getpropertydescriptor(jscontext *cx, js::handleobject obj, const char *name, js::mutablehandle<jspropertydescriptor> desc); // added in spidermonkey 31 bool js_getpropertydescriptorbyid(jscontext *cx, js::handleobject obj, js::handleid id, js::mutablehandle<jspropertydescriptor> desc); name type description cx jscontext * a context.
... description js_getpropertydescriptor and js_getpropertydescriptorbyid find a specified property of an object and gets a detailed description of that property on the prototype chain (returned in desc->obj).
... if desc->obj is null, then this property was not found on the prototype chain.
JS_HasInstance
syntax bool js_hasinstance(jscontext *cx, js::handle<jsobject*> obj, js::handle<js::value> v, bool *bp); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... obj js::handle&lt;jsobject*&gt; constructor/prototype to test.
...when providing a prototype as obj, the prototype's jsclass must have its hasinstance method set.
JS_HasProperty
sproperty(jscontext *cx, js::handleobject obj, const char *name, bool *foundp); bool js_hasucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, bool *vp); bool js_haspropertybyid(jscontext *cx, js::handleobject obj, js::handleid id, bool *foundp); // added in spidermonkey 1.8.1 name type description cx jscontext * a context.
... foundp bool * non-null pointer to a variable of type bool.
... description js_hasproperty searches an object, obj, and its prototype chain, for a property with the specified name.
JS_IsConstructing_PossiblyWithGivenThisObject
syntax static jsbool js_isconstructing_possiblywithgiventhisobject(jscontext *cx, const jsval *vp, jsobject **maybethis); name type description cx jscontext * the context.
... vp const jsval * maybethis jsobject ** description in the case of a constructor called from js_constructobject and js_initclass where the class has the jsclass_construct_prototype flag set, spidermonkey passes the constructor a non-standard this object.
...thgiventhisobject(cx, vp, &maybethis)) { // native called as a constructor if (maybethis) // native called as a constructor with maybethis as 'this' } else { // native called as function, maybethis is still uninitialized } } note: a spidermonkey embedding does not need to use this query unless the embedding uses js_constructobject(), js_initclass() and jsclass_construct_prototype as described above.
JS_NewNumberValue
use js_numbervalue instead convert a c floating-point number of type jsdouble to a jsval.
... syntax jsbool js_newnumbervalue(jscontext *cx, jsdouble d, jsval *rval); name type description cx jscontext * the context in which to create the new number.
... description js_newnumbervalue converts a c floating-point number of type jsdouble to jsval, the type of javascript values.
JS_NumberValue
this article covers features introduced in spidermonkey 17 convert a c floating-point number of type double to a js::value.
... syntax // added in spidermonkey 42 js::value js_numbervalue(double d); // obsolete since spidermonkey 42 jsval js_numbervalue(double d); name type description d double the numeric value to convert.
... description js_numbervalue converts a c floating-point number of type double to js::value, the type of javascript values.
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.
... before then, js_preventextensions did not accept a succeeded argument; in those cases where *succeeded would be set to false, js_preventextensions would throw a typeerror and return false.
... unlike object.preventextensions, js_preventextensions doesn't necessarily throw a typeerror if the object couldn't be made non-extensible.
JS_RemoveExternalStringFinalizer
syntax int js_removeexternalstringfinalizer(jsstringfinalizeop finalizer); name type description finalizer jsstringfinalizeop the finalizer to remove.
... description remove finalizer from the global gc finalizers table, returning its type code if found, -1 if not found.
... you must ensure that all strings with finalizer's type have been collected before calling this function.
JS_ResolveStandardClass
syntax bool js_resolvestandardclass(jscontext *cx, js::handleobject obj, js::handleid id, bool *resolved); name type description cx jscontext * pointer to the executable script context for which to initialize js function and object classes.
... description js_resolvestandardclass resolves id, which must contain either a string or an int, to a standard class name in obj if possible, defining the class's constructor and/or prototype and storing true in *resolved.
...return false on error, as usual for bool result-typed api entry points.
JS_SetContextCallback
syntax void js_setcontextcallback(jsruntime *rt, jscontextcallback cxcallback, void *data); name type description rt jsruntime * pointer to a js runtime.
...added in spidermonkey 31 callback syntax typedef bool (* jscontextcallback)(jscontext *cx, unsigned contextop, void *data); name type description cx jscontext * pointer to a jscontext which the callback may use to call into jsapi functions.
...added in spidermonkey 31 typedef enum jscontextop { jscontext_new, jscontext_destroy } jscontextop; enumeration meaning jscontext_new js_newcontext successfully created a new jscontext instance.
JS_SetOperationCallback
these methods/types are renamed to js_setinterruptcallback, js_getinterruptcallback, js_requestinterruptcallback and jsinterruptcallback in spidermonkey 30.
... syntax void js_setoperationcallback(jscontext *cx, jsoperationcallback callback); jsoperationcallback js_getoperationcallback(jscontext *cx); void js_triggeroperationcallback(jsruntime *rt); name type description cx jscontext * a context.
... callback syntax jsbool (*jsoperationcallback)(jscontext *cx); name type description cx jscontext * pointer to a jscontext in which this callback was installed.
jsdouble
since firefox/gecko 13 jsdouble has been removed, and instead it is possible to use the default c/c++ type double.
... jsdouble is a c floating-point number type.
... it is defined to be a 64-bit, ieee 754 compliant type.
SpiderMonkey 1.8
specifically, if a property lookup first calls a resolve hook which does not define the property, then finds the property on a prototype, that result can be cached.
... js_newobjectwithgivenproto is exactly like js_newobject except that it doesn't use a default prototype object if you pass null.
... instead the object is created with no prototype.
SpiderMonkey 45
many jsapi types; functions, and callback signatures, have changed though most functions that have retain their previous name, providing relatively unchanged functionality.
...(supporting decltype(nullptr)).
... js_setcurrentembeddertimefunction (bug 1159507) js_getcurrentembeddertime (bug 1159507) js_mayresolvestandardclass (bug 1155946) js_getiteratorprototype (bug 1225392) js_globallexicalscope (bug 1202902) js_hasextensiblelexicalscope (bug 1202902) js_extensiblelexicalscope (bug 1202902) js_initreflectparse (bug 987514) js::toprimitive (bug 1206168) js::getfirstargumentastypehint (bug 1054756) js::objecttocompletepropertydescriptor (bug 1144366) js_setimmutableprototype (bug 1211607) js_getownucpropertydescriptor (bug 1211607) js_hasownpro...
SavedFrame
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.
... asynccause if this stack frame is the asyncparent of other stack frames, then this is a string representing the type of asynchronous call by which this frame invoked its children.
... function properties of the savedframe.prototype object tostring return this frame and its parents formatted as a human readable stack trace string.
TPS Tests
asset lists a test file will contain one or more asset lists, which are lists of bookmarks, passwords, or other types of browser data that are relevant to sync.
... the format of these asset lists vary somwhat depending on asset type.
... each type of asset list has a number of built-in functions you can call, described in the section on asset lists; there are also some additional built-in functions.
A Web PKI x509 certificate primer
its is directed mostly at what type of application the certificate was issued for.
...this type of hierarchy allows for a relatively simple long term root to be distributed to clients, and some flexibility on the intermediate cert so that you can change parameters based on best practices and security research.
...e algorithm re-sign the certificate using a modern algorithm sec_error_expired_certificate a certificate is too old to be used re-generate the certificate sec_error_extension_value_invalid a certificate has an extension with an empty value re-generate the certificate without the extension, or re-generate it with a non-empty value sec_error_inadequate_cert_type a certificate has an extended key usage extension that does not assert a required usage, or an end-entity certificate asserts the id-kp-ocspsigning usage when it shouldn't re-generate the certificate with the appropriate extended key usage values sec_error_inadequate_key_usage a certificate has a key usage extension that does not assert a required usage re-generate the certif...
Frecency algorithm
this score is determined by the amount of revisitation, the type of those visits, how recent they were, and whether the uri was bookmarked or tagged.
...determine percentage bonus for type of visit (ie: the "transition type"): ....
...200 (places.frecency.typedvisitbonus) ....
extIPreferenceBranch
method overview boolean has(in astring aname) extipreference get(in astring aname) nsivariant getvalue(in astring aname, in nsivariant adefaultvalue) void setvalue(in astring aname, in nsivariant avalue) void reset() attributes attribute type description root readonly attribute astring the name of the branch root.
... the use of a variant as the return value means that to javascript code the value will appear as a value of the same type as is used in the preferences file and no coercion will occur.
... there are no other types supported by the preference subsystem.
Generic factory
*/ class nsigenericfactory : public nsifactory { public: static const nsiid& iid() { static nsiid iid = ns_igenericfactory_iid; return iid; } typedef ns_callback(constructorprocptr) (nsisupports *aouter, refnsiid aiid, void **aresult); /** * establishes the generic factory's constructor function, which will be called * by createinstance.
...define a constructor function that matches the constructorprocptr prototype, and call nsigenericfactory::setconstructor with a pointer to that function.
... #include "nsifactory.h" class nsgenericfactory : public nsifactory { public: typedef nsresult (*creatorprocptr) (nsisupports *aouter, refnsiid aiid, void **aresult); nsgenericfactory(creatorprocptr creator); virtual ~nsgenericfactory(); ns_decl_isupports ns_imethod createinstance(nsisupports *aouter, refnsiid aiid, void **aresult); ns_imethod lockfactory(prbool alock); private: creatorprocptr mcreator; }; ...
Packaging WebLock
« previousnext » in this final part of the tutorial, we'll put all of the pieces of the web locking component - the library itself, the type library, the header file, and the user interface resources - into a package that can be installed on other systems.
... weblock installation script // initialize the installation var err = initinstall("weblock", "weblock", 1.0); var componentsdir = getfolder("components"); var cf = getfolder("chrome"); // add the dll and say where it'll go addfile("weblock.dll", 1.0, "weblock.dll", componentsdir, ""); // add the typelib also addfile("weblock.xpt", "1.0", "weblock.xpt", componentsdir, ""); // add the weblock subdirectory of the xpi and specify that // it be installed in the chrome application directory err = adddirectory("weblock", "1.0", "", chromedir, ""); // ?
... <!doctype html> <html> <title>weblock installation</title> <script> /* * trigger function that downloads the xpi so the * install.js file inside can be read and executed */ function installweblock() { weblock_xpi = {'weblock extension': 'weblock.xpi'}; installtrigger.install(weblock_xpi); } </script> <h1>install weblock</h1> <p><a href="#" onclick="installweblock();">install weblock</a></p> </ht...
How to build a binary XPCOM component using Visual Studio
the interface defines the methods, including arguments and return types, of the component.
...the next step is to compile the idl into a type-library (*.xpt) and a c++ header file (*.h), which we can use to define our implementation object.
...the command executes xpidl.exe twice, like this: {path_to_geckosdk}\bin\xpidl.exe -m header -i..\gecko-sdk\idl {your_idl_file} {path_to_geckosdk}\bin\xpidl.exe -m typelib -i..\gecko-sdk\idl {your_idl_file} the generated h file actually has a skeleton implementation (commented out).
Monitoring HTTP activity
// define a reference to the interfacevar nsihttpactivityobserver = components.interfaces.nsihttpactivityobserver; var httpobserver = { observeactivity: function(ahttpchannel, aactivitytype, aactivitysubtype, atimestamp, aextrasizedata, aextrastringdata) { if (aactivitytype == nsihttpactivityobserver.activity_type_http_transaction) { switch(aactivitysubtype) { case nsihttpactivityobserver.activity_subtype_response_header: // received response header break; case nsihttpactivityobserver.activity_subtype_response_complete: ...
...observable socket activities when the activity type reported to your nsihttpactivityobserver.observeactivity() method is activity_type_socket_transport, the activity subtype, which indicates the specific type of activity that occurred, will be a socket transport status code.
... observable http activities when the activity type is activity_type_http_transaction, the activity subtype will be one of the activity subtype constants.
Append
void append( const self_type& astring ); parameters astring [in] a nsacstring to append to this string.
... void append( const char_type* adata, size_type adatalength = pr_uint32_max ); parameters adata [in] a raw character array to append to this string.
... void append( char_type achar ); parameters achar [in] a character to append to this string.
Assign
void assign( const self_type& astring ); parameters astring [in] a nsacstring to copy into this string.
... void assign( const char_type* adata, size_type adatalength = pr_uint32_max ); parameters adata [in] a raw character array to copy into this string.
... void assign( char_type achar ); parameters achar [in] the character to copy into this string.
Insert
void insert( const self_type& astring, index_type aposition ); parameters astring [in] a nsacstring to append to this string.
... void insert( const char_type* adata, index_type aposition, size_type adatalength = pr_uint32_max ); parameters adata [in] a raw character array to append to this string.
... void insert( char_type achar, index_type aposition ); parameters achar [in] a character to append to this string.
Replace
void replace( index_type acutstart, index_type acutlength, const self_type& astring ); parameters acutstart [in] the starting index of the section to remove, measured in storage units.
... void replace( index_type acutstart, size_type acutlength, const char_type* adata, size_type adatalength = pr_uint32_max ); parameters acutstart [in] the starting index of the section to remove, measured in storage units.
... void replace( index_type acutstart, index_type acutlength, char_type achar ); parameters acutstart [in] the starting index of the section to remove, measured in storage units.
operator=
self_type& operator=( const self_type& astring ); parameters astring [in] a nsacstring to append to this string.
... self_type& operator=( const char_type* adata ); parameters adata [in] a raw character array to append to this string.
... self_type& operator=( char_type achar ); parameters achar [in] a character to append to this string.
operator+=
self_type& operator+=( const self_type& astring ); parameters astring [in] a nsacstring to append to this string.
... self_type& operator+=( const char_type* adata ); parameters adata [in] a raw character array to append to this string.
... self_type& operator+=( char_type achar ); parameters achar [in] a character to append to this string.
nsACString_internal
this type is not instantiated directly.
... methods constructors void nsacstring_internal(const nscsubstringtuple&) - source this is public to support automatic conversion of tuple to string base type, which helps avoid converting to nstastring.
... if size_type(-1) is passed for newlen, then the current length of the string is used.
Append
void append( const self_type& astring ); parameters astring [in] a nsastring to append to this string.
... void append( const char_type* adata, size_type adatalength = pr_uint32_max ); parameters adata [in] a raw character array to append to this string.
... void append( char_type achar ); parameters achar [in] a character to append to this string.
Assign
void assign( const self_type& astring ); parameters astring [in] a nsastring to copy into this string.
... void assign( const char_type* adata, size_type adatalength = pr_uint32_max ); parameters adata [in] a raw character array to copy into this string.
... void assign( char_type achar ); parameters achar [in] the character to copy into this string.
Insert
void insert( const self_type& astring, index_type aposition ); parameters astring [in] a nsastring to append to this string.
... void insert( const char_type* adata, index_type aposition, size_type adatalength = pr_uint32_max ); parameters adata [in] a raw character array to append to this string.
... void insert( char_type achar, index_type aposition ); parameters achar [in] a character to append to this string.
Replace
void replace( index_type acutstart, index_type acutlength, const self_type& astring ); parameters acutstart [in] the starting index of the section to remove, measured in storage units.
... void replace( index_type acutstart, size_type acutlength, const char_type* adata, size_type adatalength = pr_uint32_max ); parameters acutstart [in] the starting index of the section to remove, measured in storage units.
... void replace( index_type acutstart, index_type acutlength, char_type achar ); parameter acutstart [in] the starting index of the section to remove, measured in storage units.
operator=
self_type& operator+=( const self_type& astring ); parameters astring [in] a nsastring to append to this string.
... self_type& operator=( const char_type* adata ); parameters adata [in] a raw character array to append to this string.
... self_type& operator=( char_type achar ); parameters achar [in] a character to append to this string.
operator+=
self_type& operator+=( const self_type& astring ); parameters astring [in] a nsastring to append to this string.
... self_type& operator+=( const char_type* adata ); parameters adata [in] a raw character array to append to this string.
... self_type& operator+=( char_type achar ); parameters achar [in] a character to append to this string.
nsAString_internal
this type is not instantiated directly.
... methods constructors void nsastring_internal(const nssubstringtuple&) - source this is public to support automatic conversion of tuple to string base type, which helps avoid converting to nstastring.
... if size_type(-1) is passed for newlen, then the current length of the string is used.
RefPtr
it is similar to nscomptr, but does not require that the type be an xpcom interface.
...this is done using the functions addref() and release(), which respectively modify a variable of type nsautorefcnt, which basically is a wrapper around a count of the number of references refering to the class.
...if the concrete class has its own xpcom iid (not true by default, but one can be added), you can also qi from an xpcom pointer to a concrete type: bar = do_queryobject(foo); if (bar) { ...
IAccessible2
xtendedstates ); [propget] hresult nrelations([out] long nrelations ); [propget] hresult relation([in] long relationindex, [out] iaccessiblerelation relation ); [propget] hresult relations([in] long maxrelations, [out, size_is(maxrelations), length_is( nrelations)] iaccessiblerelation relations, [out] long nrelations ); hresult role([out] long role ); hresult scrollto([in] enum ia2scrolltype scrolltype ); hresult scrolltopoint([in] enum ia2coordinatetype coordinatetype, [in] long x, [in] long y ); [propget] hresult states([out] accessiblestates states ); [propget] hresult uniqueid([out] long uniqueid ); [propget] hresult windowhandle([out] hwnd windowhandle ); methods attributes() returns the attributes specific to this iaccessible2 object, such as a cell's formula.
...hresult scrollto( [in] enum ia2scrolltype scrolltype ); parameters scrolltype defines where the object should be placed on the screen.
...hresult scrolltopoint( [in] enum ia2coordinatetype coordinatetype, [in] long x, [in] long y ); parameters coordinatetype specifies whether the coordinates are relative to the screen or the parent object.
amIWebInstaller
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method overview boolean installaddonsfromwebpage(in astring amimetype, in nsidomwindow awindow, in nsiuri areferer, [array, size_is(ainstallcount)] in wstring auris, [array, size_is(ainstallcount)] in wstring ahashes, [array, size_is(ainstallcount)] in wstring anames, [array, size_is(ainstallcount)] in wstring aicons, [optional] in amiinstallcallback acallback, [optional] in pruint32 ainstallcount); boolean isinstallenabled(in astring amimetype, in nsiuri areferer); note: prio...
...boolean installaddonsfromwebpage( in astring amimetype, in nsidomwindow awindow, in nsiuri areferer, [array, size_is(ainstallcount)] in wstring auris, [array, size_is(ainstallcount)] in wstring ahashes, [array, size_is(ainstallcount)] in wstring anames, [array, size_is(ainstallcount)] in wstring aicons, in amiinstallcallback acallback, optional in pruint32 ainstallcount optional ); parameters amimetype the mimetype for the add-ons.
...boolean isinstallenabled( in astring amimetype, in nsiuri areferer ); parameters amimetype the mime type for the add-on to be installed.
imgILoader
principal aloadingprincipal, in nsiloadgroup aloadgroup, in imgidecoderobserver aobserver, in nsisupports acx, in nsloadflags aloadflags, in nsisupports cachekey, in imgirequest arequest, in nsichannelpolicy channelpolicy); imgirequest loadimagewithchannel(in nsichannel achannel, in imgidecoderobserver aobserver, in nsisupports cx, out nsistreamlistener alistener); boolean supportimagewithmimetype(in string mimetype); constants constant value description load_cors_anonymous 1 << 16 load_cors_use_credentials 1 << 17 methods loadimage() start the load and decode of an image.
... return value supportimagewithmimetype() checks if a decoder for the an image with the given mime type is available.
... boolean supportimagewithmimetype( in string mimetype ); parameters mimetype the type to find a decoder for.
imgIRequest
ed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method overview void cancelandforgetobserver(in nsresult astatus); imgirequest clone(in imgidecoderobserver aobserver); void decrementanimationconsumers(); imgirequest getstaticrequest(); void incrementanimationconsumers(); void lockimage(); void requestdecode(); void unlockimage(); attributes attribute type description corsmode long the cors mode that this image was loaded with.
... mimetype string read only.
...if an html img element has the crossorigin attribute set, the imgirequest will be validated for cross-origin usage with cors, and, if successful, will have its cors mode set to the relevant type.
nsIAccessibleDocument
obsolete since gecko 2.0 astring getnamespaceuriforid(in short namespaceid); attributes attribute type description caretaccessible nsiaccessible read only.
... obsolete since gecko 1.9 doctype astring the doc type of the document, as specified in the document.
...obsolete since gecko 1.9 mimetype astring the mime type of the document.
nsIAccessibleProvider
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) attributes attribute type description accessible nsiaccessible read only.
... obsolete since gecko 1.9 accessibletype long value representing the type of accessible object.
...this property is used for upload, input[type="xsd:gday"] and input[type="xsd:gmonth"] xformslabel 0x00002001 used for label element.
nsICRLManager
inherits from: nsisupports last changed in gecko 1.7 method overview wstring computenextautoupdatetime(in nsicrlinfo info, in unsigned long autoupdatetype, in double noofdays); void deletecrl(in unsigned long crlindex); nsiarray getcrls(); void importcrl([array, size_is(length)] in octet data, in unsigned long length, in nsiuri uri, in unsigned long type, in boolean dosilentdownload, in wstring crlkey); void reschedulecrlautoupdate(); boolean updatecrlfromurl(in wstring url, in wstring key); constants constant value description type_autoupdate_time_based 1 type_autoupdate_freq_based 2 methods computenextautoupdatetime() wstring computenextautoupdatetime( ...
... in nsicrlinfo info, in unsigned long autoupdatetype, in double noofdays ); parameters info autoupdatetype noofdays return value deletecrl() delete the crl.
...void importcrl( [array, size_is(length)] in octet data, in unsigned long length, in nsiuri uri, in unsigned long type, in boolean dosilentdownload, in wstring crlkey ); parameters data length uri type dosilentdownload crlkey reschedulecrlautoupdate() this would reschedule the autoupdate of crls with auto update enable.
nsICategoryManager
var enumerator = categorymanager.enumeratecategory("app-startup"); var entries = []; while (enumerator.hasmoreelements()) { var item = enumerator.getnext(); var entry = item.queryinterface(components.interfaces.nsisupportscstring) entries.push(entry.tostring()); } entries.sort(); var entriesstring = entries.join("\n"); dump(entriesstring + "\n"); disable currently loaded plugins by type this snippet here shows how to disable plugins that are currently loaded for the file type of pdf.
... var content_type = 'application/pdf'; // update the category manager in case the plugins are already loaded.
... let categorymanager = cc['@mozilla.org/categorymanager;1']; categorymanager.getservice(ci.nsicategorymanager).deletecategoryentry('gecko-content-viewers', content_type, false); // update pref manager to prevent plugins from loading in future var stringtypes = ''; var types = []; var pref_disabled_plugin_types = 'plugin.disable_full_page_plugin_for_types'; if (services.prefs.prefhasuservalue(pref_disabled_plugin_types)) { stringtypes = services.prefs.getcharpref(pref_disabled_plugin_types); } if (stringtypes !== '') { types = stringtypes.split(','); } if (types.indexof(content_type) === -1) { types.push(content_type); } services.prefs.setcharpref(pref_disabled_plugin_types, types.join(',')); remarks categories have a variety of uses throughout the mozilla platform.
nsIComponentRegistrar
eenumerator enumeratecontractids(); boolean iscidregistered(in nscidref aclass); boolean iscontractidregistered(in string acontractid); void registerfactory(in nscidref aclass, in string aclassname, in string acontractid, in nsifactory afactory); void registerfactorylocation(in nscidref aclass, in string aclassname, in string acontractid, in nsifile afile, in string aloaderstr, in string atype); void unregisterfactory(in nscidref aclass, in nsifactory afactory); void unregisterfactorylocation(in nscidref aclass, in nsifile afile); methods autoregister() register a component (.manifest) file or all component files in a directory.
...void registerfactorylocation( in nscidref aclass, in string aclassname, in string acontractid, in nsifile afile, in string aloaderstr, in string atype ); parameters aclass the classid of the class being registered.
...atype component type of aclass.
nsIContentFrameMessageManager
parameters name type description astr string the message to log.
... parameters name type description aasciistring string ascii string to decode.
... parameters name type description abase64data string binary data to encode as base64.
nsIContentSecurityPolicy
erits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview boolean permitsancestry(in nsidocshell docshell); void refinepolicy(in astring policystring, in nsiuri selfuri); void scanrequestdata(in nsihttpchannel achannel); void sendreports(in astring blockeduri, in astring violateddirective); short shouldload(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetypeguess, in nsisupports aextra); short shouldprocess(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetype, in nsisupports aextra); attributes attribute type description allowseval boolean whether this policy al...
...short shouldload( in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetypeguess, in nsisupports aextra ); parameters acontenttype acontentlocation arequestorigin acontext amimetypeguess aextra return value shouldprocess() delegate method called by the service when sub-elements of the protected document are being processed.
...short shouldprocess( in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetype, in nsisupports aextra ); parameters acontenttype acontentlocation arequestorigin acontext amimetype aextra return value ...
nsICookieService
cookiestringfromhttp(in nsiuri auri, in nsiuri afirsturi, in nsichannel achannel); void setcookiestring(in nsiuri auri, in nsiprompt aprompt, in string acookie, in nsichannel achannel); void setcookiestringfromhttp(in nsiuri auri, in nsiuri afirsturi, in nsiprompt aprompt, in string acookie, in string aservertime, in nsichannel achannel); attributes attribute type description cookieiconisvisible boolean this attribute really doesn't belong on this interface.
... afirsturi the uri that the user originally typed in or clicked on to initiate the load of the document referenced by auri.
... afirsturi the uri that the user originally typed in or clicked on to initiate the load of the document referenced by auri.
nsIDOMFontFace
attribute type description fromfontgroup boolean indicates whether or not the font was located in a font group.
... attribute type description cssfamilyname domstring a family name that could be used in css font-family (not necessarily the actual name that was used, due to aliases, generics, localized names, and so on).
... attribute type description format domstring the font format.
nsIDOMMouseScrollEvent
method overview void initmousescrollevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in long axis); attributes attr...
...ibute type description axis long indicates which mouse wheel axis changed; this will be either horizontal_axis or vertical_axis.
...void initmousescrollevent( in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in long axis ); parameters typearg the type of event.
nsIDOMMozTouchEvent
last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsidommouseevent method overview void initmoztouchevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in bool...
...ean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in unsigned long streamidarg); attributes attribute type description streamid unsigned long a unique identifier for each finger, so that each finger's movement can be tracked separately.
...void initsimplegestureevent( in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in unsigned long streamidarg ); parameters streamidarg the value to assign to the streamid attribute; this uniquely identifies the finger generati...
nsIDOMWindow
tcomputedstyle(in nsidomelement elt, [optional] in domstring pseudoelt); nsiselection getselection(); void scrollby(in long xscrolldif, in long yscrolldif); void scrollbylines(in long numlines); void scrollbypages(in long numpages); void scrollto(in long xscroll, in long yscroll); void sizetocontent(); attributes attribute type description applicationcache nsidomofflineresourcelist get the application cache object for this window.
...if there is no parent window, or if the parent is of a different type, this is the current window.
...this is the window itself if there is no parent, or if the parent is of a different type.
nsIDOMXPathEvaluator
.createinstance(components.interfaces.nsidomxpathevaluator); method overview nsidomxpathexpression createexpression(in domstring expression, in nsidomxpathnsresolver resolver) nsidomxpathnsresolver creatensresolver(in nsidomnode noderesolver); nsisupports evaluate(in domstring expression, in nsidomnode contextnode, in nsidomxpathnsresolver resolver, in unsigned short type, in nsisupports result) methods createexpression() creates an nsidomxpathexpression which can then be used for (repeated) evaluations.
...nsisupports evaluate( in domstring expression, in nsidomnode contextnode, in nsidomxpathnsresolver resolver, in unsigned short type, in nsisupports result ); parameters expression a string representing the xpath to be evaluated.
... type a number that corresponds to one of the type constants of nsixpathresult.
nsIDOMXPathExpression
dom/interfaces/xpath/nsidomxpathexpression.idlscriptable represents a compiled xpath query returned from nsidomxpathevaluator.createexpression or document.createexpression inherits from: nsisupports last changed in gecko 1.7 method overview nsisupports evaluate(in nsidomnode contextnode, in unsigned short type, in nsisupports result) methods evaluate() evaluate the xpath expression.
... nsisupports evaluate( in nsidomnode contextnode, in unsigned short type, in nsisupports result ); parameters contextnode a dom node to evaluate the xpath expression against.
... type a number that corresponds to one of the type constants of nsidomxpathresult.
nsIDeviceMotionData
attributes attribute type description type unsigned long the type of motion data reported by this object; see motion type constants for possible values.
...constants motion type constants constant value description type_acceleration 0 the motion data describes device acceleration.
... type_orientation 1 the motion data describes a device orientation chang.
nsIHttpChannel
indicates no referrer will be sent referrer_policy_origin only send the origin of the referring uri referrer_policy_origin_when_xorigin same as the default; only send the origin of the referring uri for cross-origin requests referrer_policy_unsafe_url always send the referrer, even when downgrading from https to http attributes attribute type description allowpipelining boolean this attribute is a hint to the channel to indicate whether or not the underlying http transaction should be allowed to be pipelined with other transactions.
...this flag is ignored if the specified header does not support merging (for example the "content-type" header can only have one value).
...this flag is ignored if the specified header does not support merging (for example the "content-type" header can only have one value).
nsIMarkupDocumentViewer
inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) method overview void scrolltonode(in nsidomnode node); void sizetocontent(); attributes attribute type description allowplugins boolean if true, plugins are allowed within the doc shell.
...obsolete since gecko 2.0 bidinumeral octet the type of numerals to display.
... biditexttype octet the ordering of bidirectional text.
nsIModule
inherits from: nsisupports last changed in gecko 0.9.9 method overview boolean canunload(in nsicomponentmanager acompmgr); void getclassobject(in nsicomponentmanager acompmgr, in nscidref aclass, in nsiidref aiid, [retval, iid_is(aiid)] out nsqiresult aresult); void registerself(in nsicomponentmanager acompmgr, in nsifile alocation, in string aloaderstr, in string atype); void unregisterself(in nsicomponentmanager acompmgr, in nsifile alocation, in string aloaderstr); methods canunload() this method may be queried to determine whether or not the component module can be unloaded by xpcom.
...void registerself( in nsicomponentmanager acompmgr, in nsifile alocation, in string aloaderstr, in string atype ); parameters acompmgr the global component manager.
... atype loader type being used to load this module.
nsIMsgCompFields
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...
...(bug 249530) newsgroups astring newshost char * newsposturl char * organization astring otherrandomheaders astring no longer exists - see https://groups.google.com/forum/#!topic/mozilla.dev.apps.thunderbird/s4ofmm8_b28 priority char * receiptheadertype print32 references char * replyto astring securityinfo nsisupports subject astring templatename astring temporaryfiles char * obsolete temporaryfiles obsolete, do not use anymore to astring usemultipartalternative prbool uuencodeattachments prbo...
...ents, in prbool emailaddressonly ); 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 ...
nsINavHistoryQuery
_is(count)] out long long folders); void gettransitions([optional] out unsigned long count, [retval,array,size_is(count)] out unsigned long transitions); void setfolders([const,array, size_is(foldercount)] in long long folders, in unsigned long foldercount); void settransitions([const,array, size_is(count)] in unsigned long transitions, in unsigned long count); attributes attribute type description absolutebegintime prtime read only: retrieves the begin time value that the currently loaded reference points + offset resolve to.
...void gettransitions( out unsigned long count, optional [retval,array,size_is(count)] out unsigned long transitions ); parameters count optional the number of transitions transitions missing description settransitions() when the set of transitions is nonempty, results are limited to pages which have at least one visit for each of the transition types.
... limit results to the specified list of transition types.
nsINavHistoryQueryResultNode
method overview void getqueries([optional] out unsigned long querycount, [retval,array,size_is(querycount)] out nsinavhistoryquery queries); attributes attribute type description folderitemid long long for both simple folder nodes and simple-folder-query nodes, this is set to the concrete itemid of the folder.
... queryoptions nsinavhistoryqueryoptions the options that group the node's children; only valid for result_type_query nodes.
... methods getqueries() returns the queries that build the node's children; only valid for result_type_query nodes.
nsIProfile
boolean useexistingdir); void deleteprofile(in wstring name, in boolean candeletefiles); void getprofilelist(out unsigned long length, [retval, array, size_is(length)] out wstring profilenames); boolean profileexists(in wstring profilename); void renameprofile(in wstring oldname, in wstring newname); void shutdowncurrentprofile(in unsigned long shutdowntype); attributes attribute type description currentprofile wstring the name of the profile currently in use.
... constants profile shutdown types constant value description shutdown_persist 0x00000001 when shutting down the profile, save all changes.
...void shutdowncurrentprofile( in unsigned long shutdowntype ); parameters shutdowntype the type of shutdown to perform; see shutdown type constants.
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.
...goodies obtained from window.navigator are: appcodename:"mozilla" appname:"netscape" appversion:"5.0 (windows)" battery:batterymanager buildid:"20140529161749" cookieenabled:true donottrack:"yes" geolocation:geolocation language:"en-us" mimetypes:mimetypearray mozalarms:null mozapps:xpcwrappednative_nohelper mozcameras:cameramanager mozconnection:mozconnection mozcontacts:contactmanager mozid:null mozkeyboard:xpcwrappednative_nohelper mozpay:null mozpermissionsettings:null mozphonenumberservice:phonenumberservice mozpower:mozpowermanager moztcpsocket:null online:true oscpu:"windows nt 5.1" platform:"win32" plugins:pluginarray product:"ge...
...cko" productsub:"20100101" useragent:"mozilla/5.0 (windows nt 5.1; rv:30.0) gecko/20100101 firefox/30.0" vendor:"" vendorsub:"" __proto__:navigatorprototype from here we can easily see the operating system version.
nsIScriptableIO
this should be one of the following types: nsifile: an object returned by getfile() or getfilewithpath(), or any object implementing the nsifile interface.
...this should be one of the following types: nsifile: an object returned by getfile() or getfilewithpath(), or any object implementing the nsifile interface.
... example: writing to a file var json = "{ name: 'bob', age: 37}"; var file = io.getfile("profile", null); file.append("myobject.json"); if (!file.exists()) file.create(ci.nsifile.normal_file_type, 0600); var stream = io.newoutputstream(file, "text write create truncate"); stream.writestring(json); stream.close(); example: reading from a file var file = io.getfile("profile", null); file.append("localstore.json"); if (file.exists()) { var stream = io.newinputstream(file, "text"); var json = stream.readline(); stream.close(); } see also nsifile, nsiinputstream, nsioutputstream ...
nsISocketProvider
it is implemented by several types of socket classes like: udp, socks, tls, ssl, and so on.
... inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) implemented by: @mozilla.org/network/socket;2?type=foo.
... to create an instance, use: var socketprovider = components.classes["@mozilla.org/network/socket;2?type="] .createinstance(components.interfaces.nsisocketprovider); method overview void addtosocket(in long afamily, in string ahost, in long aport, in string aproxyhost, in long aproxyport, in unsigned long aflags, in prfiledescstar afiledesc, out nsisupports asecurityinfo); native code only!
nsIStandardURL
to create an instance, use: var standardurl = components.classes["@mozilla.org/network/standard-url;1"] .createinstance(components.interfaces.nsistandardurl); method overview void init(in unsigned long aurltype, in long adefaultport, in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); attributes attribute type description mutable boolean control whether or not this url can be modified.
... constant value description urltype_standard 1 blah:foo/bar => blah://foo/bar blah:/foo/bar => blah:///foo/bar blah://foo/bar => blah://foo/bar blah:///foo/bar => blah:///foo/bar urltype_authority 2 blah:foo/bar => blah://foo/bar blah:/foo/bar => blah://foo/bar blah://foo/bar => blah://foo/bar blah:///foo/bar => blah://foo/bar urltype_no_authority 3 blah:foo/bar => blah:///foo/bar blah:/foo/bar => blah:///foo/bar blah://foo/bar => blah://foo/bar blah:///foo/bar => blah:///foo/bar methods init() normalizes a given url to an standard url.
... void init( in unsigned long aurltype, in long adefaultport, in autf8string aspec, in string aorigincharset, in nsiuri abaseuri ); parameters aurltype one of the constants listed above.
nsITextInputProcessor
ing, just do this: tip.commitcomposition(); when you commit composition with specific string, specify commit string with its argument: tip.commitcompositionwith("foo-bar-buzz"); when you cancel composition, just do this: tip.cancelcomposition(); when you dispatch keydown event (and one or more keypress events), just do this: var keyevent = new keyboardevent("", // type attribute value should be empty.
...ptional] in unsigned long akeyflags); void setcaretinpendingcomposition(in unsigned long aoffset); void setpendingcompositionstring(in domstring astring); void sharemodifierstateof(in nsitextinputprocessor aother); boolean startcomposition([optional] in nsidomkeyevent adomkeyevent, [optional] in unsigned long akeyflags); attributes attribute type description hascomposition boolean whether the instance has composition or not.
... type when you use the keyboardevent instance for a call of either keydown() or keyup(), this value should be empty string.
nsITextInputProcessorNotification
attributes attribute type description type acstring the type of request or notification to ime.
... see type values below.
... types "request-to-commit" this is required to be handled.
nsIUpdate
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsiupdatepatch getpatchat(in unsigned long index); nsidomelement serialize(in nsidomdocument updates); attributes attribute type description appversion astring the application version of this update.
...unexpected_error (8) an unanticipate type of error occurred.
... type astring the type of patch represented by the object: "major" a major new version of the application.
nsIUploadChannel2
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void explicitsetuploadstream(in nsiinputstream astream, in acstring acontenttype, in long long acontentlength, in acstring amethod, in boolean astreamhasheaders); methods explicitsetuploadstream() sets a stream to be uploaded by this channel with the specified content-type and content-length header values.
... void explicitsetuploadstream( in nsiinputstream astream, in acstring acontenttype, in long long acontentlength, in acstring amethod, in boolean astreamhasheaders ); parameters astream the stream to be uploaded by this channel.
... acontenttype this value will replace any existing content-type header on the http request, regardless of whether or not its empty.
XPCOM category image-sniffing-services
in versions of firefox prior to firefox 3, extensions could add decoders for new image types.
... however, such decoders relied on servers sending correct mime types; images sent with incorrect mime types would not be correctly displayed.
...if mozilla's built-in image code cannot identify an image, then any xpcom components implementing the nsicontentsniffer interface may register under the "image-sniffing-services" category, and will be queried to determine the mime type of the image being downloaded.
wrappedJSObject
// constructor function helloworld() { }; helloworld.prototype = { hello: function() { return "hello world!"; }, queryinterface: function(aiid) { if (!aiid.equals(components.interfaces.nsisupports) && !aiid.equals(components.interfaces.nsihelloworld)) throw components.results.ns_error_no_interface; return this; } }; xpconnect wrapping now let's get a reference to our component.
... in this example we use getservice, but as long as we get the reference from xpcom, our component gets wrapped by xpconnect in the same way: var comp = components.classes["@myself.com/my-component;1"].getservice(); if we try to call the hello() method we defined in our component implementation, we get: > comp.hello(); typeerror on line 1: comp.hello is not a function this happens because, as we mentioned earlier, comp is not the helloworld js object itself, but an xpconnect wrapper around it: > dump(comp); [xpconnect wrapped nsisupports] the idea of these wrappers is to make the javascript-implemented xpcom components look just like any other xpcom component to the user.
... while this behavior is nice for production code as it forces you to clearly define the interfaces that should be used to access the component, it's inconvenient to write the interfaces (and recompile each time you change them) when working on a prototype of the component.
XPCOM
here is how to make the same component in python using pyxpcom.fun with xbl and xpconnectgenerating guidsguids are used in mozilla programming for identifying several types of entities, including xpcom interfaces (this type of guids is callled iid), components (cid), and legacy add-ons—like extensions and themes—that were created prior to firefox 1.5.
...often, compiled xpcom components are called 'binary' or 'native'.xpcom category image-sniffing-servicesin versions of firefox prior to firefox 3, extensions could add decoders for new image types.
... however, such decoders relied on servers sending correct mime types; images sent with incorrect mime types would not be correctly displayed.xpcom gluethe xpcom glue is a static library which component developers and embedders can link against.
xpidl
MozillaTechXPIDLxpidl
it generates: c++ header files (.h), with a commented template for full c++ implementation of the interface xpconnect typelib files (.xpt), with runtime type information to dynamically call xpcom objects through xpconnect note: starting in gecko 9.0, xpidl has been replaced with pyxpidl in the gecko sdk.
...for testing purposes, or one-off interface compilation, xpidl can be run from the command line: usage: ./xpidl -m mode [-w] [-v] [-t version number] [-d filename.pp] [-i path] [-o basename | -e filename.ext] filename.idl -a emit annotations to typelib -w turn on warnings (recommended) -v verbose mode (nyi) -t create a typelib of a specific version number -i add entry to start of include path for ``#include "nsithing.idl" -o use basename (e.g.
... ``/tmp/nsithing) for output -e use explicit output filename -d write dependencies (requires -e) -m specify output mode: header generate c++ header (.h) typelib generate xpconnect typelib (.xpt) doc generate html documentation (.html) java generate java interface (.java) ...
XUL Overlays
MozillaTechXULOverlays
inserting the following processing instruction before the doctype declaration in a base file tells the layout engine to load the named overlay file: <?xul-overlay href="chrome://component/content/componentoverlay.xul"?> where component is the name of the package being overlayed (e.g., chrome://navigator/content/navigatoroverlay.xul).
...attaching a script to an overlay to execute a script when an overlay is applied, use a <script> element: <script src="overlay.js"/> if you need to set the version of javascript, you can set the type attribute: <script type="application/x-javascript;version=1.8" src="overlay.js"/> ui reuse with overlays one of the biggest benefits of using overlays is that it allows you to reuse groups of elements that appear frequently in the ui.
...the following snippet shows a dialog with custom ui elements at the top and a reference to the overlay's ok and cancel buttons at the bottom: <box align="horizontal" id="bx1" flex="100%" style="margin-bottom: 1em; width: 100%;"> <html:input type="checkbox" id="dialog.newwindow"/> <html:label for="dialog.newwindow">&openwin.label;</html:label> <spring flex="100%"/> </box> <box id="okcancelbuttons"/> for more detail, see the ok and cancel button definitions being referenced here in the global component file platformdialogoverlay.xul.
Theme Packaging
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 available on the https://addons.mozilla.org website, it may not include an updateurl.
... sample install.rdf file <?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:id>{18b64b56-d42f-428d-a88c-baa413bc413f}</em:id> <em:version>1.0</em:version> <em:type>4</em:type> <!-- target application this extension can install into, with minimum and maximum supported versions.
Using the Multiple Accounts API
you will need to pass it the server type as a string, from the list above.
... relevant api calls: nsimsgaccount nsimsgaccountmanager.createaccount() nsimsgaccount nsimsgaccountmanager.getaccount(in string key) nsimsgincomingserver nsimsgaccountmanager.createincomingserver(in string type) nsimsgincomingserver nsimsgaccountmanager.getincomingserver(in string key) smtp servers smtp servers are kept separately from all the other account management stuff.
... incoming servers preference: mail.server.server.type : string id of the server type: pop3, nntp, imap, or local preference: mail.server.server.hostname - hostname of the server preference: mail.server.server.username - user login name preference: mail.server.server.password - user login password preference: mail.server.server.check_new_mail - boolean, should we check for new mail on a regular basis?
Memory Management
keeping objects alive the following js-ctypes objects will hold references to objects, keeping them alive.
... this is not an exhaustive list, but will help you to understand memory management and how it affects your use of js-ctypes: a function or static data declared using the declare() method will hold that library alive.
... a ctype will hold referent ctype objects alive.
Flash Activation: Browser Comparison - Plugins
mozilla firefox google chrome microsoft edge setting name ask to activate html5 by default click-to-run 'application/x-shockwave-flash' in navigator.mimetypes by default when flash is inactive yes no no 'application/x-shockwave-flash' in navigator.mimetypes when user enables flash yes yes yes <object> with fallback content triggers ui yes, with exceptions no yes small/hidden flash triggers additional ui yes no no enabling flash automatically reloads the page no yes yes ...
...e plugin is activated: function plugincreated() { // we don't need to see the plugin, so hide it by resizing var plugin = document.getelementbyid('myplugin'); plugin.height = 0; plugin.width = 0; plugin.callpluginmethod(); } the html, by default, specifies the flash object to be a size that makes it visible, like this: <!-- give the plugin an initial size so it is visible --> <object type="application/x-shockwave-flash" data="myapp.swf" id="myplugin" width="300" height="300"> <param name="callback" value="plugincreated()"> </object> the callback parameter defined in the html can be called in flash using its flash.external.externalinterface api.
... first, set your up your html with a callback that calls the javascript function plugincreated(), like this: <object type="application/x-my-plugin" data="somedata.mytype" id="myplugin"> <param name="callback" value="plugincreated()"> </object> the plugincreated() function is then responsible for the setup of your script and any calls back into the plugin that you need to make: function plugincreated() { document.getelementbyid('myplugin').callpluginmethod(); } ...
Dominators view - Firefox Developer Tools
call stack in the toolbar at the top of the tool is a dropdown called "label by": by default, this is set to "type".
... sometimes there's more than one retaining path back from a node: here there are three paths back from the documentprototype node to a gc root.
... if one were removed, then the documentprototype would still not be garbage-collected, because it's still retained by the other two path.
Tree map view - Firefox Developer Tools
for the treemaps shown in the memory tool, things on the heap are divided at the top level into four categories: objects: javascript and dom objects, such as function, object, or array, and dom types like window and htmldivelement.
... within top-level categories: objects is further divided by the object's type.
... other is further subdivided by the object's type.
Performance Analysis - Firefox Developer Tools
the tables group resources by type, and show the total size of each resource and the total time it took to load them.
... the accompanying pie chart shows the relative size of each resource type.
... clicking on a slice of the pie takes you to the network monitor for that run, with a filter automatically applied to see only that resource type.
Edit fonts - Firefox Developer Tools
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, provided it includes the desired values for the different characteristics you want to vary.
...for example linux oses need the latest linux freetype version, and macos prior to 10.13 does not support variable fonts.
Taking screenshots - Firefox Developer Tools
type :screenshot in the web console to create a screenshot of the current page.
... tip: you could type :s and then hit tab to autocomplete :screenshot.
... the command has the following optional parameters: command type description --clipboard boolean when present, this parameter will cause the screenshot to be copied to the clipboard.
Web Console UI Tour - Firefox Developer Tools
filter categories: you can click a filter category (such as errors, warnings, css, or xhr) to display just those types of messages.
... group similar messages: when enabled, similar types of messages are grouped together, with an indicator of the number of occurrences.
... enable autocompletion: when enabled, the javascript interpreter attempts to autocomplete while you type.
AbstractRange - Web APIs
the abstractrange abstract interface is the base class upon which all dom range types are defined.
... as an abstract interface, you will not directly instantiate an object of type abstractrange.
... usage notes range types all ranges of content within a document are described using instances of interfaces based on abstractrange.
AudioContext.createMediaStreamDestination() - Web APIs
after that, the stop event fires, a new blob is made of type opus — which contains the data in the chunks array, and a new window (tab) is then opened that points to a url created from the blob.
... <!doctype html> <html> <head> <title>createmediastreamdestination() demo</title> </head> <body> <h1>createmediastreamdestination() demo</h1> <p>encoding a pure sine wave to an opus file </p> <button>make sine wave</button> <audio controls></audio> <script> var b = document.queryselector("button"); var clicked = false; var chunks = []; var ac = new audiocontext(); var osc = ac.createoscillator(); var dest = ac.createmediastreamdestination(); var mediarecorder = new mediarecorder(dest.stream); osc.connect(dest); b.addeventlistener("click", function(e) { if (!clicked) { mediarecorder.start(); osc.start(0); e.target.innerhtml = "sto...
... var blob = new blob(chunks, { 'type' : 'audio/ogg; codecs=opus' }); document.queryselector("audio").src = url.createobjecturl(blob); }; </script> </body> </html> note: you can view this example live, or study the source code, on github.
AudioProcessingEvent - Web APIs
property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
...e = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio track via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // give the node a function to process audio events scriptnode.onaudioprocess = function(audioprocessingev...
BiquadFilterNode() - Web APIs
options optional options are as follows: type: one of "lowpass", "highpass", "bandpass", "lowshelf", "highshelf", "peaking", "notch", "allpass".
...please note that for this filter type, this value is not a traditional q, but is a resonance value in decibels.
...please note that for this filter type, this value is not a traditional q, but is a resonance value in decibels.
BiquadFilterNode - Web APIs
biquadfilternode.type is a string value defining the kind of filtering algorithm the node is implementing.
... the meaning of the different parameters depending of the type of the filter (detune has the same meaning regardless, so isn't listed below) type description frequency q gain lowpass standard second-order resonant lowpass filter with 12db/octave rolloff.
... = audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(biquadfilter); biquadfilter.connect(convolver); convolver.connect(gainnode); gainnode.connect(audioctx.destination); // manipulate the biquad filter biquadfilter.type = "lowshelf"; biquadfilter.frequency.setvalueattime(1000, audioctx.currenttime); biquadfilter.gain.setvalueattime(25, audioctx.currenttime); specifications specification status comment web audio apithe definition of 'biquadfilternode' in that specification.
Body - Web APIs
WebAPIBody
the body mixin of the fetch api represents the body of the response/request, allowing you to declare what its content type is and how it should be handled.
...this provides these objects with an associated body (a stream), a used flag (initially unset), and a mime type (initially the empty byte sequence).
...you'll notice that since we are requesting an image, we need to run body.blob() (response implements body) to give the response its correct mime type.
CSS.registerProperty() - Web APIs
the css.registerproperty() method registers custom properties, allowing for property type checking, default values, and properties that do or do not inherit their value.
... 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.
... typeerror the required name and/or inherits dictionary members were not provided.
CSS - Web APIs
WebAPICSS
properties the css interface is a utility interface and no object of this type can be created: only static properties are defined on it.
... methods the css interface is a utility interface and no object of this type can be created: only static methods are defined on it.
... css.registerproperty() registers custom properties, allowing for property type checking, default values, and properties that do or do not inherit their value.
CSSMathSum - Web APIs
the cssmathsum interface of the css typed object model api represents the result obtained by calling add(), sub(), or tosum() on cssnumericvalue.
... a cssmathsum is the object type returned when the stylepropertymapreadonly.get() method is used on a css property whosevalue is created with a calc() function.
...re we may write the last three lines as: console.log( stylemap.get('width').values[1] ); // cssmathnegate {value: cssunitvalue, operator: "negate"} console.log( stylemap.get('width').values[1].value ); // cssunitvalue {value: 20, unit: "px"} console.log( stylemap.get('width').values[1].value.unit ); // 'px' specifications specification status comment css typed om level 1the definition of 'cssmathsum' in that specification.
CSSMathValue.operator - Web APIs
the cssmathvalue.operator read-only property of the cssmathvalue interface indicates the operator that the current subtype represents.
... for example, if the current cssmathvalue subtype is cssmathsum, this property will return the string "sum".
... specifications specification status comment css typed om level 1the definition of 'cssmathvalue.operator' in that specification.
CSSMathValue - Web APIs
the cssmathvalue interface of the css typed object model api a base class for classes representing complex numeric values.
... cssmathinvert cssmathmax cssmathmin cssmathnegate cssmathproduct cssmathsum properties cssmathvalue.operator indicates the operator that the current subtype represents.
... specifications specification status comment css typed om level 1the definition of 'cssmathvalue' in that specification.
CSSNumericValue.equals() - Web APIs
to return a value of true, all passed values must be of the same type and value and must be in the same order.
... examples as stated earlier, all passed values must be of the same type and value and must be in the same order.
...let matchingcssmathsum = new cssmathsum(css.px(1), css.px(2)); // prints true console.log(cssmathsum.equals(matchingcssmathsum)); let othercssmathsum = cssmathsum(css.px(2), css.px(1)); // prints false console.log(cssmathsum.equals(othercssmathsum)); // also prints false console.log(css.cm("1").equal(css.in("0.393701"))); specifications specification status comment css typed om level 1the definition of 'equals' in that specification.
CSSNumericValue.to() - Web APIs
exceptions syntaxerror indicates that an invalid type was passed to the method.
... typeerror indicates that the passed values cannot be summed.
... examples // prints "0.608542cm" console.log(css.px("23").to("com").tostring()); specifications specification status comment css typed om level 1the definition of 'to' in that specification.
CSSPseudoElement - Web APIs
csspseudoelement.type read only returns the pseudo-element selector as a cssomstring.
... methods csspseudoelement extends eventtarget, so it inherits the following methods: eventtarget.addeventlistener() registers an event handler of a specific event type on the pseudo-element.
... const element = document.queryselector('q'); const csspseudoelement = element.pseudo('::before'); console.log(csspseudoelement.element); // outputs [object htmlquoteelement] console.log(csspseudoelement.type); // outputs '::before' specifications specification status comment css pseudo-elements level 4the definition of 'csspseudoelement' in that specification.
CSSUnitValue.CSSUnitValue() - Web APIs
the cssunitvalue() constructor creates a new cssunitvalue object which returns a new cssunitvalue object which represents values that contain a single unit type.
... unit returns a usvstring indicating the type of unit.
... let pos = new csspositionvalue( new cssunitvalue(5, "px"), new cssunitvalue(10, "px")); specifications specification status comment css typed om level 1the definition of 'cssunitvalue' in that specification.
CSSUnitValue - Web APIs
the cssunitvalue interface of the css typed object model api represents values that contain a single unit type.
... cssunitvalue.unit returns a usvstring indicating the type of unit.
... let pos = new csspositionvalue( new cssunitvalue(5, "px"), new cssunitvalue(10, "px")); specifications specification status comment css typed om level 1the definition of 'cssunitvalue' in that specification.
CSSUnparsedValue - Web APIs
the cssunparsedvalue interface of the css typed object model api represents property values that reference custom properties.
... methods cssunparsedvalue.entries() returns an array of a given object's own enumerable property [key, value] pairs in the same order as that provided by a for...in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well).
... specifications specification status comment css typed om level 1the definition of 'cssunparsedvalue' in that specification.
Using the CSS properties and values API - Web APIs
the css properties and values api — part of the css houdini umbrella of apis — allows the registration of css custom properties, allowing for property type checking, default values, and properties that do or do not inherit their value.
... 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.
...when registered, though, you've told the browser what type of value it should expect, and because it knows that, it can then set up the transitions properly.
Cache - Web APIs
WebAPICache
(see selective caching live) the code uses cachestorage.open() to open any cache objects with a content-type header that starts with font/.
... // (see /docs/web/api/request/clone) return fetch(event.request.clone()).then(function(response) { console.log(' response for %s from network is: %o', event.request.url, response); if (response.status < 400 && response.headers.has('content-type') && response.headers.get('content-type').match(/^font\//i)) { // this avoids caching responses that we know are errors (i.e.
...have a content-type response header that starts with "font/".
CanvasRenderingContext2D.globalCompositeOperation - Web APIs
the canvasrenderingcontext2d.globalcompositeoperation property of the canvas 2d api sets the type of compositing operation to apply when drawing new shapes.
... syntax ctx.globalcompositeoperation = type; type is a string identifying which of the compositing or blending mode operations to use.
... types examples changing the composite operation this example uses the globalcompositeoperation property to draw two rectangles that exclude themselves where they overlap.
Drawing shapes with canvas - Web APIs
circle var endangle = math.pi + (math.pi * j) / 2; // end point on circle var anticlockwise = i % 2 !== 0; // clockwise or anticlockwise ctx.arc(x, y, radius, startangle, endangle, anticlockwise); if (i > 1) { ctx.fill(); } else { ctx.stroke(); } } } } } screenshotlive sample bezier and quadratic curves the next type of paths available are bézier curves, available in both cubic and quadratic varieties.
... making combinations so far, each example on this page has used only one type of path function per shape.
... however, there's no limitation to the number or types of paths you can use to create a shape.
ChildNode.after() - Web APIs
WebAPIChildNodeafter
h the following code: // from: https://github.com/jserz/js_piece/blob/master/dom/childnode/after()/after().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('after')) { return; } object.defineproperty(item, 'after', { configurable: true, enumerable: true, writable: true, value: function after() { var argarr = array.prototype.slice.call(arguments), docfrag = document.createdocumentfragment(); argarr.foreach(function (argitem) { var isnode = argitem instanceof node; docfrag.appendchild(isnode ?
... argitem : document.createtextnode(string(argitem))); }); this.parentnode.insertbefore(docfrag, this.nextsibling); } }); }); })([element.prototype, characterdata.prototype, documenttype.prototype]); another polyfill // from: https://github.com/fabiovergani/js-polyfill_element.prototype.after/blob/master/after.js (function(x){ var o=x.prototype,p='after'; if(!o[p]){ o[p]=function(){ var e, m=arguments, l=m.length, i=0, t=this, p=t.parentnode, n=node, s=string, d=document; if(p!==null){ while(i<l){ e=m[i]; if(e instanceof n){ t=t.nextsibling; if(t!==null){ p.insertbefore(e,t); }else{ p.appendchild(e); }; }else{ p.appendchil...
...d(d.createtextnode(s(e))); }; ++i; }; }; }; }; })(element); /* minified: (function(x){ var o=x.prototype; o.after||(o.after=function(){var e,m=arguments,l=m.length,i=0,t=this,p=t.parentnode,n=node,s=string,d=document;if(p!==null){while(i<l){((e=m[i]) instanceof n)?(((t=t.nextsibling )!==null)?p.insertbefore(e,t):p.appendchild(e)):p.appendchild(d.createtextnode(s(e)));++i;}}}); }(element)); */ specification specification status comment domthe definition of 'childnode.after()' in that specification.
ChildNode - Web APIs
WebAPIChildNode
the childnode mixin contains methods and properties that are common to all types of node objects that can have a parent.
... it's implemented by element, documenttype, and characterdata objects.
...the characterdata and documenttype implemented the new interfaces.
ClipboardEvent() - Web APIs
syntax var clipboardevent = new clipboardevent(type[, options]); parameters the clipboardevent() constructor also inherits arguments from event().
... type is a domstring representing the name of the type of the clipboardevent.
... datatype : a domstring containing the mime-type of the data contained in the data argument.
ConstrainDouble - Web APIs
the constraindouble type is used to specify a constraint for a property whose value is a double-precision floating-point number.
... candidate recommendation initial definition technically, constraindouble is actually based on an intermediary dictionary named constraindoublerange, which adds exact and ideal to doublerange, with constraindouble being a type that can be either a long integer or a doublerange.
... however, for the sake of documentation clarity, the intermediate type (present only because of quirks in webidl syntax) is ignored here.
ConstrainULong - Web APIs
the constrainulong type is used to specify a constraint for a property whose value is an integral number.
... candidate recommendation initial definition technically, constrainulong is actually based on an intermediary dictionary named constrainulongrange, which adds exact and ideal to ulongrange, with constrainulong being a type that can be either a long integer or a ulongrange.
... however, for the sake of documentation clarity, the intermediate type (present only because of quirks in webidl syntax) is ignored here.
Crypto.getRandomValues() - Web APIs
syntax typedarray = cryptoobj.getrandomvalues(typedarray); parameters typedarray an integer-based typedarray, that is an int8array, a uint8array, an int16array, a uint16array, an int32array, or a uint32array.
... return value the same array passed as typedarray but with its contents replaced with the newly generated random numbers.
... note that typedarray is modified in-place, and no copy is made.
CustomEvent() - Web APIs
syntax event = new customevent(typearg, customeventinit); parameters typearg a domstring representing the name of the event.
... customeventinit optional a customeventinit dictionary, having the following fields: "detail", optional and defaulting to null, of type any, that is an event-dependent value associated with the event.
... return value a new customevent object of the specified type, with any other properties configured according to the customeventinit dictionary (if one was provided).
DOMImplementation - Web APIs
domimplementation.createdocumenttype() creates and returns a documenttype.
... modified the return type of createdocument() from document to xmldocument.
... obsolete added the createdocument() and createdocumenttype() methods.
DataTransfer.getData() - Web APIs
the datatransfer.getdata() method retrieves drag data (as a domstring) for the specified type.
... example data types are text/plain and text/uri-list.
... syntax datatransfer.getdata(format); arguments format a domstring representing the type of data to retrieve.
DataTransferItem.getAsFile() - Web APIs
function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = event.datatransfer.items; for (var i = 0; i < data.length; i += 1) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/html'))) { // drag data item is html console.log("...
... drop: html"); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/uri-list'))) { // drag data item is uri console.log("...
... drop: uri"); } else if ((data[i].kind == 'file') && (data[i].type.match('^image/'))) { // drag data item is an image file var f = data[i].getasfile(); console.log("...
DataTransferItem.getAsString() - Web APIs
function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = ev.datatransfer.items; for (var i = 0; i < data.length; i += 1) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/html'))) { // drag data item is html console.log("...
... drop: html"); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/uri-list'))) { // drag data item is uri console.log("...
... drop: uri"); } else if ((data[i].kind == 'file') && (data[i].type.match('^image/'))) { // drag data item is an image file var f = data[i].getasfile(); console.log("...
DisplayMediaStreamConstraints.video - Web APIs
since a video track must always be included, a value of false results in a typeerror exception being thrown.
...a value of false is not permitted and will throw a typeerror.
... displaysurface a constraindomstring which specifies the types of display surface that may be selected by the user.
Element: compositionend event - Web APIs
bubbles yes cancelable yes interface compositionevent event handler property none examples const inputelement = document.queryselector('input[type="text"]'); inputelement.addeventlistener('compositionend', (event) => { console.log(`generated characters were: ${event.data}`); }); live example html <div class="control"> <label for="name">on macos, click in the textbox below,<br> then type <kbd>option</kbd> + <kbd>`</kbd>, then <kbd>a</kbd>:</label> <input type="text" id="example" name="example"> </div> <div class="event-log"> <la...
...bel>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="25"></textarea> <button class="clear-log">clear</button> </div> css body { padding: .2rem; display: grid; grid-template-areas: "control log"; } .control { grid-area: control; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } input[type="text"] { margin: .5rem 0; } kbd { border-radius: 3px; padding: 1px 2px 0; border: 1px solid black; } js const inputelement = document.queryselector('input[type="text"]'); const log = document.queryselector('.event-log-contents'); const clearlog = document.queryselector('.clear-log'); clearlog.addeventlistener('click', () => { log.textcontent = ''; }); function handleevent(event) ...
...{ log.textcontent = log.textcontent + `${event.type}: ${event.data}\n`; } inputelement.addeventlistener('compositionstart', handleevent); inputelement.addeventlistener('compositionupdate', handleevent); inputelement.addeventlistener('compositionend', handleevent); result specifications specification status ui events working draft ...
Element: compositionstart event - Web APIs
bubbles yes cancelable yes interface compositionevent event handler property none examples const inputelement = document.queryselector('input[type="text"]'); inputelement.addeventlistener('compositionstart', (event) => { console.log(`generated characters were: ${event.data}`); }); live example html <div class="control"> <label for="name">on macos, click in the textbox below,<br> then type <kbd>option</kbd> + <kbd>`</kbd>, then <kbd>a</kbd>:</label> <input type="text" id="example" name="example"> </div> <div class="event-log"> <...
...label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="25"></textarea> <button class="clear-log">clear</button> </div> css body { padding: .2rem; display: grid; grid-template-areas: "control log"; } .control { grid-area: control; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } input[type="text"] { margin: .5rem 0; } kbd { border-radius: 3px; padding: 1px 2px 0; border: 1px solid black; } js const inputelement = document.queryselector('input[type="text"]'); const log = document.queryselector('.event-log-contents'); const clearlog = document.queryselector('.clear-log'); clearlog.addeventlistener('click', () => { log.textcontent = ''; }); function handleevent(event...
...) { log.textcontent = log.textcontent + `${event.type}: ${event.data}\n`; } inputelement.addeventlistener('compositionstart', handleevent); inputelement.addeventlistener('compositionupdate', handleevent); inputelement.addeventlistener('compositionend', handleevent); result specifications specification status ui events working draft ...
Element: compositionupdate event - Web APIs
bubbles yes cancelable yes interface compositionevent event handler property none examples const inputelement = document.queryselector('input[type="text"]'); inputelement.addeventlistener('compositionupdate', (event) => { console.log(`generated characters were: ${event.data}`); }); live example html <div class="control"> <label for="name">on macos, click in the textbox below,<br> then type <kbd>option</kbd> + <kbd>`</kbd>, then <kbd>a</kbd>:</label> <input type="text" id="example" name="example"> </div> <div class="event-log"> ...
...<label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="25"></textarea> <button class="clear-log">clear</button> </div> css body { padding: .2rem; display: grid; grid-template-areas: "control log"; } .control { grid-area: control; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } input[type="text"] { margin: .5rem 0; } kbd { border-radius: 3px; padding: 1px 2px 0; border: 1px solid black; } js const inputelement = document.queryselector('input[type="text"]'); const log = document.queryselector('.event-log-contents'); const clearlog = document.queryselector('.clear-log'); clearlog.addeventlistener('click', () => { log.textcontent = ''; }); function handleevent(even...
...t) { log.textcontent = log.textcontent + `${event.type}: ${event.data}\n`; } inputelement.addeventlistener('compositionstart', handleevent); inputelement.addeventlistener('compositionupdate', handleevent); inputelement.addeventlistener('compositionend', handleevent); result specifications specification status ui events working draft ...
Element.getBoundingClientRect() - Web APIs
scripts without access to these properties can use code like this: // for scrollx (((t = document.documentelement) || (t = document.body.parentnode)) && typeof t.scrollleft == 'number' ?
... t : document.body).scrollleft // for scrolly (((t = document.documentelement) || (t = document.body.parentnode)) && typeof t.scrolltop == 'number' ?
... <div></div> div { width: 400px; height: 200px; padding: 20px; margin: 50px auto; background: purple; } let elem = document.queryselector('div'); let rect = elem.getboundingclientrect(); for (var key in rect) { if(typeof rect[key] !== 'function') { let para = document.createelement('p'); para.textcontent = `${ key } : ${ rect[key] }`; document.body.appendchild(para); } } notice how the width/height are equal to the equal to its width/height + padding.
Element.matches() - Web APIs
WebAPIElementmatches
example <ul id="birds"> <li>orange-winged parrot</li> <li class="endangered">philippine eagle</li> <li>great white pelican</li> </ul> <script type="text/javascript"> var birds = document.getelementsbytagname('li'); for (var i = 0; i < birds.length; i++) { if (birds[i].matches('.endangered')) { console.log('the ' + birds[i].textcontent + ' is endangered!'); } } </script> this will log "the philippine eagle is endangered!" to the console, since the element has indeed a class attribute with value endangered.
... polyfill for browsers that do not support element.matches() or element.matchesselector(), but include support for document.queryselectorall(), a polyfill exists: if (!element.prototype.matches) { element.prototype.matches = element.prototype.matchesselector || element.prototype.mozmatchesselector || element.prototype.msmatchesselector || element.prototype.omatchesselector || element.prototype.webkitmatchesselector || function(s) { var matches = (this.document || this.ownerdocument).queryselectorall(s), i = matches.length; while (--i >= 0 && matches.item(i) !== this) {} return i > -1; }; } however, given the practicality of supporting older browsers, the following should suffice for most (if not all) practical ...
... if (!element.prototype.matches) { element.prototype.matches = element.prototype.msmatchesselector || element.prototype.webkitmatchesselector; } specification specification status comment domthe definition of 'element.prototype.matches' in that specification.
Event.msConvertURL() - Web APIs
syntax var retval = dragevent.msconverturl(file, targettype, targeturl); parameters file [in] type: file the file object to be converted.
... targettype [in] type: domstring one of the following values indicating the desired conversion type: "specified", "base64", or "unchanged".
... targeturl [in, optional] type: url the target url.
EventTarget - Web APIs
methods eventtarget.addeventlistener() registers an event handler of a specific event type on the eventtarget.
... 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.listeners[type] = []; } this.listeners[type].push(callback); }; eventtarget.prototy...
...pe.removeeventlistener = function(type, callback) { if (!(type in this.listeners)) { return; } var stack = this.listeners[type]; for (var i = 0, l = stack.length; i < l; i++) { if (stack[i] === callback){ stack.splice(i, 1); return; } } }; eventtarget.prototype.dispatchevent = function(event) { if (!(event.type in this.listeners)) { return true; } var stack = this.listeners[event.type].slice(); for (var i = 0, l = stack.length; i < l; i++) { stack[i].call(this, event); } return !event.defaultprevented; }; specifications specification status comment domthe definition of 'eventtarget' in that specification.
FileError - Web APIs
WebAPIFileError
the objects have a code that shows the type of error that occurred.
... attribute attribute type description code unsigned short the most appropriate error code for the condition.
... type_mismatch_err 11 the app looked up an entry, but the entry found is of the wrong type.
FileSystemFlags - Web APIs
methods which accept an options parameter of this type may specify zero or more of these flags as fields in an object, like this: datadirectoryentry.getdirectory("workspace", { create: true }, function(entry) { }); here, we see that the create property is provided, with a value of true, indicating that the directory should be created if it's not already there.
... option values file/directory condition result create exclusive false n/a[1] path exists and matches the desired type (depending on whether the function called is getfile() or getdirectory() the successcallback is called with a filesystemfileentry if getfile() was called or a filesystemdirectoryentry if getdirectory() was called.
... false n/a[1] path exists but doesn't match the desired type the errorcallback is called with an appropriate error code (if the callback was provided).
FontFaceSet - Web APIs
events fontfaceset.onloading an eventlistener called whenever an event of type loading is fired, indicating a font-face set has started loading.
... fontfaceset.onloadingdone an eventlistener called whenever an event of type loadingdone is fired, indicating that a font face set has finished loading.
... fontfaceset.onloadingerror an eventlistener called whenever an event of type loadingerror is fired, indicating that an error occurred whilst loading a font-face set.
Using the Gamepad API - Web APIs
gamepadconnected), a second event is dispatched to the focused window, gamepaddisconnected: window.addeventlistener("gamepaddisconnected", function(e) { console.log("gamepad disconnected from index %d: %s", e.gamepad.index, e.gamepad.id); }); the gamepad's index property will be unique per-device connected to the system, even if multiple controllers of the same type are used.
... function buttonpressed(b) { if (typeof(b) == "object") { return b.pressed; } return b == 1.0; } function gameloop() { var gamepads = navigator.getgamepads ?
... (!haveevents) { scangamepads(); } var i = 0; var j; for (j in controllers) { var controller = controllers[j]; var d = document.getelementbyid("controller" + j); var buttons = d.getelementsbyclassname("button"); for (i = 0; i < controller.buttons.length; i++) { var b = buttons[i]; var val = controller.buttons[i]; var pressed = val == 1.0; if (typeof(val) == "object") { pressed = val.pressed; val = val.value; } var pct = math.round(val * 100) + "%"; b.style.backgroundsize = pct + " " + pct; if (pressed) { b.classname = "button pressed"; } else { b.classname = "button"; } } var axes = d.getelementsbyclassname("axis"); for (i = 0; i < controller.axes.length; i+...
GlobalEventHandlers.onerror - Web APIs
syntax for historical reasons, different arguments are passed to window.onerror and element.onerror handlers (as well as on error-type window.addeventlistener handlers).
...}) event of type errorevent contains all the information about the event and the error.
...} element.onerror accepts a function with a single argument of type event.
GlobalEventHandlers.onpointerdown - Web APIs
var targetbox = document.getelementbyid("target"); targetbox.onpointerdown = handledown; function handledown(evt) { var action; switch(evt.pointertype) { case "mouse": action = "clicking"; break; case "pen": action = "tapping"; break; case "touch": action = "touching"; break; default: action = "interacting with"; break; } targetbox.innerhtml = "<strong>thanks for " + action + " me!</strong>"; evt.preventdefault(); } this simply uses onpointerdown to establish the function h...
... the handledown() function, in turn, looks at the value of pointertype to determine what kind of pointing device was used, then uses that information to customize a string to replace the contents of the target box.
...for full effect, try it with a variety of pointer types.
GlobalEventHandlers - Web APIs
note: globaleventhandlers is a mixin and not an interface; you can't actually create an object of type globaleventhandlers.
... globaleventhandlers.ongotpointercapture is an eventhandler representing the code to be called when the gotpointercapture event type is raised.
...hen the loadend event is raised (when progress has stopped on the loading of a resource.) globaleventhandlers.onloadstart is an eventhandler representing the code to be called when the loadstart event is raised (when progress has begun on the loading of a resource.) globaleventhandlers.onlostpointercapture is an eventhandler representing the code to be called when the lostpointercapture event type is raised.
HTMLCanvasElement.mozFetchAsStream() - Web APIs
syntax void canvas.mozfetchasstream(callback, type); parameters callback an nsiinputstreamcallback.
... type optional a domstring indicating the image format.
... the default type is image/png.
HTMLElement - Web APIs
htmlelement.itemtype read only returns a domsettabletokenlist… htmlelement.itemid is a domstring representing the item id.
... living standard added the following properties: translate, itemscope, itemtype, itemid, itemref, itemprop, properties, and itemvalue.
... recommendation added the following properties: dataset, hidden, tabindex, accesskey, accesskeylabel, draggable, dropzone, contenteditable, iscontenteditable, contextmenu, spellcheck, commandtype, commandlabel, commandicon, commandhidden, commanddisabled, commandchecked, style, and all the onxyz properties.
HTMLFieldSetElement - Web APIs
the type of this property depends on the version of the spec that is implemented by the browser.
... htmlfieldsetelement.typeread only the domstring "fieldset".
... recommendation the following properties have been added: disabled, elements, name, type, valdiationmessage, validity, and willvalidate.
HTMLFormElement.elements - Web APIs
the elements included by htmlformelement.elements and htmlformelement.length are the following: <button> <fieldset> <input> (with the exception that any whose type is "image" are omitted for historical reasons) <object> <output> <select> <textarea> no other elements are included in the list returned by elements, which makes it an excellent way to get at the elements most important when processing forms.
... <form id="my-form"> <input type="text" name="username"> <input type="text" name="full-name"> <input type="password" name="password"> </form> var inputs = document.getelementbyid("my-form").elements; var inputbyindex = inputs[0]; var inputbyname = inputs["username"]; accessing form controls this example gets the form's element list, then iterates over the list, looking for <input> elements of type "text" so that some form of processing can be performed on them.
... var inputs = document.getelementbyid("my-form").elements; // iterate over the form controls for (i = 0; i < inputs.length; i++) { if (inputs[i].nodename === "input" && inputs[i].type === "text") { // update text input inputs[i].value.tolocaleuppercase(); } } disabling form controls var inputs = document.getelementbyid("my-form").elements; // iterate over the form controls for (i = 0; i < inputs.length; i++) { // disable all form controls inputs[i].setattribute("disabled", ""); } specifications specification status comment html living standardthe definition of 'htmlformelement.elements' in that specification.
HTMLImageElement.srcset - Web APIs
you may mix and match the two types of descriptor.
...notice that the candidates may use different image types.
... for more information on what image formats are available for use in the <img> element, see image file type and format guide.
HTMLInputElement: search event - Web APIs
the search event is fired when a search is initiated usinng an <input> element of type="search".
... current ua implementations of <input type="search"> have an additional control to clear the field.
... examples // addeventlistener version const input = document.queryselector('input[type="search"]'); input.addeventlistener('search', () => { console.log("the term searched for was " + input.value); }) // onsearch version const input = document.queryselector('input[type="search"]'); input.onsearch = () => { console.log("the term searched for was " + input.value); }) specifications this event is not part of any specification.
HTMLLIElement - Web APIs
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.
... recommendation the following property is now obsolete: type.
HTMLMediaElement: loadstart event - Web APIs
bubbles no cancelable no interface event event handler property onloadstart examples live example html <div class="example"> <button type="button">load video</button> <video controls width="250"></video> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "button log" "video log"; } button { grid-area: button; width: 10rem; margin: .5rem 0; } vi...
...deo { grid-area: video; } .event-log { grid-area: log; } .event-log>label { display: block; } js const loadvideo = document.queryselector('button'); const video = document.queryselector('video'); const eventlog = document.queryselector('.event-log-contents'); let source = null; function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}\n`; } video.addeventlistener('loadstart', handleevent); video.addeventlistener('progress', handleevent); video.addeventlistener('canplay', handleevent); video.addeventlistener('canplaythrough', handleevent); loadvideo.addeventlistener('click', () => { if (source) { document.location.reload(); } else { loadvideo.textcontent = "reset example"; source = document.createelement('sourc...
...e'); source.setattribute('src', 'https://interactive-examples.mdn.mozilla.net/media/examples/flower.webm'); source.setattribute('type', 'video/webm'); video.appendchild(source); } }); result specifications specification status html living standardthe definition of 'loadstart media event' in that specification.
HTMLMediaElement: progress event - Web APIs
bubbles no cancelable no interface event event handler property onprogress examples live example html <div class="example"> <button type="button">load video</button> <video controls width="250"></video> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "button log" "video log"; } button { grid-area: button; width: 10rem; margin: .5rem 0; } video {...
... grid-area: video; } .event-log { grid-area: log; } .event-log>label { display: block; } javascript const loadvideo = document.queryselector('button'); const video = document.queryselector('video'); const eventlog = document.queryselector('.event-log-contents'); let source = null; function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}\n`; } video.addeventlistener('loadstart', handleevent); video.addeventlistener('progress', handleevent); video.addeventlistener('canplay', handleevent); video.addeventlistener('canplaythrough', handleevent); loadvideo.addeventlistener('click', () => { if (source) { document.location.reload(); } else { loadvideo.textcontent = "reset example"; source = document.createelement('so...
...urce'); source.setattribute('src', 'https://interactive-examples.mdn.mozilla.net/media/examples/flower.webm'); source.setattribute('type', 'video/webm'); video.appendchild(source); } }); result specifications specification status html living standardthe definition of 'progress media event' in that specification.
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.
... htmlscriptelement.type is a domstring representing the mime type of the script.
... it reflects the type attribute.
HTMLSelectElement.add() - Web APIs
syntax collection.add(item[, before]); parameters item is an htmloptionelement or htmloptgroupelement before is optional and an element of the collection, or an index of type long, representing the item item should be inserted before.
... exceptions a domerror of the type hierarchyrequesterror if the item passed to the method is an ancestor of the htmlselectelement.
...it throws a domerror of the type hierarchyrequesterror if the passed item is an ancestor of the htmlselectelement and no longer throws if the before parameter is not found.
HTMLSelectElement.form - Web APIs
syntax edit aform = aselectelement.form.selectname; example html <form action="http://www.google.com/search" method="get"> <label>google: <input type="search" name="q"></label> <input type="submit" value="search..."> </form> javascript a property available on all form elements, "type" returns the type of the calling form element.
... for select, the two possible values are "select-one" or "select-multiple", depending on the type of selection list.
... the below code gives all select elements in a particular form a css class of "selectclass": <script type="text/javascript"> var form_element = document.getelementbyid('subscribe_form'); var vist = form_element.style; if (vist.display=='' || vist.display=='none') { vist.display = 'block'; } else { vist.display = 'none'; } </script> specifications specification status comment html living standardthe definition of 'form' in that specification.
Headers - Web APIs
WebAPIHeaders
note: all of the headers methods will throw a typeerror if you try to pass in a reference to a name that isn't a valid http header name.
... the mutation operations will throw a typeerror if the header has an immutable guard.
... examples in the following snippet, we create a new header using the headers() constructor, add a new header to it using append(), then return that header value using get(): var myheaders = new headers(); myheaders.append('content-type', 'text/xml'); myheaders.get('content-type') // should return 'text/xml' the same can be achieved by passing an array of arrays or an object literal to the constructor: var myheaders = new headers({ 'content-type': 'text/xml' }); // or, using an array of arrays: myheaders = new headers([ ['content-type', 'text/xml'] ]); myheaders.get('content-type') // should return 'text/xml' spec...
IDBDatabase.transaction() - Web APIs
mode optional the types of access that can be performed in the transaction.
... exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror the close() method has previously been called on this idbdatabase instance.
... typeerror the value for the mode parameter is invalid.
IDBIndex.getAll() - Web APIs
WebAPIIDBIndexgetAll
if it is lower than 0 or greater than 232-1 a typeerror exception will be thrown.
... exceptions this method may raise a domexception of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive.
... a typeerror exception is thrown if the count parameter is not between 0 and 232-1 included.
IDBIndex.getAllKeys() - Web APIs
if it is lower than 0 or greater than 232-1 a typeerror exception will be thrown.
... exceptions this method may raise a domexception of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive.
... a typeerror exception is thrown if the count parameter is not between 0 and 232-1 included.
IDBKeyRange.includes() - Web APIs
this can be any type.
... exceptions this method may raise a domexception of the following type: attribute description dataerror the supplied key was not a valid key.
... idbkeyrange.prototype.includes = idbkeyrange.prototype.includes || function(key) { var r = this, c; if (r.lower !== undefined) { c = indexeddb.cmp(key, r.lower); if (r.loweropen && c <= 0) return false; if (!r.loweropen && c < 0) return false; } if (r.upper !== undefined) { c = indexeddb.cmp(key, r.upper); if (r.upperopen && c >= 0) return false; if (!r.upperopen && c > 0) return false; } ...
IDBObjectStore.getAll() - Web APIs
if it is lower than 0 or greater than 232-1 a typeerror exception will be thrown.
... exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive.
... a typeerror exception is thrown if the count parameter is not between 0 and 232-1 included.
KeyboardEvent.initKeyEvent() - Web APIs
syntax event.initkeyevent (type, bubbles, cancelable, viewarg, ctrlkeyarg, altkeyarg, shiftkeyarg, metakeyarg, keycodearg, charcodearg) parameters type is a domstring representing the type of event.
... example var event = document.createevent('keyboardevent'); // create a key event // define the event event.initkeyevent("keypress", // typearg, true, // canbubblearg, true, // cancelablearg, null, // viewarg, specifies uievent.view.
... the initkeyevent is the current gecko equivalent of the dom level 3 events (initially drafted and also deprecated in favor of keyboardevent() keyboard.initkeyboardevent() method with the following arguments : typearg of type domstring canbubblearg of type boolean cancelablearg of type boolean viewarg of type views::abstractview keyidentifierarg of type domstring keylocationarg of type unsigned long modifierslist of type domstring); ...
LocalFileSystemSync - Web APIs
example //taking care of the browser-specific prefix window.requestfilesystemsync = window.requestfilesystemsync || window.webkitrequestfilesystemsync; // the first parameter defines the type of storage: persistent or temporary // next, set the size of space needed (in bytes) // initfs is the success callback // and the last one is the error callback // for denial of access and other errors.
... method overview filesystemsync requestfilesystemsync (in unsigned short type, in long long size) raises fileexception; entrysync resolvelocalfilesystemsyncurl (in domstring url) raises fileexception; constants constant value description temporary 0 transient storage that can be be removed by the browser at its discretion.
...[ research ] filesystemsync requestfilesystemsync( in unsigned short type, in unsigned long long size ); parameters type the storage type of the file system.
MediaCapabilities.decodingInfo() - Web APIs
syntax mediacapabilities.decodinginfo(mediadecodingconfiguration) parameters mediadecodingconfiguration a valid mediadecodingconfiguration dictionary containing a valid media decoding type of file or media-source and a valid media configuration: either an audioconfiguration or a videoconfiguration.
... return value a promise fulfilling with a mediacapabilitiesinfo interface containing three boolean attributes: supported smooth powerefficient exceptions a typeerror is raised if the mediaconfiguration passed to the decodinginfo() method is invalid, either because the type is not video or audio, the contenttype is not a valid codec mime type, the media decoding configuration is not a valid value for the media decoding type, or any other error in the media configuration passed to the method, including omitting values required in the media decoding configuration.
... example //create media configuration to be tested const mediaconfig = { type : 'file', // or 'media-source' audio : { contenttype : "audio/ogg", // valid content type channels : 2, // audio channels used by the track bitrate : 132700, // number of bits used to encode 1s of audio samplerate : 5200 // number of audio samples making up that 1s.
MediaDecodingConfiguration - Web APIs
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.
... examples //create media configuration to be tested const mediaconfig = { type : 'file', // or 'media-source' video : { contenttype : "video/webm;codecs=vp8", // valid content type width : 800, // width of the video height : 600, // height of the video bitrate : 10000, // number of bits used to encode 1s of video framerate : 30 // number of frames making up that 1s.
MediaEncodingConfiguration - Web APIs
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.
... examples //create media configuration to be tested const mediaconfig = { type : 'record', // or 'transmission' video : { contenttype : "video/webm;codecs=vp8", // valid content type width : 800, // width of the video height : 600, // height of the video bitrate : 10000, // number of bits used to encode 1s of video framerate : 30 // number of frames making up that 1s.
MediaStreamAudioSourceNode - Web APIs
the mediastreamaudiosourcenode interface is a type of audionode which operates as an audio source whose media is received from a mediastream obtained using the webrtc or media capture and streams apis.
... usage notes typically, you should probably not use this type of node.
...ta = function(e) { video.play(); video.muted = true; }; // create a mediastreamaudiosourcenode // feed the htmlmediaelement into it var audioctx = new audiocontext(); var source = audioctx.createmediastreamsource(stream); // create a biquadfilter var biquadfilter = audioctx.createbiquadfilter(); biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = range.value; // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination, so we can play the // music and adjust the volume using the mouse cursor source.connect(biquadfilter); biquadfilter.connect(audioctx.destination); // ...
Recording a media element - Web APIs
audio: true }).then(stream => { preview.srcobject = stream; downloadbutton.href = stream; preview.capturestream = preview.capturestream || preview.mozcapturestream; return new promise(resolve => preview.onplaying = resolve); }).then(() => startrecording(preview.capturestream(), recordingtimems)) .then (recordedchunks => { let recordedblob = new blob(recordedchunks, { type: "video/webm" }); recording.src = url.createobjecturl(recordedblob); downloadbutton.href = recording.src; downloadbutton.download = "recordedvideo.webm"; log("successfully recorded " + recordedblob.size + " bytes of " + recordedblob.type + " media."); }) .catch(log); }, false); when a click event occurs, here's what happens: lines 2-4 navigator.mediadevices.getus...
...the first thing we do is merge the chunks into a single blob whose mime type is "video/webm" by taking advantage of the fact that the blob() constructor concatenates arrays of objects into one object.
... lines 17-18 the size and type of the recorded media are output to the log area below the two videos and the download button.
Using the MediaStream Recording API - Web APIs
we style the <label> how we want it, making sure that it has enough z-index to always sit above the other elements and therefore be focusable/clickable: label { font-family: 'notocoloremoji'; font-size: 3rem; position: absolute; top: 2px; right: 3px; z-index: 5; cursor: pointer; } then we hide the actual checkbox, because we don't want it cluttering up our ui: input[type=checkbox] { position: absolute; top: -100px; } next, we style the information screen (wrapped in an <aside> element) how we want it, give it fixed position so that it doesn't appear in the layout flow and affect the main ui, transform it to the position we want it to sit in by default, and give it a transition for smooth showing/hiding: aside { position: fixed; top: 0; left: 0; ...
...ht: 100%; transform: translatex(100%); transition: 0.6s all; background-color: #999; background-image: linear-gradient(to top right, rgba(0,0,0,0), rgba(0,0,0,0.5)); } last, we write a rule to say that when the checkbox is checked (when we click/focus the label), the adjacent <aside> element will have its horizontal translation value changed and transition smoothly into view: input[type=checkbox]:checked ~ aside { transform: translatex(0); } basic app setup to grab the media stream we want to capture, we use getusermedia().
...onst deletebutton = document.createelement('button'); clipcontainer.classlist.add('clip'); audio.setattribute('controls', ''); deletebutton.innerhtml = "delete"; cliplabel.innerhtml = clipname; clipcontainer.appendchild(audio); clipcontainer.appendchild(cliplabel); clipcontainer.appendchild(deletebutton); soundclips.appendchild(clipcontainer); const blob = new blob(chunks, { 'type' : 'audio/ogg; codecs=opus' }); chunks = []; const audiourl = window.url.createobjecturl(blob); audio.src = audiourl; deletebutton.onclick = function(e) { let evttgt = e.target; evttgt.parentnode.parentnode.removechild(evttgt.parentnode); } } let's go through the above code and look at what's happening.
MediaTrackConstraints.displaySurface - Web APIs
this is used to specify the type or types of display surfaces which getdisplaymedia() will let the user select among for sharing purposes.
... syntax var constraintsobject = { displaysurface: constraint }; constraintsobject.displaysurface = constraint; value a constraindomstring which specifies the type of display surface that's being captured.
... there's possibly a non-content backdrop—it can use code similar to this: let mayhavebackdropflag = false; let displaysurface = displaystream.getvideotracks()[0].getsettings().displaysurface; if (displaysurface === "monitor" || displaysurface ==="application") { mayhavebackdropflag = true; } following this code, mayhavebackdrop is true if the display surface contained in the stream is of type monitor or application; either of these may have non-content backdrop areas.
MediaTrackSettings.displaySurface - Web APIs
the mediatracksettings dictionary's displaysurface property indicates the type of display surface being captured.
... syntax displaysurface = mediatracksettings.displaysurface; value the value of displaysurface is a string that comes from the displaycapturesurfacetype enumerated type, and is one of the following: application the stream's video track contains all of the windows belonging to the application chosen by the user.
... not all user agents support all of these surface types.
Media Session API - Web APIs
mediasessionactiondetails provides information needed in order to perform the action which has been requested, including the type of action to perform and any other information needed, such as seek distances or times.
...it then instantiates a metadata object for the session, and adds event handlers for the user control actions: if ('mediasession' in navigator) { navigator.mediasession.metadata = new mediametadata({ title: 'unforgettable', artist: 'nat king cole', album: 'the ultimate collection (remastered)', artwork: [ { src: 'https://dummyimage.com/96x96', sizes: '96x96', type: 'image/png' }, { src: 'https://dummyimage.com/128x128', sizes: '128x128', type: 'image/png' }, { src: 'https://dummyimage.com/192x192', sizes: '192x192', type: 'image/png' }, { src: 'https://dummyimage.com/256x256', sizes: '256x256', type: 'image/png' }, { src: 'https://dummyimage.com/384x384', sizes: '384x384', type: 'image/png' }, { src: 'https://dummyimage.com/51...
...2x512', sizes: '512x512', type: 'image/png' }, ] }); navigator.mediasession.setactionhandler('play', function() { /* code excerpted.
MouseEvent - Web APIs
mouseevent.mozinputsource read only the type of device that generated the event (one of the moz_source_* constants listed below).
... html <p><label><input type="checkbox" id="checkbox"> checked</label> <p><button id="button">click me</button> javascript function simulateclick() { var evt = new mouseevent("click", { bubbles: true, cancelable: true, view: window }); var cb = document.getelementbyid("checkbox"); //element to click on var canceled = !cb.dispatchevent(evt); if(canceled) { // a handler called preventdefault ale...
...this means that a pointerevent whose pointertype is mouse will be a double.
MutationRecord - Web APIs
properties property type description mutationrecord.type string returns "attributes" if the mutation was an attribute mutation, "characterdata" if it was a mutation to a characterdata node, and "childlist" if it was a mutation to the tree of nodes.
... mutationrecord.target node returns the node the mutation affected, depending on the mutationrecord.type.
... mutationrecord.oldvalue string the return value depends on the mutationrecord.type.
Using Navigation Timing - Web APIs
determining navigation type to put the timing information obtained from performancetiming into the correct perspective, you need to know more about what sort of load operation occurred.
...the new code looks like this: window.addeventlistener("load", function() { let now = new date().gettime(); let loadingtime = now - performance.timing.navigationstart; output = "load time: " + loadingtime + " ms<br/>"; output += "navigation type: "; switch(performance.navigation.type) { case performancenavigation.type_navigate: output += "navigation"; break; case performancenavigation.type_reload: output += "reload"; break; case performancenavigation.type_back_forward: output += "history"; break; default: output += "unknown"; break; } output += "<br/>redire...
...performance.navigation.type indicates what kind of load operation took place: a navigation, a reload, or a shift through the browser's history.
Navigation Timing API - Web APIs
while this interface is defined by the high resolution time api, the navigation timing api adds two properties: timing and navigation, of the types below.
... performancetiming used as the type for the value of timing, objects of this type contain timing information that can provide insight into web page performance.
... performancenavigation the type used to return the value of navigation, which contains information explaining the context of the load operation described by this performance instance.
Navigator.registerContentHandler() - Web APIs
allows web sites to register themselves as possible handlers for content of a particular mime type.
... syntax navigator.registercontenthandler(mimetype, uri, title); mimetype is the desired mime type as a string.
... example navigator.registercontenthandler( "application/vnd.mozilla.maybe.feed", "http://www.example.tld/?foo=%s", "my feed reader" ); notes for firefox 2 and above, only the application/vnd.mozilla.maybe.feed, application/atom+xml, and application/rss+xml mime types are supported.
NetworkInformation - Web APIs
the networkinformation interface provides information about the connection a device is using to communicate with the network and provides a means for scripts to be notified if the connection type changes.
... networkinformation.effectivetype read only returns the effective type of the connection meaning one of 'slow-2g', '2g', '3g', or '4g'.
... networkinformation.type read only returns the type of connection a device is using to communicate with the network.
Node.localName - Web APIs
WebAPINodelocalName
syntax name = element.localname name is the local name as a string (see notes below for details) example (must be served with xml content type, such as text/xml or application/xhtml+xml.) <html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg"> <head> <script type="application/javascript"><![cdata[ function test() { var text = document.getelementbyid('text'); var circle = document.getelementbyid('circle'); text.value = "<svg:circle> has:\n" + "localname = '" + circle.localname + "'\n" + "namespaceuri = '" + circle.names...
...for example, in the qualified name ecomm:partners, partners is the local name and ecomm is the prefix: <ecomm:business id="soda_shop" type="brick_n_mortar" xmlns:ecomm="http://example.com/ecomm"> <ecomm:partners> <ecomm:partner id="1001">tony's syrup warehouse </ecomm:partner> </ecomm:partners> </ecomm:business> note: in gecko 1.9.2 and earlier, the property returns the upper-cased version of the local name for html elements in html doms (as opposed to xhtml elements in xml doms).
... for nodes of any type other than element_node and attribute_node localname is always null.
NodeIterator.whatToShow - Web APIs
the nodeiterator.whattoshow read-only property represents an unsigned integer representing a bitmask signifying what types of nodes should be returned by the nodeiterator.
... syntax var nodetypes = nodeiterator.whattoshow; the values that can be combined to form the bitmask are: constant numerical value description nodefilter.show_all -1 (that is the max value of unsigned long) shows all nodes.
... nodefilter.show_document_type 512 shows documenttype nodes.
NodeList - Web APIs
WebAPINodeList
this can be circumvented by using array.prototype.foreach() — see this document's example.
... 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 (foreach()) as well as entries(), values(), and keys().
... there is also an internet explorer-compatible way to use array.prototype.foreach for iteration: const list = document.queryselectorall('input[type=checkbox]'); array.prototype.foreach.call(list, function (checkbox) { checkbox.checked = true; }); specifications specification status comment domthe definition of 'nodelist' in that specification.
OES_texture_float - Web APIs
the oes_texture_float extension is part of the webgl api and exposes floating-point pixel types for textures.
... extended methods this extension extends webglrenderingcontext.teximage2d() and webglrenderingcontext.texsubimage2d(): the type parameter now accepts gl.float.
... the pixels parameter now accepts an arraybufferview of type float32array.
OscillatorNode - Web APIs
oscillatornode.type a string which specifies the shape of waveform to play; this can be one of a number of standard values, or custom to use a periodicwave to describe a custom waveform.
... methods inherits methods from its parent, audioscheduledsourcenode, and adds the following: oscillatornode.setperiodicwave() sets a periodicwave which describes a periodic waveform to be used instead of one of the standard waveforms; calling this sets the type to custom.
... // create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.type = 'square'; oscillator.frequency.setvalueattime(440, audioctx.currenttime); // value in hertz oscillator.connect(audioctx.destination); oscillator.start(); specifications specification status comment web audio apithe definition of 'oscillatornode' in that specification.
PaymentRequest.PaymentRequest() - Web APIs
this has to conform to the type expected by the payment handler indicated by supportedmethods.
...if you set this type to true, you should select an appropriate shippingtype.
... shippingtype lets you specify how the user interface refers to shipping when the word 'shipping' isn't appropriate for your use case.
performance.clearMarks() - Web APIs
if the method is called with no arguments, all performance entries with an entry type of "mark" will be removed from the performance entry buffer.
...if this argument is omitted, all performance entries with an entry type of "mark" will be removed.
...function logmarkcount() { console.log( "found this many entries: " + performance.getentriesbytype("mark").length ); } // create a bunch of marks.
performance.clearMeasures() - Web APIs
if the method is called with no arguments, all performance entries with an entry type of "measure" will be removed from the performance entry buffer.
...if this argument is omitted, all performance entries with an entry type of "measure" will be removed.
...function logmeasurecount() { console.log( "found this many entries: " + performance.getentriesbytype("measure").length ); } // create a bunch of measures.
performance.measure() - Web APIs
the measure can be retrieved by one of the performance interfaces: (getentries(), getentriesbyname() or getentriesbytype()).
... the measure's performance entry will have the following property values: entrytype - set to "measure".
... console.log(performance.getentriesbytype("measure")); // finally, clean up the entries.
PerformanceMark - Web APIs
performancemark is an abstract interface for performanceentry objects with an entrytype of "mark".
... entries of this type are created by calling performance.mark() to add a named domhighrestimestamp (the mark) to the browser's performance timeline.
..." 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".
PerformanceMeasure - Web APIs
performancemeasure is an abstract interface for performanceentry objects with an entrytype of "measure".
... entries of this type are created by calling performance.measure() to add a named domhighrestimestamp (the measure) between two marks to the browser's performance timeline.
...nt-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".
PerformanceNavigationTiming - Web APIs
stroke-width="2px" /><text x="336" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performancenavigationtiming</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface extends the following performanceentry properties for navigation performance entry types by qualifying and constraining them as follows: performanceentry.entrytype read only returns "navigation".
... this interface also extends following performanceresourcetiming properties for navigation performance entry types by qualifying and constraining them as follows: performanceresourcetiming.initiatortyperead only returns "navigation".
... performancenavigationtiming.type read only a string representing the navigation type.
PerformanceObserver - Web APIs
methods performanceobserver.observe() specifies the set of entry types to observe.
... the performance observer's callback function will be invoked when a performance entry is recorded for one of the specified entrytypes performanceobserver.disconnect() stops the performance observer callback from receiving performance entries.
... example function perf_observer(list, observer) { // process the "measure" event } var observer2 = new performanceobserver(perf_observer); observer2.observe({entrytypes: ["measure"]}); specifications specification status comment performance timeline level 2the definition of 'performanceobserver' in that specification.
PerformanceObserverEntryList - Web APIs
performanceobserverentrylist.getentriesbytype() returns a list of explicitly observed performanceentry objects of the given entry type.
... performanceobserverentrylist.getentriesbyname() returns a list of explicitly observed performanceentry objects based on the given name and entry type.
... example // create observer for all performance event types // list is of type performanceobserveentrylist var observe_all = new performanceobserver(function(list, obs) { var perfentries = list.getentries(); for (var i = 0; i < perfentries.length; i++) { print_perf_entry(perfentries[i]); // do something with it } }) specifications specification status comment performance timeline level 2the definition of 'performanceobserverentrylist' in that specification.
PerformancePaintTiming - Web APIs
an application can register a performanceobserver for "paint" performance entry types and the observer can retrieve the times that paint events occur.
..." /><text x="311" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performancepainttiming</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 (for "paint" performance entry types) by qualifying and constraining the properties as follows: performanceentry.entrytype returns "paint".
... example function showpainttimings() { if (window.performance) { let performance = window.performance; let performanceentries = performance.getentriesbytype('paint'); performanceentries.foreach( (performanceentry, i, entries) => { console.log("the time to " + performanceentry.name + " was " + performanceentry.starttime + " milliseconds."); }); } else { console.log('performance timing isn\'t supported.'); } } the code above produces console output something like the following: the time to first-paint was 2785.915 milliseconds.
PerformanceResourceTiming - Web APIs
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.
... 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".
... performanceresourcetiming.initiatortyperead only a string representing the type of resource that initiated the performance entry, as specified in performanceresourcetiming.initiatortype.
Using the Performance API - Web APIs
the domhighrestimestamp type (a double) is used by all performance interfaces to hold such time values.
... high precision timing high precision timing is achieved by using the domhighrestimestamp type for time values.
...the now() method returns a timestamp (of type domhighrestimestamp) that is a discrete point in time.
PromiseRejectionEvent() - Web APIs
there are two types of promiserejectionevent: unhandledrejection is sent by the javascript runtime when a promise is rejected but the rejection goes unhandled.
... syntax promiserejectionevent = promiserejectionevent(type, options); parameters the promiserejectionevent() constructor also inherits parameters from event().
... type a string representing the name of the type of the promiserejectionevent.
PublicKeyCredential - Web APIs
properties publickeycredential.type read only secure context inherited from credential.
...it is either of type authenticatorattestationresponse if the publickeycredential was the results of a navigator.credentials.create() call, or of type authenticatorassertionresponse if the publickeycredential was the result of a navigator.credentials.get() call.
... var publickey = { challenge: /* from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(16), name: "jdoe@example.com", displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { var response = newcredentialinfo.response; var clientextensionsresults = newcredentialinfo.getclientextensionresults(); }).catch(function (err) { console.error(err); }); getting an existing instance of publickeycredential here, we fetch an existing crede...
PublicKeyCredentialCreationOptions.excludeCredentials - Web APIs
syntax excludecredentials = publickeycredentialcreationoptions.excludecredentials value an array whose elements are objects with the following properties: type a string describing type of public-key credential to be created.
... examples var publickey = { excludecredentials: [ { type: "public-key", // the id for john.doe@example.com id : new uint8array(26) /* this actually is given by the server */ }, { type: "public-key", // the id for john-doe@example.com id : new uint8array(26) /* another id */ } ], challenge: new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.ex...
...ample.com" }, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'excludecredentials' in that specification.
PublicKeyCredentialCreationOptions.pubKeyCredParams - Web APIs
these objects define the type of public-key and the algorithm used for cryptographic signature operations.
... syntax pubkeycredparams = publickeycredentialcreationoptions.pubkeycredparams value an array whose elements are objects with the following properties: type a string describing type of public-key credential to be created.
... examples var publickey = { pubkeycredparams: [ // we would like an elliptic curve to be used if possible { type: "public-key", alg: -7 }, // if not, then we will fallback on an rsa algorithm { type: "public-key", alg: -37 } ], challenge: new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com",...
PublicKeyCredentialCreationOptions - Web APIs
publickeycredentialcreationoptions.pubkeycredparams an array of element which specify the desired features of the credential, including its type and the algorithm used for the cryptographic signature operations.
...smith", }, // requested format of new keypair pubkeycredparams: [{ type: "public-key", alg: cose_alg_ecdsa_w_sha256, }], // timeout after 1 minute timeout: 60000, // do not send the authenticator's origin attestation attestation: "none", extensions: { uvm: true, exts: true }, // filter out authenticators which are bound to the device authenticatorselection:{ ...
... authenticatorattachment: "cross-platform", requireresidentkey: true, userverification: "preferred" }, // exclude already existing credentials for the user excludecredentials: [ { type: "public-key", // the id for john.doe@example.com id : new uint8array(26) /* this actually is given by the server */ }, { type: "public-key", // the id for john-doe@example.com id : new uint8array(26) /* another id */ } ] } }; // create the new credential with the options above navigator.credentials.create(createcredentialoptions) .then(function (newcredentialinfo) { var attestationresponse = newcredentialinfo.response; var clientex...
PublicKeyCredentialRequestOptions.extensions - Web APIs
also chrome doesn't plan to support any other extension in future extension identifier type description appid usvstring fido appid.
... txauthgeneric an object with two properties: contenttype (usvstring) content (arraybuffer) generic transaction authorization.
...the contenttype gives the mime type of the resource to be displayed while content gives its actual content.
RTCConfiguration - Web APIs
certificates optional an array of objects of type rtccertificate which are used by the connection for authentication.
... constant description "balanced" the ice agent initially creates one rtcdtlstransport for each type of content added: audio, video, and data channels.
... if the remote endpoint is not bundle-aware, then each of these dtls transports then handles all the communication for one type of data.
RTCDataChannelEvent() - Web APIs
syntax var event = new rtcdatachannelevent(type, rtcdatachanneleventinit); parameters type a domstring which specifies the name of the event.
... there is only one type of rtcdatachannelevent, so this will always be "datachannel".
... rtcdatachanneleventinit a rtcdatachanneleventinit dictionary, which has following fields: "channel" of type rtcdatachannel, representing the data channel being concerned by the event.
RTCIceCandidate.relatedAddress - Web APIs
relatedaddress can be used for diagnostic purposes; by observing the relationships between the various types of candidates and their addresses and related addresses.
... example in this example, the candidate's type is checked, and then debugging output is presented, based on the candidate type, including the candidate's ip and relatedaddress.
... switch(candidate.type) { case "host": console.log("host candidate's ip address is " + candidate.ip); break; case "srflx": console.log("server reflexive candidate's base address is " + candidate.relatedaddress + "; reachable at " + candidate.ip); break; case "prflx": console.log("peer reflexive candidate's base address is " + candidate.relatedaddress + "; reachable at " + candidate.ip); break; case "relay": console.log("relay candidate's address assigned by the turn server is " + candidate.relatedaddress + "; reachable at " + candidate.ip); break; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidate.relatedaddress' in that sp...
RTCIceCandidatePairStats - Web APIs
if a rtcstats-based object's type is candidate-pair, it's an rtcicecandidatepairstats object.
...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.
... if (rtcstats && rtcstats.type === "candidate-pair") { let elapsed = (rtcstats.lastrequesttimestamp - rtcstats.firstrequesttimestamp) / rtcstats.requestssent; log("average time between ice connectivity checks: " + elapsed + " ms."); } the code begins by looking at rtcstats to see if its type is candidate-pair.
RTCIceCandidateStats.deleted - Web APIs
dthe exact meaning varies depending on the type of candidate: local candidate a value of true means the candidate has been deleted as described by rfc 5245: 8.3.
... window.setinterval(function() { mypeerconnection.getstats(null).then(stats => { let statsoutput = ""; stats.foreach(report => { if ((stats.type === "local-candidate" || stats.type === "remote.candidate") && !stats.deleted) { statsoutput += `<h2>report: ${report.type}</h3>\n<strong>id:</strong> ${report.id}<br>\n` + `<strong>timestamp:</strong> ${report.timestamp}<br>\n`; // now the statistics for this report; we intentially drop the ones we // sorted to the top above object.keys(re...
...port).foreach(statname => { if (statname !== "id" && statname !== "timestamp" && statname !== "type") { statsoutput += `<strong>${statname}:</strong> ${report[statname]}<br>\n`; } }); } }); document.queryselector(".stats-box").innerhtml = statsoutput; }); }, 1000); specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatestats.deleted' in that specification.
RTCIceProtocol - Web APIs
the webrtc api's rtciceprotocol enumerated type provides a set of domstring values representing the names of the transport protocols ice candidates can use.
...the tcptype property provides additional information about the kind of tcp candidate represented by the object.
... usage notes the rtciceprotocol type is used by the protocol property of rtcicecandidate objects.
RTCIceServer - Web APIs
objects of this type are provided in the configuration of an rtcpeerconnection, in the iceservers array.
... 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.
RTCRtpTransceiverDirection - Web APIs
the rtcrtptransceiverdirection type is an enumerated set of strings which are used to describe the directionality of a rtcrtptransceiver instance.
... both the preferred direction and the currentdirection properties are of this type.
... values the rtcrtptransceiverdirection type is an enumeration of string values.
RTCSessionDescriptionCallback - Web APIs
the rtcsessiondescriptioncallback type is used to represent the callback function passed into the deprecated callback-based version of createoffer() or createanswer() when using them to create offers or answers.
... because this function type is part of the legacy webrtc api, you should avoid using it (and the callback-based forms of createoffer() and createanswer() that make use of it).
...this object contains the type and sdp properties which are part of rtcsessiondescription.
Range.setEnd() - Web APIs
WebAPIRangesetEnd
exceptions exceptions are thrown as domexception objects of the following types: invalidnodetypeerror the node specified by endnode is a doctype node; range endpoints cannot be located inside a doctype node.
... usage notes if the endnode is a node of type text, comment, or cdatasection, then endoffset is the number of characters from the start of endnode.
... for other node types, endoffset is the number of child nodes between the start of the endnode.
RenderingContext - Web APIs
renderingcontext is a webidl typedef which can refer to any one of the interfaces that represent a graphics rendering context within a <canvas> element: canvasrenderingcontext2d, webglrenderingcontext, or webgl2renderingcontext.
...there is no renderingcontext interface, and there are no objects which implement type renderingcontext.
... the primary use of this type is the definition of the <canvas> element's htmlcanvaselement.getcontext() method, which returns a renderingcontext (meaning it returns any one of the rendering context types).
Report.body - Web APIs
WebAPIReportbody
depending on what type the report is, the object returned will actually be a deprecationreportbody, interventionreportbody, crashreportbody, or featurepolicyviolationreportbody.
... these all inherit from the base reportbody class — study their reference pages for more information on what the particular report body types contain.
... examples let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { let firstreport = reports[0]; // log the first report's report body, i.e.
Report - Web APIs
WebAPIReport
report.type read only the type of report generated, e.g.
... examples in our deprecation_report.html example, we create a simple reporting observer to observe usage of deprecated features on our web page: let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { reportbtn.onclick = () => displayreports(reports); }, options); we then tell it to start observing reports using reportingobserver.observe(); this tells the observer to start collecting reports in its report queue, and runs the callback function specified inside the constructor: observer.observe(); because...
...ch takes the observer callback's reports parameter as its parameter: function displayreports(reports) { const outputelem = document.queryselector('.output'); const list = document.createelement('ul'); outputelem.appendchild(list); for(let i = 0; i < reports.length; i++) { let listitem = document.createelement('li'); let textnode = document.createtextnode('report ' + (i + 1) + ', type: ' + reports[i].type); listitem.appendchild(textnode); let innerlist = document.createelement('ul'); listitem.appendchild(innerlist); list.appendchild(listitem); for (let key in reports[i].body) { let innerlistitem = document.createelement('li'); let keyvalue = reports[i].body[key]; innerlistitem.textcontent = key + ': ' + keyvalue; innerlist.appendchi...
ReportingObserver() - Web APIs
the available options are: types: an array of strings representing the types of report to be collected by this observer.
... available types include deprecation, intervention, and crash (although this last type usually isn't retrievable via a reportingobserver).
... examples let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { reportbtn.onclick = () => displayreports(reports); }, options); specifications specification status comment reporting apithe definition of 'reportingobserver()' in that specification.
ReportingObserverOptions - Web APIs
properties types an array of strings representing the types of report to be collected by this observer.
... available types include deprecation, intervention, and crash.
... examples let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { reportbtn.onclick = () => displayreports(reports); }, options); specifications specification status comment reporting apithe definition of 'reportingobserveroptions' in that specification.
Reporting API - Web APIs
the callback runs when observation starts an options dictionary that allows you to specify the type of reports to collect, and whether the reports that were generated before the observer was able to be created should be observable (buffered: true).
... available report types the spec defines the following report types: deprecation report indicates that a webapi or other browser feature being used in the website is expected to stop working in a future release.
... examples in our deprecation_report.html example, we create a simple reporting observer to observe usage of deprecated features on our web page: let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { reportbtn.onclick = () => displayreports(reports); }, options); we then tell it to start observing reports using reportingobserver.observe(); this tells the observer to start collecting reports in its report queue, and runs the callback function specified inside the constructor: observer.
Request.cache - Web APIs
WebAPIRequestcache
// in reality; this would be a function that takes a path and a // reference to the controller since it would need to change the value let controller = new abortcontroller(); fetch("some.json", {cache: "only-if-cached", mode: "same-origin", signal: controller.signal}) .catch(e => e instanceof typeerror && e.message === "failed to fetch" ?
... ({status: 504}) : // workaround for chrome; which simply fails with a typeerror promise.reject(e)) .then(res => { if (res.status === 504) { controller.abort() controller = new abortcontroller(); return fetch("some.json", {cache: "force-cache", mode: "same-origin", signal: controller.signal}) } const date = res.headers.get("date"), dt = date ?
... return res }) .then(function(response) { /* consume the (possibly stale) response */ }) .catch(error => { /* can be an aborterror/domerror or a typeerror */ }); specifications specification status comment fetchthe definition of 'cache' in that specification.
SVGFECompositeElement - Web APIs
oke="#d4dde4" stroke-width="2px" /><text x="376" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfecompositeelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_fecomposite_operator_unknown 0 the type is not one of predefined types.
... it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
... svgfecompositeelement.type read only an svganimatedenumeration corresponding to the type attribute of the given element.
SVGFilterElement - Web APIs
takes one of the constants defined in svgunittypes.
...takes one of the constants defined in svgunittypes.
... working draft removed the inheritance from svglangspace, svgexternalresourcesrequired, svgstylable, and svgunittypes and removed the setfilterres() function scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgfilterelement' in that specification.
SVGSVGElement - Web APIs
svgsvgelement.contentscripttype an svganimatedlength corresponding to the contentscripttype attribute of the given <svg> element.
... svgsvgelement.contentstyletype an svganimatedlength corresponding to the contentstyletype attribute of the given <svg> element.
... svgsvgelement.deselectall() unselects any selected objects, including any selections of text strings and type-in bars.
Using the Screen Capture API - Web APIs
see options and constraints, below, for more on both how to specify the type of surface you want as well as other ways to adjust the resulting stream.
... there are two types of display surface.
...max-width is set to 860px to set an absolute upper limit on the video's size, the error, warn, and info classes are used to style the corresponding console output types.
ScriptProcessorNode.onaudioprocess - Web APIs
the onaudioprocess event handler of the scriptprocessornode interface represents the eventhandler to be called for the audioprocess event that is dispatched to scriptprocessornode node types.
... an event of type audioprocessingevent will be dispatched to the event handler.
...e = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio track via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // give the node a function to process audio events scriptnode.onaudioprocess = function(audioprocessingev...
ServiceWorkerRegistration.showNotification() - Web APIs
this can be of any data type.
...if options’s renotify is true and options’s tag is the empty string a typeerror will be thrown.
...if options’s silent is true and options’s vibrate is present a typeerror exception will be thrown.
SourceBuffer - Web APIs
sourcebuffer.changetype() changes the mime type that future calls to appendbuffer() will expect the new data to conform to.
...as written by nick desaulniers and can be viewed live here (you can also download the source for further investigation.) var video = document.queryselector('video'); var asseturl = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource(); //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sour...
...rcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffer(buf); }); } function fetchab (url, cb) { console.log(url); var xhr = new xmlhttprequest; xhr.open('get', url); xhr.responsetype = 'arraybuffer'; xhr.onload = function () { cb(xhr.response); }; xhr.send(); } specifications specification status comment media source extensionsthe definition of 'sourcebuffer' in that specification.
SpeechRecognitionError.error - Web APIs
the error read-only property of the speechrecognitionerror interface returns the type of error raised.
... syntax var myerror = event.error; value a domstring naming the type of error.
... the possible error types are: no-speech no speech was detected.
SpeechRecognitionErrorEvent.error - Web APIs
the error read-only property of the speechrecognitionerrorevent interface returns the type of error raised.
... syntax var myerror = event.error; value a domstring naming the type of error.
... the possible error types are: no-speech no speech was detected.
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.
... 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).
...opertymap) { // 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 definition of 'stylepropertymapreadonly' in that specification.
SubmitEvent - Web APIs
constructor submitevent() creates and returns a new submitevent object whose type and other options are configured as specified.
... note that currently, the only valid type for a submitevent is submit.
... let form = document.queryselector("form"); form.addeventlistener("submit", (event) => { let submitter = event.submitter; let handler = submitter.id; if (handler) { processorder(form, handler); } else { showalertmessage("an unknown or unaccepted payment type was selected.
SubtleCrypto.unwrapKey() - Web APIs
unwrappedkeyalgo is a dictionary object defining the type of key to unwrap and providing extra algorithm-specific parameters as required.
... syntaxerror raised when keyusages is empty but the unwrapped key is of type secret or private.
... typeerror raised when trying to use an invalid format.
TextDecoder() - Web APIs
if the value for utflabel is unknown, or is one of the two values leading to a 'replacement' decoding algorithm ( "iso-2022-cn" or "iso-2022-cn-ext"), a domexception with the "typeerror" value is thrown.
...each label is associated with a specific encoding type: possible values of utflabel encoding "unicode-1-1-utf-8", "utf-8", "utf8" 'utf-8' "866", "cp866", "csibm866", "ibm866" 'ibm866' "csisolatin2", "iso-8859-2", "iso-ir-101", "iso8859-2", "iso88592", "iso_8859-2", "iso_8859-2:1987", "l2", "latin2" 'iso-8859-2' "csisolatin3", "iso-8859-3", "iso-ir-109", "iso8859-3", "iso88593", "iso_8859-3", "iso_8859-3:1988", "l3", "latin3" 'iso-8859-3' "csisolatin4", "iso-8859-4", "iso-ir-110", "iso8859-4", "iso88594", "iso_8859-4", "iso_8859-4:198...
...var textdecoder4 = new textdecoder("iso-2022-cn"); // throw a typeerror exception.
TextEncoder() - Web APIs
syntax encoder = new textencoder(); parameters textencoder() takes no parameters since firefox 48 and chrome 53 note: prior to firefox 48 and chrome 53, an encoding type label was accepted as a paramer to the textencoder object, since then both browers have removed support for any encoder type other than utf-8, to match the spec.
... any type label passed into the textencoder constructor will now be ignored and a utf-8 textencoder will be created.
... exceptions textencoder() throws no exceptions since firefox 48 and chrome 53 note: prior to firefox 48 and chrome 53 an exception would be thrown for an unknown encoding type.
TimeEvent - Web APIs
WebAPITimeEvent
4" stroke-width="2px" /><text x="161" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">timeevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties timeevent.detail read only is a long that specifies some detail information about the event, depending on the type of the event.
... for this event type, indicates the repeat number for the animation.
... methods inittimeevent(domstring typearg, abstractview viewarg, long detailarg) the inittimeevent method is used to initialize the value of a timeevent created through the documentevent interface.
Multi-touch interaction - Web APIs
// log events flag var logevents = false; // touch point cache var tpcache = new array(); register event handlers event handlers are registered for all four touch event types.
... the touchend and touchcancel event types use the same handler.
... function end_handler(ev) { ev.preventdefault(); if (logevents) log(ev.type, ev, false); if (ev.targettouches.length == 0) { // restore background and border to original values ev.target.style.background = "white"; ev.target.style.border = "1px solid black"; } } application ui the application uses <div> elements for the touch areas and provides buttons to enable logging and clear the log.
TrackDefault.TrackDefault() - Web APIs
syntax var trackdefault = new trackdefault(type, language, label, kinds, bytestreamtrackid); parameters type a domstring specifying a media segment data type for the sourcebuffer to contain.
...if not specified, this value will be an empty string and the sourcebuffer can contain any tracks of the specified type.
... typeerror there are values specified in the kinds array that do not apply to the specified type.
TreeWalker.whatToShow - Web APIs
the treewalker.whattoshow read-only property returns an unsigned long being a bitmask made of constants describing the types of node that must to be presented.
... nodefilter.show_document_type 512 shows documenttype nodes.
... syntax nodetypes = treewalker.whattoshow; example var treewalker = document.createtreewalker( document.body, nodefilter.show_element + nodefilter.show_comment + nodefilter.show_text, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); if( (treewalker.whattoshow == nodefilter.show_all) || (treewalker.whattoshow % (nodefilter.show_comment*2)) >= nodefilter.show_comme...
UIEvent() - Web APIs
WebAPIUIEventUIEvent
syntax event = new uievent(typearg [, uieventinit]) values typearg is a domstring representing the name of the event.
... uieventinit optional is a uieventinit dictionary, having the following fields: detail: optional and defaulting to 0, of type long, that is a event-dependant value associated with the event.
... view: optional and defaulting to null, of type windowproxy, that is the window associated with the event .
URL() - Web APIs
WebAPIURLURL
if the given base url or the resulting url are not valid urls, the javascript typeerror exception is thrown.
... exceptions exception explanation typeerror url (in the case of absolute urls) or base + url (in the case of relative urls) is not a valid url.
...lla.org/docs' new url('/docs', a); // => 'https://developer.mozilla.org/docs' new url('/docs', "https://developer.mozilla.org/fr-fr/toto"); // => 'https://developer.mozilla.org/docs' new url('/docs', ''); // raises a typeerror exception as '' is not a valid url new url('/docs'); // raises a typeerror exception as '/docs' is not a valid url new url('http://www.example.com', ); // => 'http://www.example.com/' new url('http://www.example.com', b); // => 'http://www.example.com/' new url("//foo.com", "https://example.com") // => 'https://foo...
USBEndpoint - Web APIs
usbendpoint.type returns the type of this endpoint, one of: "bulk" - provides reliable data transfer for large payloads.
... this code identifies the correct endpoints by searching for the interface implementing the usb cdc interface class and then identifying the candidate endpoints based on their type and direction.
... if (endpoint.type != "bulk") { continue; } if (endpoint.direction == "in") { inendpoint = endpoint.endpointnumber; } else if (endpoint.direction == "out") { outendpoint = endpoint.endpointnumber; } } } specifications specification status comment webusbthe definition of 'usbendpoint' in that specification.
VideoConfiguration - Web APIs
properties the videoconfiguration dictionary is made up of five video properties, including: contenttype: a valid video mime type.
... see our web video codec guide for types which may be supported.
... examples // create media configuration to be tested const mediaconfig = { type : 'file', // see mediadecodingconfiguration and mediaencodingconfiguration video : { contenttype : "video/webm;codecs=vp8", // valid content type width : 800, // width of the video height : 600, // height of the video bitrate : 10000, // number of bits used to encode 1s of video framerate : 30 // number of frames making up that 1s.
WEBGL_depth_texture - Web APIs
constants this extension adds a new constant: ext.unsigned_int_24_8_webgl unsigned integer type for 24-bit depth texture data.
... the type parameter now accepts gl.unsigned_short, gl.unsigned_int, and ext.unsigned_int_24_8_webgl.
... the pixels parameter now accepts an arraybufferview of type uint16array and uint32array.
WebGLRenderingContext.getVertexAttrib() - Web APIs
gl.vertex_attrib_array_type: returns a glenum representing the array type.
... gl.vertex_attrib_array_normalized: returns a glboolean that is true if fixed-point data types are normalized for the vertex attribute array at the given index.
... when using a webgl 2 context, the following values are available additionally: gl.vertex_attrib_array_integer: returns a glboolean indicating whether or not an integer data type is in the vertex attribute array at the given index.
Using textures in WebGL - Web APIs
const level = 0; const internalformat = gl.rgba; const width = 1; const height = 1; const border = 0; const srcformat = gl.rgba; const srctype = gl.unsigned_byte; const pixel = new uint8array([0, 0, 255, 255]); // opaque blue gl.teximage2d(gl.texture_2d, level, internalformat, width, height, border, srcformat, srctype, pixel); const image = new image(); image.onload = function() { gl.bindtexture(gl.texture_2d, texture); gl.teximage2d(gl.texture_2d, level, internalformat, ...
... srcformat, srctype, image); // webgl1 has different requirements for power of 2 images // vs non power of 2 images so check if the image is a // power of 2 in both dimensions.
... first, the code to specify the colors buffer is gone, replaced with this: // tell webgl how to pull out the texture coordinates from buffer { const num = 2; // every coordinate composed of 2 values const type = gl.float; // the data in the buffer is 32 bit float const normalize = false; // don't normalize const stride = 0; // how many bytes to get from one set to the next const offset = 0; // how many bytes inside the buffer to start from gl.bindbuffer(gl.array_buffer, buffers.texturecoord); gl.vertexattribpointer(programinfo.attriblocations.texturecoord, num, type, normalize, stri...
A simple RTCDataChannel sample - Web APIs
first, we have a couple of buttons for establishing and closing the connection: <button id="connectbutton" name="connectbutton" class="buttonleft"> connect </button> <button id="disconnectbutton" name="disconnectbutton" class="buttonright" disabled> disconnect </button> then there's a box which contains the text input box into which the user can type a message to transmit, with a button to send the entered text.
... <div class="messagebox"> <label for="message">enter a message: <input type="text" name="message" id="message" placeholder="message text" inputmode="latin" size=60 maxlength=120 disabled> </label> <button id="sendbutton" name="sendbutton" class="buttonright" disabled> send </button> </div> finally, there's the little box into which we'll insert the messages.
...the user interface is updated correspondingly by enabling the text input box for the message to send, focusing the input box so that the user can immediately begin to type, enabling the "send" and "disconnect" buttons, now that they're usable, and disabling the "connect" button, since it is not needed when the conneciton is open.
Rendering and the WebXR frame animation callback - Web APIs
the second type of input is a gamepad that's connected through the xr system.
... the third and final type of input is the traditional non-xr input device such as keyboards, mice, trackpads, touch screens, and non-xr gamepads and joysticks.
...parts of structures may be moving, such as doors, walls and floors (for some types of games), and so forth.
Functions and classes available to Web Workers - Web APIs
comparison of the properties and methods of the different type of workers function dedicated workers shared workers service workers chrome workers outside workers atob() yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on window btoa() yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on workergl...
... 10.0 (yes) 10.1 network information api provides information about the system's connection in terms of general connection type (e.g., 'wifi', 'cellular', etc.).
... basic: 3.5 (1.9.1) response and responsetype are available since 10 (10) timeout and ontimeout are available since 13 (13) (yes) (yes) (yes) ...
Web Workers API - Web APIs
in addition to dedicated workers, there are other types of worker: shared workers are workers that can be utilized by multiple scripts running in different windows, iframes, etc., as long as they are in the same domain as the worker.
... chrome workers are a firefox-only type of worker that you can use if you are developing add-ons and want to use workers in extensions and have access to js-ctypes in your worker.
...different types of worker have scope objects that inherit from this interface and add more specific features.
Window.open() - Web APIs
WebAPIWindowopen
best practices <script type="text/javascript"> var windowobjectreference = null; // global variable function openffpromotionpopup() { if(windowobjectreference == null || windowobjectreference.closed) /* if the pointer to the window object in memory does not exist or if such pointer exists but the window was closed */ { windowobjectreference = window.open("http://www.spreadfirefox.com/", "promotefirefoxwi...
... you can also parameterize the function to make it versatile, functional in more situations, therefore re-usable in scripts and webpages: <script type="text/javascript"> var windowobjectreference = null; // global variable function openrequestedpopup(url, windowname) { if(windowobjectreference == null || windowobjectreference.closed) { windowobjectreference = window.open(url, windowname, "resizable,scrollbars,status"); } else { windowobjectreference.focus(); }; } </script> (...) <p><a href="http://www.spreadfirefox.
...com/" target="promotefirefoxwindow" onclick="openrequestedpopup(this.href, this.target); return false;" title="this link will create a new window or will re-use an already opened one" >promote firefox adoption</a></p> you can also make such function able to open only 1 secondary window and to reuse such single secondary window for other links in this manner: <script type="text/javascript"> var windowobjectreference = null; // global variable var previousurl; /* global variable that will store the url currently in the secondary window */ function openrequestedsinglepopup(url) { if(windowobjectreference == null || windowobjectreference.closed) { windowobjectreference = window.open(url, "singlesecondarywindowname", "resizable,scrollbars,status"); } else...
Window: pageshow event - Web APIs
the handler, eventlogger(), logs the type of event that occurred to the console, and includes the value of the persisted flag on pageshow and pagehide events.
... javascript const events = [ "pagehide", "pageshow", "unload", "load" ]; const eventlogger = event => { switch (event.type) { case "pagehide": case "pageshow": let ispersisted = event.persisted ?
... "persisted" : "not persisted"; console.log('event:', event.type, '-', ispersisted); break; default: console.log('event:', event.type); break; } }; events.foreach(eventname => window.addeventlistener(eventname, eventlogger) ); html <p>open the console and watch the output as you navigate to and from this page.
Worker - Web APIs
WebAPIWorker
(fetch is also available, with no such restrictions.) in firefox extensions, if you want to use workers with access to js-ctypes, use chromeworker object instead.
... event handlers abstractworker.onerror an eventlistener called whenever an errorevent of type error bubbles through to the worker.
... worker.onmessage an eventlistener called whenever a messageevent of type message bubbles through the worker — i.e.
XMLHttpRequest.getResponseHeader() - Web APIs
example in this example, a request is created and sent, and a readystatechange handler is established to look for the readystate to indicate that the headers have been received; when that is the case, the value of the content-type header is fetched.
... if the content-type isn't the desired value, the xmlhttprequest is canceled by calling abort().
... var client = new xmlhttprequest(); client.open("get", "unicorns-are-teh-awesome.txt", true); client.send(); client.onreadystatechange = function() { if(this.readystate == this.headers_received) { var contenttype = client.getresponseheader("content-type"); if (contenttype != my_expected_type) { client.abort(); } } } specifications specification status comment xmlhttprequestthe definition of 'getresponseheader()' in that specification.
XMLHttpRequest.send() - Web APIs
if no accept header has been set using the setrequestheader(), an accept header with the type "*/*" (any type) is sent.
... networkerror the resource type to be fetched is a blob, and the method is not get.
...}; xhr.send(null); // xhr.send('string'); // xhr.send(new blob()); // xhr.send(new int8array()); // xhr.send(document); example: post var xhr = new xmlhttprequest(); xhr.open("post", '/server', true); //send the proper header information along with the request xhr.setrequestheader("content-type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { // call a function when the state changes.
XMLSerializer.serializeToString() - Web APIs
exceptions typeerror the specified rootnode is not a compatible node type.
... usage notes compatible node types the specified root node—and all of its descendants—must be compatible with the xml serialization algorithm.
... the following types are also permitted as descendants of the root node, in addition to node and attr: documenttype document documentfragment element comment text processinginstruction attr if any other type is encountered, a typeerror exception is thrown.
XPathEvaluator.createExpression() - Web APIs
exceptions invalid_expression_err if the expression is not legal according to the rules of the xpathevaluator, an xpathexception of type invalid_expression_err is raised.
... namespace_err if the expression contains namespace prefixes which cannot be resolved by the specified xpathnsresolver, a domexception of type namespace_error is raised.
... html <div>xpath example</div> <div>number of &lt;div&gt;s: <output></output></div> javascript var xpath = "//div"; var evaluator = new xpathevaluator(); var expression = evaluator.createexpression("//div"); var result = expression.evaluate(document, xpathresult.ordered_node_snapshot_type); document.queryselector("output").textcontent = result.snapshotlength; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathevaluator.createexpression()' in that specification.
XPathResult.booleanValue - Web APIs
the read-only booleanvalue property of the xpathresult interface returns the boolean value of a result with xpathresult.resulttype being boolean_type.
... exceptions type_err in case xpathresult.resulttype is not boolean_type, an xpathexception of type type_err is thrown.
... html <div>xpath example</div> <p>text is 'xpath example': <output></output></p> javascript var xpath = "//div/text() = 'xpath example'"; var result = document.evaluate(xpath, document, null, xpathresult.boolean_type, null); document.queryselector("output").textcontent = result.booleanvalue; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.booleanvalue' in that specification.
XPathResult.iterateNext() - Web APIs
exceptions type_err in case xpathresult.resulttype is not unordered_node_iterator_type or ordered_node_iterator_type, an xpathexception of type type_err is thrown.
... invalid_state_err if the document is mutated since the result was returned, an xpathexception of type invalid_state_err is thrown.
... html <div>xpath example</div> <div>tag names of the matched nodes: <output></output></div> javascript var xpath = "//div"; var result = document.evaluate(xpath, document, null, xpathresult.any_type, null); var node = null; var tagnames = []; while(node = result.iteratenext()) { tagnames.push(node.localname); } document.queryselector("output").textcontent = tagnames.join(", "); result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.iteratenext()' in that specification.
XPathResult.numberValue - Web APIs
the read-only numbervalue property of the xpathresult interface returns the numeric value of a result with xpathresult.resulttype being number_type.
... exceptions type_err in case xpathresult.resulttype is not number_type, an xpathexception of type type_err is thrown.
... html <div>xpath example</div> <div>number of &lt;div&gt;s: <output></output></div> javascript var xpath = "count(//div)"; var result = document.evaluate(xpath, document, null, xpathresult.number_type, null); document.queryselector("output").textcontent = result.numbervalue; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.numbervalue' in that specification.
XPathResult.singleNodeValue - Web APIs
the read-only singlenodevalue property of the xpathresult interface returns a node value or null in case no node was matched of a result with xpathresult.resulttype being any_unordered_node_type or first_ordered_node_type.
... exceptions type_err in case xpathresult.resulttype is not any_unordered_node_type or first_ordered_node_type, an xpathexception of type type_err is thrown.
... html <div>xpath example</div> <div>tag name of the element having the text content 'xpath example': <output></output></div> javascript var xpath = "//*[text()='xpath example']"; var result = document.evaluate(xpath, document, null, xpathresult.first_ordered_node_type, null); document.queryselector("output").textcontent = result.singlenodevalue.localname; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.singlenodevalue' in that specification.
XPathResult.stringValue - Web APIs
the read-only stringvalue property of the xpathresult interface returns the string value of a result with xpathresult.resulttype being string_type.
... exceptions type_err in case xpathresult.resulttype is not string_type, an xpathexception of type type_err is thrown.
... html <div>xpath example</div> <div>text content of the &lt;div&gt; above: <output></output></div> javascript var xpath = "//div/text()"; var result = document.evaluate(xpath, document, null, xpathresult.string_type, null); document.queryselector("output").textcontent = result.stringvalue; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.stringvalue' in that specification.
XRReferenceSpaceEvent - Web APIs
currently, the only event that uses this type is the reset event.
... constructor xrreferencespaceevent() returns a new xrreferencespaceevent with the specified type and configured using the values in the given xrreferencespaceeventinit dictionary.
... event types reset the reset event is sent to a reference space when its native origin is changed due to a discontinuity, recalibration, or device reset.
XRRigidTransform() - Web APIs
exceptions typeerror the value of the w coordinate in the specified position is not 1.0.
... examples in this example, the beginning of the animation of a scene is shown, starting with a request for a reference space of a given type, then shifting the coordinate system based on a transform before requesting the first animation frame.
... let animationframerequestid = 0; xrsession.requestreferencespace("local-floor") .then((refspace) => { xrreferencespace = refspace.getoffsetreferencespace( new xrrigidtransform(viewerposition, viewerorientation)); animationframerequestid = xrsession.requestanimationframe(drawframe); }); after requesting a reference space of type local-floor, the returned promise is eventually resolved, at which time we receive a new reference space object, refspace.
Generating HTML - Web APIs
figure 2 xml file :(example2.xml)view example | view source xml document (example2.xml): <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="example2.xsl"?> <myns:article xmlns:myns="http://devedge.netscape.com/2002/de"> <myns:title>my article</myns:title> <myns:authors> <myns:author company="foopy corp.">mr.
... <xsl:template match="/"> <html> <head> <title> <xsl:value-of select="/myns:article/myns:title"/> </title> <style type="text/css"> .mybox {margin:10px 155px 0 50px; border: 1px dotted #639ace; padding:0 5px 0 5px;} </style> </head> <body> <p class="mybox"> <span class="title"> <xsl:value-of select="/myns:article/myns:title"/> </span> </br> authors: <br /> <xsl:apply-templates select="/myns:article/myns:authors/myns:author"/> </p> ...
..."?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:myns="http://devedge.netscape.com/2002/de"> <xsl:output method="html" /> <xsl:template match="/"> <html> <head> <title> <xsl:value-of select="/myns:article/myns:title"/> </title> <style type="text/css"> .mybox {margin:10px 155px 0 50px; border: 1px dotted #639ace; padding:0 5px 0 5px;} </style> </head> <body> <p class="mybox"> <span class="title"> <xsl:value-of select="/myns:article/myns:title"/> </span> <br /> authors: <br /> <xsl:apply-templates select="/myns:article...
msCapsLockWarningOff - Web APIs
starting with internet explorer 10, input type=password fields will automatically display a warning if the caps lock is on.
... syntax document.mscapslockwarningoff = true; value type: boolean false: default.
... example fiddle: http://jsfiddle.net/jonathansampson/mqcha/1/ example 2 <html> <head> <title>mscapslockwarningoff example</title> <script type="text/javascript"> function capsoff() { if (document.mscapslockwarningoff == false) { document.mscapslockwarningoff = true; document.getelementbyid("caps").innerhtml = "warning off"; } else { document.mscapslockwarningoff = false; document.getelementbyid("caps").innerhtml = "warning on"; } } </script> </head> <body> <label>type a password: <input type="password" /></label><br /> <button id="caps" onclick="capsoff();">warning ...
ARIA live regions - Accessibility
here is a screenshot of voiceover on mac announcing the update (via subtitles) to the live region: preferring specialized live region roles in the following well-known predefined cases it is better to use a specific provided "live region role": role description compatibility notes log chat, error, game or other type of log to maximize compatibility, add a redundant aria-live="polite" when using this role.
... aria-relevant: the aria-relevant=[list_of_changes] is used to set what types of changes are relevant to a live region.
... a working example of a simple year control for better understanding: <div id="date-input"> <label>year: <input type="text" id="year" value="1990" onblur="change(event)"/> </label> </div> <div id="date-output" aria-live="polite"> the set year is: <span id="year-output">1990</span> </div> function change(event) { var yearout = document.getelementbyid("year-output"); switch (event.target.id) { case "year": yearout.innerhtml = event.target.value; break; default: return; } }...
ARIA: search role - Accessibility
while there is a input of type search, there is html element that defines a search landmark.
... examples <form id="search" role="search"> <label for="search-input">search this site</label> <input type="search" id="search-input" name="search" spellcheck="false"> <input value="submit" type="submit"> </form> accessibility concerns landmark roles are intended to be used sparingly, to identify larger overall sections of the document.
... <footer> <form id="site-search-bottom" role="search" aria-label="sitewide"> <!-- search input --> </form> </footer> redundant descriptions screen readers will announce the type of role the landmark is.
Web applications and ARIA FAQ - Accessibility
another alternative is to use the html5 doctype, which includes built-in support for aria.
... here is an example of the markup used for an html5 progress bar: <!doctype html> <html> <head><title>gracefully degrading progress bar</title></head> <body> <progress id="progress-bar" value="0" max="100">0% complete</progress> <button id="update-button">update</button> </body> </html> ...
...var supportshtml5progress = (typeof (htmlprogresselement) !== "undefined"); function setupprogress() { if (!supportshtml5progress) { // html5 <progress> isn't supported in this browser, so we need to add // aria roles and states to the element.
Accessibility and Spacial Patterns - Accessibility
adobe illustrator, for example, allows one to typeset ada braille for printing out.
... the nature of space can change depending upon what mime type is being used, and its version.
... see also mdn accessibiltity: what users can do to browse more safely web accessibiltity for seizures and physical reactions web accessibility: understanding colors and luminance braille part 3: a step-by-step guide to typesetting ada braille correctly in adobe illustrator spatial math in brailleblaster (4 of 5) government literature nasa: designing with blue math spatial reasoning: why math talk is about more than numbers scientific literature colour constancy in context: roles for local adaptation and levels of reference gamma oscillations and photosensitive epilepsy characterizing the patte...
HTML To MSAA - Accessibility
if @name attribute is presented state_system_ linked if @href attribute is presented or click event listener is registered state_system_ traversed if link is traversed n/a "jump" if @href is valid n/a br role_system_ whitespace '\n' (new line char) state_system_ readonly n/a n/a n/a button role_system_ pushbutton from child nodes n/a state_system_ focusable state_system_ default if @type attribute has value "submit" n/a "press" n/a caption bstr role n/a n/a n/a description_for (0x100f), points to table element div bstr role n/a n/a n/a n/a n/a n/a fieldset role_system_ grouping text equivalent from child legend element n/a n/a labelled_by (1003), points to legend element n/a n/a hr role_system_ separator n/a n/a n/a n/a n/a n/a img, input @type=image ro...
...le_system_ graphic from @alt attribute, empty @alt attribute means name can't be calculated at all n/a state_system_ animated if image has more than one frame n/a "showlongdesc" if @longdesc attribute is presented n/a if @usemap attribute is used then image accessible has children for each map item input @type=button, submit, reset role_system_ pushbutton from @value attribute, @alt attribute, default label, @src attribute, @data attribute n/a state_system_ default if @type attribute has value "submit" n/a "press" n/a input @type=text, textarea role_system_ text n/a value property of input dom element state_system_ readonly if @readonly attribute is used n/a "activate" n/a input @type=password role_system_ text n/a n/a state_system_ readonly if @readonly attribute is used state_sys...
...tem_ protected n/a "activate" n/a input type="checkbox" role_system_ checkbutton n/a n/a state_system_ marqueed used as state checkable state_system_ mixed for html 5 if intermediate property of dom element returns true state_system_ checked if checked property of dom element returns true n/a "check"/"uncheck"/"cycle" depending on state event_object_ statechange when state is changed input type="radio" role_system_ radiobutton n/a n/a state_system_ marqueed used as state checkable state_system_ checked if checked property of dom element returns true n/a "select" event_object_ statechange when state is changed label role_system_ statictext from child nodes n/a n/a n/a n/a n/a legend role_system_ statictext n/a n/a n/a label_for (0x1002), points to caption element n/a n/a ...
Accessibility documentation index - Accessibility
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.
...as the name implies, alertdialog is a type of dialog.
... 24 using the aria-relevant attribute aria, accessibility, needsexample, arialive, attri the aria-relevant attribute is an optional value used to describe what types of changes have occurred to an aria-live region, and which are relevant and should be announced.
Web Accessibility: Understanding Colors and Luminance - Accessibility
the srgb color space the mdn document, <color> notes "the css data type represents a color in the srgb color space." color has many ways of being defined, including rgb, rgb decimal, rgb percent, hsl, cmyk among others.
... thin letters will be harder to read than thick ones; all type faces need space to "breathe" for human perception.
... (see the video, the photosensitive epilepsy analysis tool) measuring color & luminance methods that measures color exploring the rgb color space further, as it is the color space used by the data type <color>, note that there are actually multiple "versions" of the rgb color space, such as srgb, scrgb, and rgba.
::-moz-color-swatch - CSS: Cascading Style Sheets
the ::-moz-color-swatch css pseudo-element is a mozilla extension that represents the color selected in an <input> of type="color".
... note: using ::-moz-color-swatch with anything but an <input type="color"> doesn't match anything and has no effect.
... examples html <input type="color" value="#de2020" /> css input[type=color]::-moz-color-swatch { border-radius: 10px; border-style: none; } result specifications not part of any standard.
::-moz-range-progress - CSS: Cascading Style Sheets
the ::-moz-range-progress css pseudo-element is a mozilla extension that represents the lower portion of the track (i.e., groove) in which the indicator slides in an <input> of type="range".
... note: using ::-moz-range-progress with anything but an <input type="range"> doesn't match anything and has no effect.
... syntax ::-moz-range-progress examples html <input type="range" min="0" max="100" step="5" value="50"/> css input[type=range]::-moz-range-progress { background-color: green; height: 1em; } result a progress bar using this style might look something like this: specifications not part of any standard.
::-moz-range-thumb - CSS: Cascading Style Sheets
the ::-moz-range-thumb css pseudo-element is a mozilla extension that represents the thumb (i.e., virtual knob) of an <input> of type="range".
... note: using ::-moz-range-thumb with anything but an <input type="range"> doesn't match anything and has no effect.
... syntax ::-moz-range-thumb examples html <input type="range" min="0" max="100" step="5" value="50"/> css input[type=range]::-moz-range-thumb { background-color: green; } result a progress bar using this style might look something like this: specifications not part of any standard.
::-moz-range-track - CSS: Cascading Style Sheets
the ::-moz-range-track css pseudo-element is a mozilla extension that represents the track (i.e., groove) in which the indicator slides in an <input> of type="range".
... note: using ::-moz-range-track with anything but an <input type="range"> doesn't match anything and has no effect.
... syntax ::-moz-range-track examples html <input type="range" min="0" max="100" step="5" value="50"/> css input[type=range]::-moz-range-track { background-color: green; } result a progress bar using this style might look something like this: specifications not part of any standard.
:disabled - CSS: Cascading Style Sheets
WebCSS:disabled
an element is disabled if it can't be activated (selected, clicked on, typed into, etc.) or accept focus.
... html <form action="#"> <fieldset id="shipping"> <legend>shipping address</legend> <input type="text" placeholder="name"> <input type="text" placeholder="address"> <input type="text" placeholder="zip code"> </fieldset> <br> <fieldset id="billing"> <legend>billing address</legend> <label for="billing-checkbox">same as shipping address:</label> <input type="checkbox" id="billing-checkbox" checked> <br> <input type="text" placeholder="name" disabled> <inp...
...ut type="text" placeholder="address" disabled> <input type="text" placeholder="zip code" disabled> </fieldset> </form> css input[type="text"]:disabled { background: #ccc; } javascript // wait for the page to finish loading document.addeventlistener('domcontentloaded', function () { // attach `change` event listener to checkbox document.getelementbyid('billing-checkbox').onchange = togglebilling; }, false); function togglebilling() { // select the billing text fields var billingitems = document.queryselectorall('#billing input[type="text"]'); // toggle the billing text fields for (var i = 0; i < billingitems.length; i++) { billingitems[i].disabled = !billingitems[i].disabled; } } result specifications specification status comment ...
@namespace - CSS: Cascading Style Sheets
syntax /* default namespace */ @namespace url(xml-namespace-url); @namespace "xml-namespace-url"; /* prefixed namespace */ @namespace prefix url(xml-namespace-url); @namespace prefix "xml-namespace-url"; description the defined namespaces can be used to restrict the universal, type, and attribute selectors to only select elements within that namespace.
...when a default namespace is defined, all universal and type selectors (but not attribute selectors, see note below) apply only to elements in that namespace.
...when a universal, type, or attribute selector is prefixed with a namespace prefix, then that selector only matches if the namespace and name of the element or attribute matches.
Attribute selectors - CSS: Cascading Style Sheets
u could also use hyphenated attributes without double quotes */ div[data-lang="zh-tw"] { color: purple; } html <div lang="en-us en-gb en-au en-nz">hello world!</div> <div lang="pt">olá mundo!</div> <div lang="zh-cn">世界您好!</div> <div lang="zh-tw">世界您好!</div> <div data-lang="zh-tw">世界您好!</div> result html ordered lists the html specification requires the type attribute to be matched case-insensitively due to it primarily being used in the <input> element, trying to use attribute selectors to with the type attribute of an ordered list doesn't work without the case-sensitive modifier.
... css /* list types require the case sensitive flag due to a quirk in how html treats the type attribute.
... */ ol[type="a"] { list-style-type: lower-alpha; background: red; } ol[type="a" s] { list-style-type: lower-alpha; background: lime; } ol[type="a" s] { list-style-type: upper-alpha; background: lime; } html <ol type="a"> <li>example list</li> </ol> result specifications specification status comment selectors level 4the definition of 'attribute selectors' in that specification.
Coordinate systems - CSS: Cascading Style Sheets
let inner = document.queryselector(".inner"); let log = document.queryselector(".log"); function setcoords(e, type) { let idx = type + "x"; let idy = type + "y"; document.getelementbyid(idx).innertext = e[idx]; document.getelementbyid(idy).innertext = e[idy]; } a reference to the <div> inside the inner box which contains the paragraphs that will show the coordinate information is fetched into log.
...for example, if the value of type is "page", then idx is "pagex" and idy is "pagey".
... our main code sets up the event handlers on the inner box by calling addeventlistener() for each of the types mouseenter, mousemove, and mouseleave.
<angle-percentage> - CSS: Cascading Style Sheets
the <angle-percentage> css data type represents a value that can be either a <angle> or a <percentage>.
... syntax refer to the documentation for <angle> and <percentage> for details of the individual syntaxes allowed by this type.
... use in calc() where an <angle-percentage> is specified as an allowable type, this means that the percentage resolves to an angle and therefore can be used in a calc() expression.
break-after - CSS: Cascading Style Sheets
the type of this break is that of the immediately-containing fragmentation context.
... formal definition initial valueautoapplies toblock-level elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | avoid | always | all | avoid-page | page | left | right | recto | verso | avoid-column | column | avoid-region | region examples breaking into neat columns in the following example we have a container that contains an <h1> spanning all columns (achieved using column-span: all) and a series of <h2>s and paragraphs laid out in multiple columns using column-width: 2...
...changes the media type of this property from paged to visual.
break-before - CSS: Cascading Style Sheets
the type of this break is that of the immediately-containing fragmentation context.
... formal definition initial valueautoapplies toblock-level elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | avoid | always | all | avoid-page | page | left | right | recto | verso | avoid-column | column | avoid-region | region examples breaking into neat columns in the following example we have a container that contains an <h1> spanning all columns (achieved using column-span: all) and a series of <h2>s and paragraphs laid out in multiple columns using column-width: 2...
...changes the media type of this property from paged to visual.
caret-color - CSS: Cascading Style Sheets
the caret-color css property sets the color of the insertion caret, the visible marker where the next character typed will be inserted.
... note that the insertion caret is only one type of caret.
... formal definition initial valueautoapplies toall elementsinheritedyescomputed valueauto is computed as specified and <color> values are computed as defined for the color property.animation typea color formal syntax auto | <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
conic-gradient() - CSS: Cascading Style Sheets
the result of the conic-gradient() function is an object of the <gradient> data type, which is a special kind of <image>.
... because <gradient>s belong to the <image> data type, they can only be used where <image>s can be used.
... for this reason, conic-gradient() won't work on background-color and other properties that use the <color> data type.
<display-listitem> - CSS: Cascading Style Sheets
the list-item keyword causes the element to generate a ::marker pseudo-element with the content specified by its list-style properties (for example a bullet point) together with a principal box of the specified type for its own contents.
...this can be used together with list-style-type and list-style-position.
...if no outer value is specified, the principal box will have an outer display type of block.
font-style - CSS: Cascading Style Sheets
for truetype or opentype variable fonts, the "slnt" variation is used to implement varying slant angles for oblique, and the "ital" variation with a value of 1 is used to implement italic values.
... html <header> <input type="range" id="slant" name="slant" min="-90" max="90" /> <label for="slant">slant</label> </header> <div class="container"> <p class="sample">...it would not be wonderful to meet a megalosaurus, forty feet long or so, waddling like an elephantine lizard up holborn hill.</p> </div> css /* amstelvaralpha-vf is created by david berlow (https://github.com/typenetwork/amstelvar) and is used here under the terms of its license: https://github.com/typenetwork/amstelvar/blob/master/ofl.txt */ @font-face { src: url('https://mdn.mozillademos.org/files/16044/amstelvaralpha-vf.ttf'); ...
...it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | italic | oblique <angle>?
font-variation-settings - CSS: Cascading Style Sheets
registered and custom axes variable font axes come in two types: registered and custom.
...for example linux oses need the latest linux freetype version, and macos prior to 10.13 does not support variable fonts.
...it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typea transform formal syntax normal | [ <string> <number> ]# examples you can find a number of other variable fonts examples at our variable fonts guide, v-fonts.com, and axis-praxis.org.
<integer> - CSS: Cascading Style Sheets
WebCSSinteger
the <integer> css data type is a special type of <number> that represents a whole number, whether positive or negative.
... syntax the <integer> data type consists of one or several decimal digits, 0 through 9 inclusive, optionally preceded by a single + or - sign.
... interpolation when animated, values of the <integer> data type are interpolated using discrete, whole steps.
<length-percentage> - CSS: Cascading Style Sheets
the <length-percentage> css data type represents a value that can be either a <length> or a <percentage>.
... syntax refer to the documentation for <length> and <percentage> for details of the individual syntaxes allowed by this type.
...gth-percentage examples */ width: 75%; height: 200px; margin: 3rem; padding: 1%; border-radius: 10px 10%; font-size: 250%; line-height: 1.5em; /* length examples */ text-shadow: 1px 1px 1px red; border: 5px solid red; letter-spacing: 3px; /* percentage example */ text-size-adjust: 20%; } result use in calc() where a <length-percentage> is specified as an allowable type, this means that the percentage resolves to a length and therefore can be used in a calc() expression.
linear-gradient() - CSS: Cascading Style Sheets
its result is an object of the <gradient> data type, which is a special kind of <image>.
... because <gradient>s belong to the <image> data type, they can only be used where <image>s can be used.
... for this reason, linear-gradient() won't work on background-color and other properties that use the <color> data type.
list-style-image - CSS: Cascading Style Sheets
if this value is set, the marker defined in list-style-type will be used instead.
... formal definition initial valuenoneapplies tolist itemsinheritedyescomputed valuenone or the image with its uri made absoluteanimation typediscrete formal syntax <url> | none examples setting list item images html <ul> <li>item 1</li> <li>item 2</li> </ul> css ul { list-style-image: url("https://mdn.mozillademos.org/files/11981/starsolid.gif"); } result specifications specification status comment css lists module level 3the definition of 'list-style-image' in that specification.
... working draft extends support to any <image> data type.
mask-mode - CSS: Cascading Style Sheets
WebCSSmask-mode
match-source if the mask-image property is of type <mask-source>, the luminance values of the mask layer image should be used as the mask values.
... if it is of type <image>, the alpha values of the mask layer image should be used as the mask values.
... formal definition initial valuematch-sourceapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <masking-mode>#where <masking-mode> = alpha | luminance | match-source examples using alpha mask mode css #masked { width: 227px; height: 200px; background: blue linear-gradient(red, blue); mask-image: url(https://mdn.mozillademos.org/files/12668/mdn.svg); mask-mode: alpha; /* can be changed in the live sample */ } html <div id="masked"> </div> <select id="maskmode"> <option value="alpha">alpha</option> <option value="luminance">luminance</option> <option value="match-source">match-source</option> </select> javascript var maskmode ...
<percentage> - CSS: Cascading Style Sheets
the <percentage> css data type represents a percentage value.
... syntax the <percentage> data type consists of a <number> followed by the percentage sign (%).
... interpolation when animated, values of the <percentage> data type are interpolated as real, floating-point numbers.
radial-gradient() - CSS: Cascading Style Sheets
the function's result is an object of the <gradient> data type, which is a special kind of <image>.
... because <gradient>s belong to the <image> data type, they can only be used where <image>s can be used.
... for this reason, radial-gradient() won't work on background-color and other properties that use the <color> data type.
<ratio> - CSS: Cascading Style Sheets
WebCSSratio
the <ratio> css data type, used for describing aspect ratios in media queries, denotes the proportion between two unitless values.
... syntax in media queries level 3, the <ratio> data type consisted of a strictly positive <integer> followed by a forward slash ('/', unicode u+002f solidus) and a second strictly positive <integer>.
... in media queries level 4, the <ratio> date type is updated to consist of a strictly positive <number> followed by a forward slash ('/', unicode u+002f solidus) and a second strictly positive <number>.
repeating-conic-gradient() - CSS: Cascading Style Sheets
the result of the repeating-conic-gradient() function is an object of the <gradient> data type, which is a special kind of <image>.
... because <gradient>s belong to the <image> data type, they can only be used where <image>s can be used.
... for this reason, repeating-conic-gradient() won't work on background-color and other properties that use the <color> data type.
repeating-linear-gradient() - CSS: Cascading Style Sheets
the function's result is an object of the <gradient> data type, which is a special kind of <image>.
... because <gradient>s belong to the <image> data type, they can only be used where <image>s can be used.
... for this reason, repeating-linear-gradient() won't work on background-color and other properties that use the <color> data type.
repeating-radial-gradient() - CSS: Cascading Style Sheets
the function's result is an object of the <gradient> data type, which is a special kind of <image>.
... because <gradient>s belong to the <image> data type, they can only be used where <image>s can be used.
... for this reason, repeating-radial-gradient() won't work on background-color and other properties that use the <color> data type.
scroll-snap-stop - CSS: Cascading Style Sheets
/* keyword values */ scroll-snap-stop: normal; scroll-snap-stop: always; /* global values */ scroll-snap-type: inherit; scroll-snap-type: initial; scroll-snap-type: unset; syntax values normal when the visual viewport of this element's scroll container is scrolled, it may "pass over" possible snap positions.
... formal definition initial valuenormalapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax normal | always examples snapping in different axes this example is duplicated from scroll-snap-type with minor variances.
...ightgray; flex: none; } .container.x { width: 100%; height: 128px; flex-flow: row nowrap; } .container.y { width: 256px; height: 256px; flex-flow: column nowrap; } /* definite scroll snap */ .mandatory-scroll-snapping > div { scroll-snap-stop: always; } .proximity-scroll-snapping > div { scroll-snap-stop: normal; } /* scroll-snap */ .x.mandatory-scroll-snapping { scroll-snap-type: x mandatory; } .y.mandatory-scroll-snapping { scroll-snap-type: y mandatory; } .x.proximity-scroll-snapping { scroll-snap-type: x proximity; } .y.proximity-scroll-snapping { scroll-snap-type: y proximity; } .container > div { text-align: center; scroll-snap-align: center; flex: none; } .x.container > div { line-height: 128px; font-size: 64px; width: 100%; height: 128px; ...
text-decoration-color - CSS: Cascading Style Sheets
css does not provide a direct mechanism for specifying a unique color for each line type.
... this effect can nevertheless be achieved by nesting elements, applying a different line type to each element (with the text-decoration-line property), and specifying the line color (with text-decoration-color) on a per-element basis.
...it also applies to ::first-letter and ::first-line.inheritednocomputed valuecomputed coloranimation typea color formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
text-justify - CSS: Cascading Style Sheets
the text-justify css property sets what type of justification should be applied to text when text-align: justify; is set on an element.
... auto the browser chooses the best type of justification for the current situation based on a balance between performance and quality, but also on what is most appropriate for the language of the text (e.g., english, cjk languages, etc.).
... formal definition initial valueautoapplies toinline-level and table-cell elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | inter-character | inter-word | none examples <p class="none"><code>text-justify: none</code> —<br>lorem ipsum dolor sit amet, consectetur adipiscing elit.
<time-percentage> - CSS: Cascading Style Sheets
the <time-percentage> css data type represents a value that can be either a <time> or a <percentage>.
... syntax refer to the documentation for <time> and <percentage> for details of the individual syntaxes allowed by this type.
... examples use in calc() where a <time-percentage> is specified as an allowable type, this means that the percentage resolves to a time and therefore can be used in a calc() expression.
<transform-function> - CSS: Cascading Style Sheets
the <transform-function> css data type represents a transformation that affects an element's appearance.
... syntax the <transform-function> data type is specified using one of the transformation functions listed below.
... examples transform function comparison the following example provides a 3d cube created from dom elements and transforms, and a select menu allowing you to choose different transform functions to transform the cube with, so you can compare the effects of the different types.
WAI ARIA Live Regions/API Support - Developer guides
fined on some ancestor element (closest ancestor wins): object attribute name possible values default value if not specified meaning aria markup if required container-live "off" | "polite" | "assertive" "off" interruption policy aria-live on ancestor element container-relevant "[additions] [removals] [text]" | "all" "additions text" what types of mutations are possibly relevant?
... see [#events_fired_for_web_page_mutations the mutation events list] to match the type of event with this attribute's value, to determine whether the author believed the event should be presented to the user or not.
...the screen reader may wish to take other factors into account, such as the type of change, the size of the change, where the change occured, etc.
Video player styling basics - Developer guides
the markup for the custom controls now looks as follows: <div id="video-controls" class="controls" data-state="hidden"> <button id="playpause" type="button" data-state="play">play/pause</button> <button id="stop" type="button" data-state="stop">stop</button> <div class="progress"> <progress id="progress" value="0" min="0"> <span id="progress-bar"></span> </progress> </div> <button id="mute" type="button" data-state="mute">mute/unmute</button> <button id="volinc" type="button" data-state="volup">vol+</butto...
...n> <button id="voldec" type="button" data-state="voldown">vol-</button> <button id="fs" type="button" data-state="go-fullscreen">fullscreen</button> </div> related css alteration the previous article simply set the display property of the video controls to block in order to display them.
...in order to facilitate this, a new function is defined called changebuttonstate(), which accepts a type variable indicating the button's functionality: var changebuttonstate = function(type) { // play/pause button if (type == 'playpause') { if (video.paused || video.ended) { playpause.setattribute('data-state', 'play'); } else { playpause.setattribute('data-state', 'pause'); } } // mute button else if (type == 'mute') { mute.setattribu...
DOM onevent handlers - Developer guides
you can specify an on<…> event handler for a particular event (such as click) for a given object in different ways: adding an html attribute named on<eventtype>: <button onclick="handleclick()">, or by setting the corresponding property from javascript: document.queryselector("button").onclick = function(event) { … }.
...for example: if ("onsomenewfeature" in window) { /* do something amazing */ } event handlers and prototypes you can't set or access the values of any idl-defined attributes on dom prototype objects.
... that means you can't, for example, change window.prototype.onload.
HTML5 - Developer guides
WebGuideHTMLHTML5
forms improvements a look at the constraint validation api, several new attributes, new values for the <input> attribute type and the new <output> element.
...this includes support for selecting multiple files using the <input> of type file html element's new multiple attribute.
...custom typefaces can be downloaded and applied thanks to the new @font-face at-rule.
XHTML - Developer guides
WebGuideHTMLXHTML
the following example shows an html document and corresponding "xhtml" document, and the accompanying http content-type headers they should be served with.
... html document content-type: text/html <!doctype html> <html lang=en> <head> <meta charset=utf-8> <title>html</title> </head> <body> <p>i am a html document</p> </body> </html> xhtml document content-type: application/xhtml+xml <?xml version="1.0" encoding="utf-8"?> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>xhtml</title> </head> <body> <p>i am a xhtml document</p> </body> </html> in practice, very few "xhtml" documents are served over the web with a content-type: application/xhtml+xml header.
... instead, even though the documents are written to conform to xml syntax rules, they are served with a content-type: text/html header — so browsers parse those documents using html parsers rather than xml parsers, which can cause a variety of sometimes-very-surprising problems.
Mobile Web Development - Developer guides
WebGuideMobile
but sometimes this is impractical, and web sites resort to parsing the browser's user agent string to try to distinguish between desktops, tablets, and phones, to serve different content to each type of device.
... if you do this, make sure your algorithm is correct, and you aren't serving the wrong type of content to a device because you don't understand a particular browser's user agent string.
... see this guide to using the user agent string to determine device type.
Parsing and serializing XML - Developer guides
element.nodename); parsing url-addressable resources into dom trees using xmlhttprequest here is sample code that reads and parses a url-addressable xml file into a dom tree: var xhr = new xmlhttprequest(); xhr.onload = function() { dump(xhr.responsexml.documentelement.nodename); } xhr.onerror = function() { dump("error while getting xml."); } xhr.open("get", "example.xml"); xhr.responsetype = "document"; xhr.send(); the value returned in the xhr object's responsexml field is a document constructed by parsing the xml.
...the two types are essentially the same; the difference is largely historical, although differentiating has some practical benefits as well.
... note: there is in fact an htmldocument interface as well, but it is not necessarily an independent type.
HTML attribute: max - HTML: Hypertext Markup Language
WebHTMLAttributesmax
valid for the numeric input types, including the date, month, week, time, datetime-local, number and range types, and both the <progress> and <meter> elements, the max attribute is a number that specifies the most positive value a form control to be considered valid.
... syntax syntax for max values by input type input type syntax example date yyyy-mm-dd <input type="date" max="2019-12-25" step="1"> month yyyy-mm <input type="month" max="2019-12" step="12"> week yyyy-w## <input type="week" max="2019-w23" step=""> time hh:mm <input type="time" max="17:00" step="900"> datetime-local yyyy-mm-ddthh:mm <input type="datetime-local" min="2019-12-25t23:59"> number <number> <input type="number" min="0" step="5" max="100"> range <number> <input type="range" min="60" step...
... syntax for max values for other elements input type syntax example <progress> <number> <progress id="file" max="100" value="70"> 70% </progress> <meter> <number> <meter id="fuel" min="0" max="100" low="33" high="66" optimum="80" value="40"> at 40/100</meter> ...
HTML attribute: size - HTML: Hypertext Markup Language
WebHTMLAttributessize
for the input, if the type attribute is text or password then it's the number of characters.
... examples by adding size on some input types, the width of the input can be controlled.
... <label for="fruit">enter a fruit</label> <input type="text" size="15" id="fruit"> <label for="vegetable">enter a vegetable</label> <input type="text" id="vegetable"> <select name="fruits" size="5"> <option>banana</option> <option>cherry</option> <option>strawberry</option> <option>durian</option> <option>blueberry</option> </select> <select name="vegetables" size="5"> <option>carrot</option> <option>cucumber</option> <option>cauliflower</option> <option>celery</option> <option>collard greens</option> </select> specifications specification status html living standardthe definition of 'size attribute' in that specification.
<html>: The HTML Document / Root element - HTML: Hypertext Markup Language
WebHTMLElementhtml
version specifies the version of the html document type definition that governs the current document.
... this attribute is not needed, because it is redundant with the version information in the document type declaration.
... example <!doctype html> <html lang="en"> <head>...</head> <body>...</body> </html> accessibility concerns providing a lang attribute with a valid ietf identifying language tag on the <html> element will help screen reading technology determine the proper language to announce.
<i>: The Idiomatic Text element - HTML: Hypertext Markup Language
WebHTMLElementi
historically, these have been presented using italicized type, which is the original source of the <i> naming of this element.
...a browser will typically still display the contents of the <i> element in italic type, but is, by definition, no longer required to do so.
... to display text in italic type, authors should use the css font-style property.
<keygen> - HTML: Hypertext Markup Language
WebHTMLElementkeygen
keytype the type of key generated.
... the element is written as follows: <keygen name="name" challenge="challenge string" keytype="type" keyparams="pqg-params"> the keytype parameter is used to specify what type of key is to be generated.
...the keytype attribute is optional for rsa key generation and required for dsa and ec key generation.
<meta>: The Document-level Metadata element - HTML: Hypertext Markup Language
WebHTMLElementmeta
implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlmetaelement the type of metadata provided by the meta element can be one of the following: if the name attribute is set, the meta element provides document-level metadata, applying to the whole page.
... content-type if specified, the content attribute must have the value "text/html; charset=utf-8".
... note: can only be used in documents served with a text/html mime type — not in documents served with an xml mime type.
<param>: The Object Parameter element - HTML: Hypertext Markup Language
WebHTMLElementparam
deprecated attributes type only used if the valuetype is set to ref.
... specifies the mime type of values found at the uri specified by value.
... valuetype specifies the type of the value attribute.
HTML: Hypertext Markup Language
WebHTML
a block-level element occupies the entire space of its parent element (container), thereby creating a "block." link types in html, various link types can be used to establish and define the relationship between two documents.
... link elements that types can be set on include <a>, <area> and <link>.
... guide to media types and formats on the web the <audio> and <video> elements allow you to play audio and video media natively within your content without the need for external software support.
Choosing between www and non-www URLs - HTTP
for example, if you've chosen to use non-www urls as the canonical type, you should redirect all www urls to their equivalent url without the www.
...it is good advice to do this since you can't predict which url users will type in their browser's url bar.
... it is a matter of choosing which type you want to use as your canonical location, then redirecting the other type to it.
Content negotiation - HTTP
the accept header the accept header lists the mime types of media resources that the agent is willing to process.
... it is comma-separated lists of mime types, each combined with a quality factor, a parameter indicating the relative degree of preference between the different mime types.
... from the beginnings of http, the protocol allowed another negotiation type: agent-driven negotiation or reactive negotiation.
Cross-Origin Resource Policy (CORP) - HTTP
in response, chromium shipped cross-origin read blocking, which automatically protects certain resources (of content-type html, json and xml) against cross-origin reads.
... if the application does not serve a no-sniff directive, chromium will attempt to guess the content-type and apply the protection anyway.
... cross-origin resource policy is an opt-in response header which can protect any resource; there is no need for browsers to sniff mime types.
Accept-Charset - HTTP
using content negotiation, the server selects one of the encodings, uses it, and informs the client of its choice within the content-type response header, usually in a charset= parameter.
...this is no longer recommended, and now each content-type may have its own default.
... header type request header forbidden header name yes syntax accept-charset: <charset> // multiple types, weighted with the quality value syntax: accept-charset: utf-8, iso-8859-1;q=0.5 directives <charset> a character encoding name, like utf-8 or iso-8859-15.
Accept-Patch - HTTP
the accept-patch response http header advertises which media-type the server is able to understand.
...two common cases lead to this: a server receiving a patch request with an unsupported media type could reply with 415 unsupported media type and an accept-patch header referencing one or more supported media types.
... header type response header forbidden header name yes syntax accept-patch: application/example, text/example accept-patch: text/example;charset=utf-8 accept-patch: application/merge-patch+json directives none examples accept-patch: application/example, text/example accept-patch: text/example;charset=utf-8 accept-patch: application/merge-patch+json specifications specification title rfc 5789, section 3.1: accept-patch ...
Authorization - HTTP
header type request header forbidden header name no syntax authorization: <type> <credentials> directives <type> authentication type.
... a common type is "basic".
... other types: iana registry of authentication schemes authentification for aws servers (aws4-hmac-sha256) <credentials> if the "basic" authentication scheme is used, the credentials are constructed like this: the username and the password are combined with a colon (aladdin:opensesame).
CSP: form-action - HTTP
csp version 2 directive type navigation directive default-src fallback no.
...sites needing to allow these content types can specify them using the data attribute.
... <meta http-equiv="content-security-policy" content="form-action 'none'"> <form action="javascript:alert('foo')" id="form1" method="post"> <input type="text" name="fieldname" value="fieldvalue"> <input type="submit" id="submit" value="submit"> </form> // error: refused to send form data because it violates the following // content security policy directive: "form-action 'none'".
CSP: navigate-to - HTTP
csp version 3 directive type navigation directive default-src fallback no.
...sites needing to allow these content types can specify them using the data attribute.
... <meta http-equiv="content-security-policy" content="navigate-to 'none'"> <form action="javascript:alert('foo')" id="form1" method="post"> <input type="text" name="fieldname" value="fieldvalue"> <input type="submit" id="submit" value="submit"> </form> specifications specification status comment content security policy level 3the definition of 'navigate-to' in that specification.
CSP: object-src - HTTP
to set allowed types for <object>, <embed>, and <applet> elements, use the plugin-types directive.
... csp version 1 directive type fetch directive default-src fallback yes.
...sites needing to allow these content types can specify them using the data attribute.
Trailer - HTTP
WebHTTPHeadersTrailer
header type response header forbidden header name yes syntax trailer: header-names directives header-names http header fields which will be present in the trailer part of chunked messages.
... these header fields are disallowed: message framing headers (e.g., transfer-encoding and content-length), routing headers (e.g., host), request modifiers (e.g., controls and conditionals, like cache-control, max-forwards, or te), authentication headers (e.g., authorization or set-cookie), or content-encoding, content-type, content-range, and trailer itself.
... http/1.1 200 ok content-type: text/plain transfer-encoding: chunked trailer: expires 7\r\n mozilla\r\n 9\r\n developer\r\n 7\r\n network\r\n 0\r\n expires: wed, 21 oct 2015 07:28:00 gmt\r\n \r\n specifications specification title rfc 7230, section 4.4: trailer hypertext transfer protocol (http/1.1): message syntax and routing rfc 7230, section 4.1.2: chunked trailer part hypertext transfer protocol (http/1.1): message syntax and routing ...
Network Error Logging - HTTP
http 400 (bad request) response { "age": 20, "type": "network-error", "url": "https://example.com/previous-page", "body": { "elapsed_time": 338, "method": "post", "phase": "application", "protocol": "http/1.1", "referrer": "https://example.com/previous-page", "sampling_fraction": 1, "server_ip": "137.205.28.66", "status_code": 400, "type": "http.error", "url": "https://example.com/bad-request" } } d...
... { "age": 20, "type": "network-error", "url": "https://example.com/previous-page", "body": { "elapsed_time": 18, "method": "post", "phase": "dns", "protocol": "http/1.1", "referrer": "https://example.com/previous-page", "sampling_fraction": 1, "server_ip": "", "status_code": 0, "type": "dns.name_not_resolved", "url": "https://example-host.com/" } } the type of the network error may be one of the following pre-defined values from the specification, but browsers can add and send their own error types: dns.unreachable the user's dns server is unreachable dns.name_not_resolved the user's dns server responded but was unable to res...
...servfail) dns.address_changed for security reasons, if the server ip address that delivered the original report is different to the current server ip address at time of error generation, the report data will be downgraded to only include information about this problem and the type set to dns.address_changed.
An overview of HTTP - HTTP
WebHTTPOverview
for example: get / http/1.1 host: developer.mozilla.org accept-language: fr read the response sent by the server, such as: http/1.1 200 ok date: sat, 09 oct 2010 14:28:02 gmt server: apache last-modified: tue, 01 dec 2009 20:18:22 gmt etag: "51142bc1-7449-479b075b2891b" accept-ranges: bytes content-length: 29769 content-type: text/html <!doctype html...
... there are two types of http messages, requests and responses, each with its own format.
...the client browser automatically converts the messages that arrive on the http stream into appropriate event objects, delivering them to the event handlers that have been registered for the events' type if known, or to the onmessage event handler if no type-specific event handler was established.
HTTP range requests - HTTP
curl http://www.example.com -i -h "range: bytes=0-50, 100-150" the server responses with the 206 partial content status and a content-type: multipart/byteranges; boundary=3d6b6a416f9b5 header, indicating that a multipart byterange follows.
... each part contains its own content-type and content-range fields and the required boundary parameter specifies the boundary string used to separate each body-part.
... http/1.1 206 partial content content-type: multipart/byteranges; boundary=3d6b6a416f9b5 content-length: 282 --3d6b6a416f9b5 content-type: text/html content-range: bytes 0-50/1270 <!doctype html> <html> <head> <title>example do --3d6b6a416f9b5 content-type: text/html content-range: bytes 100-150/1270 eta http-equiv="content-type" content="text/html; c --3d6b6a416f9b5-- conditional range requests when resuming to request more parts of a resource, you need to guarantee that the stored resource has not been modified since the last fragment has been received.
About JavaScript - JavaScript
it is a prototype-based, multi-paradigm scripting language that is dynamic, and supports object-oriented, imperative, and functional programming styles.
...in a nutshell, javascript is a dynamic scripting language supporting prototype based object construction.
...once an object has been constructed it can be used as a blueprint (or prototype) for creating similar objects.
Loops and iteration - JavaScript
there are various situations that are more easily served by one type of loop over the others.
... <form name="selectform"> <p> <label for="musictypes">choose some music types, then click the button below:</label> <select id="musictypes" name="musictypes" multiple="multiple"> <option selected="selected">r&b</option> <option>jazz</option> <option>blues</option> <option>new age</option> <option>classical</option> <option>opera</option> </select> </p> <p><input id="btn" type="button" value="how many...
...</form> <script> function howmany(selectobject) { let numberselected = 0; for (let i = 0; i < selectobject.options.length; i++) { if (selectobject.options[i].selected) { numberselected++; } } return numberselected; } let btn = document.getelementbyid('btn'); btn.addeventlistener('click', function() { alert('number of options selected: ' + howmany(document.selectform.musictypes)); }); </script> do...while statement the do...while statement repeats until a specified condition evaluates to false.
Regular expression syntax cheatsheet - JavaScript
assertions if you are looking to contribute to this document, please also edit the original article boundary-type assertions characters meaning ^ matches the beginning of input.
...this is a position where the previous and next character are of the same type: either both must be words, or both must be non-words, for example between two letters or between two spaces.
...if a unicodepropertyname is specified, the value must correspond to the property type given.
RangeError: radix must be an integer - JavaScript
the javascript exception "radix must be an integer at least 2 and no greater than 36" occurs when the optional radix parameter of the number.prototype.tostring() or the bigint.prototype.tostring() method was specified and is not between 2 and 36.
... message rangeerror: invalid argument (edge) rangeerror: radix must be an integer at least 2 and no greater than 36 (firefox) rangeerror: tostring() radix argument must be between 2 and 36 (chrome) error type rangeerror what went wrong?
... the optional radix parameter of the number.prototype.tostring() or the bigint.prototype.tostring() method was specified.
RangeError: repeat count must be non-negative - JavaScript
the javascript exception "repeat count must be non-negative" occurs when the string.prototype.repeat() method is used with a count argument that is a negative number.
... message rangeerror: argument out of range rangeerror: repeat count must be non-negative (firefox) rangeerror: invalid count value (chrome) error type rangeerror what went wrong?
... the string.prototype.repeat() method has been used.
RangeError: precision is out of range - JavaScript
message rangeerror: the number of fractional digits is out of range (edge) rangeerror: the precision is out of range (edge) rangeerror: precision {0} out of range (firefox) rangeerror: toexponential() argument must be between 0 and 20 (chrome) rangeerror: tofixed() digits argument must be between 0 and 20 (chrome) rangeerror: toprecision() argument must be between 1 and 21 (chrome) error type rangeerror what went wrong?
... there was an out of range precision argument in one of these methods: number.prototype.toexponential() number.prototype.tofixed() number.prototype.toprecision() the allowed range for these methods is usually between 0 and 20 (or 21).
... method firefox (spidermonkey) chrome, opera (v8) number.prototype.toexponential() 0 to 100 0 to 20 number.prototype.tofixed() -20 to 100 0 to 20 number.prototype.toprecision() 1 to 100 1 to 21 examples invalid cases 77.1234.toexponential(-1); // rangeerror 77.1234.toexponential(101); // rangeerror 2.34.tofixed(-100); // rangeerror 2.34.tofixed(1001); // rangeerror 1234.5.toprecision(-1); // rangeerror 1234.5.toprecision(101); // rangeerror valid cases 77.1234.toexponential(4); // 7.7123e+1 77.1234.toexponential(2); // 7.71e+1 2.34.tofixed(1); // 2.3 2.35.tofixed(1); // 2.4 (note that it rounds up in this case) 5.123456.topr...
RangeError: repeat count must be less than infinity - JavaScript
the javascript exception "repeat count must be less than infinity" occurs when the string.prototype.repeat() method is used with a count argument that is infinity.
... message rangeerror: argument out of range (edge) rangeerror: repeat count must be less than infinity and not overflow maximum string size (firefox) rangeerror: invalid count value (chrome) error type rangeerror what went wrong?
... the string.prototype.repeat() method has been used.
Arrow function expressions - JavaScript
another example involving object.defineproperty(): 'use strict'; var obj = { a: 10 }; object.defineproperty(obj, 'b', { get: () => { console.log(this.a, typeof this.a, this); // undefined 'undefined' window {...} (or the global object) return this.a + 10; // represents global object 'window', therefore 'this.a' returns 'undefined' } }); use of the new operator arrow functions cannot be used as constructors and will throw an error when used with new.
... var foo = () => {}; var foo = new foo(); // typeerror: foo is not a constructor use of prototype property arrow functions do not have a prototype property.
... var foo = () => {}; console.log(foo.prototype); // undefined use of the yield keyword the yield keyword may not be used in an arrow function's body (except when permitted within functions further nested within it).
getter - JavaScript
it is not possible to simultaneously have a getter bound to a property and have that property actually hold a value, although it is possible to use a getter and a setter in conjunction to create a type of pseudo-property.
... when using get the property will be defined on the instance's prototype, while using object.defineproperty() the property will be defined on the instance it is applied to.
... class example { get hello() { return 'world'; } } const obj = new example(); console.log(obj.hello); // "world" console.log(object.getownpropertydescriptor(obj, 'hello')); // undefined console.log( object.getownpropertydescriptor( object.getprototypeof(obj), 'hello' ) ); // { configurable: true, enumerable: false, get: function get hello() { return 'world'; }, set: undefined } specifications specification ecmascript (ecma-262)the definition of 'method definitions' in that specification.
Array.isArray() - JavaScript
given a typedarray instance, false is always returned.
... if (!array.isarray) { array.isarray = function(arg) { return object.prototype.tostring.call(arg) === '[object array]'; }; } examples using array.isarray // all following calls return true array.isarray([]); array.isarray([1]); array.isarray(new array()); array.isarray(new array('a', 'b', 'c', 'd')); array.isarray(new array(3)); // little known fact: array.prototype itself is an array: array.isarray(array.prototype); // all following calls return false array.isarray(); array.isarray({}); array.isarray(null); array.isarray(undefined); array.isarray(17); array.isarray('array'); array.isarray(true); array.isarray(false); array.isarray(new uint8array(32)); array.is...
...array({ __proto__: array.prototype }); instanceof vs isarray when checking for array instance, array.isarray is preferred over instanceof because it works through iframes.
Generator - JavaScript
instead, a generator instance can be returned from a generator function: function* generator() { yield 1; yield 2; yield 3; } const gen = generator(); // "generator { }" instance methods generator.prototype.next() returns a value yielded by the yield expression.
... generator.prototype.return() returns the given value and finishes the generator.
... generator.prototype.throw() throws an error to a generator (also finishes the generator, unless caught from within that generator).
Intl.ListFormat() constructor - JavaScript
type the format of output message.
...when style is short or narrow, unit is the only allowed value for the type option.
... const list = ['motorcycle', 'bus', 'car']; console.log(new intl.listformat('en-gb', { style: 'long', type: 'conjunction' }).format(list)); // > motorcycle, bus and car console.log(new intl.listformat('en-gb', { style: 'short', type: 'disjunction' }).format(list)); // > motorcycle, bus or car console.log(new intl.listformat('en-gb', { style: 'narrow', type: 'unit' }).format(list)); // > motorcycle bus car specifications specification intl.listformatthe definition of 'listformat()' in that specification.
Intl.NumberFormat - JavaScript
instance methods intl.numberformat.prototype.format() getter function that formats a number according to the locale and formatting options of this numberformat object.
... intl.numberformat.prototype.formattoparts() returns an array of objects representing the number string in parts that can be used for custom locale-aware formatting.
... intl.numberformat.prototype.resolvedoptions() returns a new object with properties reflecting the locale and collation options computed during initialization of the object.
Intl.PluralRules() constructor - JavaScript
type the type to use.
... var pr = new intl.pluralrules(); pr.select(0); // → 'other' if in us english locale pr.select(1); // → 'one' if in us english locale pr.select(2); // → 'other' if in us english locale using options the results can be customized using the options argument, which has one property called type which you can set to ordinal.
... var pr = new intl.pluralrules('en-us', { type: 'ordinal' }); pr.select(0); // → 'other' pr.select(1); // → 'one' pr.select(2); // → 'two' pr.select(3); // → 'few' pr.select(4); // → 'other' pr.select(42); // → 'two' specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.pluralrules() constructor' in that specification.
handler.construct() - JavaScript
interceptions this trap can intercept these operations: new proxy(...args) reflect.construct() invariants if the following invariants are violated, the proxy will throw a typeerror: the result must be an object.
... const p = new proxy(function() {}, { construct: function(target, argumentslist, newtarget) { return 1; } }); new p(); // typeerror is thrown the following code improperly initializes the proxy.
... const p = new proxy({}, { construct: function(target, argumentslist, newtarget) { return {}; } }); new p(); // typeerror is thrown, "p" is not a constructor specifications specification ecmascript (ecma-262)the definition of '[[construct]]' in that specification.
handler.defineProperty() - JavaScript
interceptions this trap can intercept these operations: object.defineproperty() reflect.defineproperty() invariants if the following invariants are violated, the proxy will throw a typeerror: a property cannot be added, if the target object is not extensible.
... in strict mode, a false return value from the defineproperty() handler will throw a typeerror exception.
...property() trap has one restriction—only following properties are usable (non-standard properties will be ignored): enumerable configurable writable value get set const p = new proxy({}, { defineproperty(target, prop, descriptor) { console.log(descriptor); return reflect.defineproperty(target, prop, descriptor); } }); object.defineproperty(p, 'name', { value: 'proxy', type: 'custom' }); // { value: 'proxy' } specifications specification ecmascript (ecma-262)the definition of '[[defineownproperty]]' in that specification.
handler.ownKeys() - JavaScript
interceptions this trap can intercept these operations: object.getownpropertynames() object.getownpropertysymbols() object.keys() reflect.ownkeys() invariants if the following invariants are violated, the proxy will throw a typeerror: the result of ownkeys() must be an array.
... the type of each array element is either a string or a symbol.
... const obj = {}; object.defineproperty(obj, 'a', { configurable: false, enumerable: true, value: 10 } ); const p = new proxy(obj, { ownkeys: function(target) { return [123, 12.5, true, false, undefined, null, {}, []]; } }); console.log(object.getownpropertynames(p)); // typeerror: proxy [[ownpropertykeys]] must return an array // with only string and symbol elements specifications specification ecmascript (ecma-262)the definition of '[[ownpropertykeys]]' in that specification.
Reflect.defineProperty() - JavaScript
exceptions a typeerror, if target is not an object.
... one key difference: object.defineproperty returns the object or throws a typeerror if the property has not been successfully defined.
... examples using reflect.defineproperty() let obj = {} reflect.defineproperty(obj, 'x', {value: 7}) // true obj.x // 7 checking if property definition has been successful with object.defineproperty, which returns an object if successful, or throws a typeerror otherwise, you would use a try...catch block to catch any error that occurred while defining a property.
Reflect.getOwnPropertyDescriptor() - JavaScript
exceptions a typeerror, if target is not an object.
...// {value: "hello", writable: true, enumerable: true, configurable: true} reflect.getownpropertydescriptor({x: 'hello'}, 'y') // undefined reflect.getownpropertydescriptor([], 'length') // {value: 0, writable: true, enumerable: false, configurable: false} difference to object.getownpropertydescriptor() if the target argument to this method is not an object (a primitive), then it will cause a typeerror.
... reflect.getownpropertydescriptor('foo', 0) // typeerror: "foo" is not non-null object object.getownpropertydescriptor('foo', 0) // { value: "f", writable: false, enumerable: true, configurable: false } specifications specification ecmascript (ecma-262)the definition of 'reflect.getownpropertydescriptor' in that specification.
Reflect.isExtensible() - JavaScript
exceptions a typeerror, if target is not an object.
...let frozen = object.freeze({}) reflect.isextensible(frozen) // === false difference to object.isextensible() if the target argument to this method is not an object (a primitive), then it will cause a typeerror.
... reflect.isextensible(1) // typeerror: 1 is not an object object.isextensible(1) // false specifications specification ecmascript (ecma-262)the definition of 'reflect.isextensible' in that specification.
Reflect.preventExtensions() - JavaScript
exceptions a typeerror, if target is not an object.
...reflect.preventextensions(empty) reflect.isextensible(empty) // === false difference from object.preventextensions() if the target argument to this method is not an object (a primitive), then it will cause a typeerror.
... reflect.preventextensions(1) // typeerror: 1 is not an object object.preventextensions(1) // 1 specifications specification ecmascript (ecma-262)the definition of 'reflect.preventextensions' in that specification.
String() constructor - JavaScript
it performs type conversion when called as a function, rather than as a constructor, which is usually more useful.
... examples string constructor and string function string function and string constructor produce different results: typeof string('hello world'); // string typeof new string('hello world'); // object here, the function produces a string (the primitive type) as promised.
... however, the constructor produces an instance of the type string (an object wrapper) and that's why you rarely want to use the string constructor at all.
Symbol() constructor - JavaScript
the symbol() constructor returns a value of type symbol, but is incomplete as a constructor because it does not support the syntax "new symbol()" and it is not intended to be subclassed.
...it creates a new symbol each time: symbol('foo') === symbol('foo') // false new symbol(...) the following syntax with the new operator will throw a typeerror: let sym = new symbol() // typeerror this prevents authors from creating an explicit symbol wrapper object instead of a new symbol value and might be surprising as creating explicit wrapper objects around primitive data types is generally possible (for example, new boolean, new string and new number).
... if you really want to create a symbol wrapper object, you can use the object() function: let sym = symbol('foo'); let symobj = object(sym); typeof sym // => "symbol" typeof symobj // => "object" specifications specification ecmascript (ecma-262)the definition of 'symbol constructor' in that specification.
Symbol.iterator - JavaScript
some built-in types have a default iteration behavior, while other types (such as object) do not.
... the built-in types with a @@iterator method are: array.prototype[@@iterator]() typedarray.prototype[@@iterator]() string.prototype[@@iterator]() map.prototype[@@iterator]() set.prototype[@@iterator]() see also iteration protocols for more information.
...using it as such is likely to result in runtime exceptions or buggy behavior: var nonwellformediterable = {} nonwellformediterable[symbol.iterator] = () => 1 [...nonwellformediterable] // typeerror: [] is not a function specifications specification ecmascript (ecma-262)the definition of 'symbol.iterator' in that specification.
Symbol.matchAll - JavaScript
this function is called by the string.prototype.matchall() method.
... description this symbol is used for string.prototype.matchall() and specifically in regexp.prototype[@@matchall]().
... enumerable no configurable no examples using symbol.matchall let re = /[0-9]+/g; let str = '2016-01-02|2019-03-07'; const numbers = { *[symbol.matchall] (str) { for (const n of str.matchall(/[0-9]+/g)) yield n[0]; } }; console.log(array.from(str.matchall(numbers))); // array ["2016", "01", "02", "2019", "03", "07"] see string.prototype.matchall() and regexp.prototype[@@matchall]() for more examples.
Symbol.unscopables - JavaScript
however, in ecmascript 2015 and later, the array.prototype.keys() method was introduced.
...a built-in unscopables setting is implemented as array.prototype[@@unscopables] to prevent that some of the array methods are being scoped into the with statement.
... var keys = []; with (array.prototype) { keys.push('something'); } object.keys(array.prototype[symbol.unscopables]); // ["copywithin", "entries", "fill", "find", "findindex", // "includes", "keys", "values"] unscopables in objects you can also set unscopables for your own objects.
Strict inequality (!==) - JavaScript
unlike the inequality operator, the strict inequality operator always considers operands of different types to be different.
... like the strict equality operator, the strict inequality operator will always consider operands of different types to be different: 3 !== "3"; // true examples comparing operands of the same type console.log("hello" !== "hello"); // false console.log("hello" !== "hola"); // true console.log(3 !== 3); // false console.log(3 !== 4); // true console.log(true !== true); // false console.log(true !== false); // true console.log(null !== null); // fals...
...e comparing operands of different types console.log("3" !== 3); // true console.log(true !== 1); // true console.log(null !== undefined); // true comparing objects const object1 = { name: "hello" } const object2 = { name: "hello" } console.log(object1 !== object2); // true console.log(object1 !== object1); // false specifications specification ecmascript (ecma-262)the definition of 'equality operators' in that specification.
class expression - JavaScript
javascript classes use prototype-based inheritance.
...classes generated with class expressions will always respond to typeof with the value "function".
... 'use strict'; let foo = class {}; // constructor property is optional foo = class {}; // re-declaration is allowed typeof foo; // returns "function" typeof class {}; // returns "function" foo instanceof object; // true foo instanceof function; // true class foo {} // throws syntaxerror (class declarations do not allow re-declaration) examples a simple class expression this is just a simple anonymous class expression which you can refer to using the variable foo.
super - JavaScript
} } var y = new y(); y.foo(); // typeerror: "prop" is read-only console.log(y.prop); // 1 using super.prop in object literals super can also be used in the object initializer / literal notation.
...this works with the help of object.setprototypeof() with which we are able to set the prototype of obj2 to obj1, so that super is able to find method1 on obj1.
... var obj1 = { method1() { console.log('method 1'); } } var obj2 = { method2() { super.method1(); } } object.setprototypeof(obj2, obj1); obj2.method2(); // logs "method 1" specifications specification ecmascript (ecma-262)the definition of 'super' in that specification.
const - JavaScript
// define my_fav as a constant and give it the value 7 const my_fav = 7; // this will throw an error - uncaught typeerror: assignment to constant variable.
... const my_object = {'key': 'value'}; // attempting to overwrite the object throws an error // uncaught typeerror: assignment to constant variable.
...ey': 'value'}; // however, object keys are not protected, // so the following statement is executed without problem my_object.key = 'othervalue'; // use object.freeze() to make object immutable // the same applies to arrays const my_array = []; // it's possible to push items into the array my_array.push('a'); // ["a"] // however, assigning a new array to the variable throws an error // uncaught typeerror: assignment to constant variable.
import.meta - JavaScript
the import.meta object is created by the ecmascript implementation, with a null prototype.
... examples using import.meta given a module my-module.js <script type="module" src="my-module.js"></script> you can access meta information about the module using the import.meta object.
... for example, with the following html: <script type="module"> import './index.mjs?someurlinfo=5'; </script> ..the following javascript file will log the `someurlinfo parameter: // index.mjs new url(import.meta.url).searchparams.get('someurlinfo'); // 5 the same applies when a file imports another: // index.mjs import './index2.mjs?someurlinfo=5'; // index2.mjs new url(import.meta.url).searchparams.get('someurlinfo'); // 5 note that while nod...
JavaScript reference - JavaScript
infinity nan undefined globalthis function properties eval() isfinite() isnan() parsefloat() parseint() decodeuri() decodeuricomponent() encodeuri() encodeuricomponent() fundamental objects object function boolean symbol error objects error aggregateerror evalerror internalerror rangeerror referenceerror syntaxerror typeerror urierror numbers & dates number bigint math date text processing string regexp indexed collections array int8array uint8array uint8clampedarray int16array uint16array int32array uint32array float32array float64array bigint64array biguint64array keyed collections map set weakmap weakset structured data arraybuffer s...
... primary expressionsthis function class function* yield yield* async function await [] {} /ab+c/i ( ) null left-hand-side expressions property accessors new new.target super ...obj increment & decrement a++ a-- ++a --a unary operators delete void typeof + - ~ !
... arguments arrow functions default parameters rest parameters additional reference pages lexical grammar data types and data structures strict mode deprecated features ...
serviceworker - Web app manifests
type object mandatory no the serviceworker member describes a service worker that the developer intends to install to control the pwa.
... examples "serviceworker": { "src": "./serviceworker.js", "scope": "/app", "type": "", "update_via_cache": "none" } values service worker contain the following values (only src is required): member description src the url to download the service worker script from.
... type ?
Web app manifests
_related_applicationsrelated_applicationsscopescreenshotsserviceworkershort_nameshortcutsstart_urltheme_color example manifest { "name": "hackerweb", "short_name": "hackerweb", "start_url": ".", "display": "standalone", "background_color": "#fff", "description": "a simply readable hacker news app.", "icons": [{ "src": "images/touch/homescreen48.png", "sizes": "48x48", "type": "image/png" }, { "src": "images/touch/homescreen72.png", "sizes": "72x72", "type": "image/png" }, { "src": "images/touch/homescreen96.png", "sizes": "96x96", "type": "image/png" }, { "src": "images/touch/homescreen144.png", "sizes": "144x144", "type": "image/png" }, { "src": "images/touch/homescreen168.png", "sizes": "168x168", "type": "im...
...age/png" }, { "src": "images/touch/homescreen192.png", "sizes": "192x192", "type": "image/png" }], "related_applications": [{ "platform": "play", "url": "https://play.google.com/store/apps/details?id=cheeaun.hackerweb" }] } deploying a manifest web app manifests are deployed in your html pages using a <link> element in the <head> of a document: <link rel="manifest" href="/manifest.webmanifest"> note: the .webmanifest extension is specified in the media type registration section of the specification (the response of the manifest file should return content-type: application/manifest+json).
... browsers generally support manifests with other appropriate extensions like .json (content-type: application/json).
<math> - MathML
WebMathMLElementmath
examples html5 notation <!doctype html> <html> <head> <title>mathml in html5</title> </head> <body> <math> <mrow> <mrow> <msup> <mi>a</mi> <mn>2</mn> </msup> <mo>+</mo> <msup> <mi>b</mi> <mn>2</mn> </msup> </mrow> <mo>=</mo> <msup> <mi>c</mi> <mn>2</mn> </msup> </mrow> </math> </b...
...ody> </html> xhtml notation <?xml version="1.0" encoding="utf-8"?> <!doctype html public "-//w3c//dtd xhtml 1.1 plus mathml 2.0//en" "http://www.w3.org/math/dtd/mathml2/xhtml-math11-f.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>mathml in xhtml</title> </head> <body> <math xmlns="http://www.w3.org/1998/math/mathml"> <mrow> <mrow> <msup> <mi>a</mi> <mn>2</mn> </msup> <mo>+</mo> <msup> <mi>b</mi> <mn>2</mn> </msup> </mrow> <mo>=</mo> <msup> <mi>c</mi> <mn>2</mn> </msup> </mrow> </math> </body> </html> notes: xhtml documents with mathml must be served as application/xhtml+xml.
...for apache servers you can configure your .htaccess file to map extensions to the correct mime type.
Handling media support issues in web content - Web media technologies
there is a drawback, however: because there are so many to choose from, with so many different kinds of licenses and design principles involved, each web browser developer is left to its own devices when deciding which media file types and codecs to support.
... this places a small, but reasonably easily overcome, burden on the web developer: to properly handle the situation when the user's browser can't handle a particular type of media.
... specifying multiple sources checking compatibility in javascript htmlmediaelement.canplaytype and mediasource.istypesupported...
Digital video concepts - Web media technologies
there are three types of cones, each of which responds to a particular wavelength band of incoming light, but also to the intensity of the light at that wavelength.
... each type of cone, then, captures the relative reponse peaks at various wavelengths, and the brain uses this data to figure out the intensity and hue of the color of the light arriving at that part of the retina.
... the jpeg file type's compression works by first converting the image to the y'uv color system, then compressing that data.
Using images in HTML - Web media technologies
WebMediaimages
guides these articles provide guidance on selecting and configuring image types.
... image file type and format guide a guide to the various image file types commonly supported by web browsers including details about their individual use cases, capabilities, and compatibility factors.
... additionally, this article provides guidance for selecting the best image file type for a given situation.
class - SVG: Scalable Vector Graphics
WebSVGAttributeclass
usage context categories none value <list-of-class-names> animatable yes normative document svg 1.1 (2nd edition): the class attribute list-of-ts <list-of-ts> (where t is some type.) a list consists of a separated sequence of values.
... the following is a template for an ebnf grammar describing the <list-of-ts> syntax: list-of-ts ::= t | t, list-of-ts within the svg dom, values of a <list-of-ts> type are represented by an interface specific for the particular type t.
... example <html> <body> <svg width="120" height="220" viewport="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg"> <style type="text/css" > <![cdata[ rect.rectclass { stroke: #000066; fill: #00cc00; } circle.circleclass { stroke: #006600; fill: #cc0000; } ]]> </style> <rect class="rectclass" x="10" y="10" width="100" height="100"/> <circle class="circleclass" cx=...
end - SVG: Scalable Vector Graphics
WebSVGAttributeend
examples offset example <svg width="120" height="120" viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg" version="1.1"> <!-- animated rectangles --> <rect x="10" y="35" height="15" width="0"> <animate attributetype="xml" attributename="width" to="100" begin="0s" end="8s" fill="freeze" /> </rect> <rect x="10" y="60" height="15" width="0"> <animate attributetype="xml" attributename="width" to="75" begin="0s" end="6s" fill="freeze" /> </rect> <rect x="10" y="85" height="15" width="0"> <animate attributetype="x...
...oke="grey" stroke-width=".5" /> <line x1="10" y1="105" x2="110" y2="105" stroke="grey" stroke-width=".5" /> </svg> event example <svg width="120" height="120" viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- animated rectangle --> <rect x="10" y="35" height="15" width="0"> <animate attributetype="xml" attributename="width" from="0" to="100" begin="0s" end="endbutton.click" dur="8s" repeatcount="indefinite" fill="freeze" /> </rect> <!-- trigger --> <rect id="endbutton" style="cursor:pointer;" x="19.5" y="62.5" rx="5" height="25" width="80" fill="#efefef" stroke="black" stroke-width="1" /> <text x="60" y="80" text-anch...
...="grey" stroke-width=".5" /> <line x1="10" y1="55" x2="110" y2="55" stroke="grey" stroke-width=".5" /> </svg> accesskey example <svg width="120" height="120" viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- animated rectangles --> <rect x="10" y="35" height="15" width="0"> <animate attributetype="xml" attributename="width" from="0" to="100" begin="0s" end="accesskey(e)" dur="8s" repeatcount="indefinite" fill="freeze" /> </rect> <!-- trigger --> <text x="60" y="80" text-anchor="middle" style="pointer-events:none;">hit the "s" key</text> <!-- grid --> <text x="10" y="20" text-anchor="middle">0s</text> <line x1="10" y1="2...
to - SVG: Scalable Vector Graphics
WebSVGAttributeto
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" width="100" height="100"> <animate attributetype="xml" attributename="width" fill="freeze" from="100" to="150" dur="3s"/> </rect> </svg> animate, animatecolor, animatemotion, animatetransform for <animate>, <animatecolor>, <animatemotion>, and <animatetransform>, to specifies the ending value of the animation.
... value <value> default value none animatable no the exact value type for this attribute depend on the value of the attribute that will be animated.
... value <value> default value none animatable no the exact value type for this attribute depend on the value of the attribute that will be animated.
<animateMotion> - SVG: Scalable Vector Graphics
value type: <number>*; default value: none; animatable: no path this attribute defines the path of the motion, using the same syntax as the d attribute.
... value type: <string>; default value: none; animatable: no rotate this attribute defines a rotation applied to the elment animated along a path, usually to make it pointing in the direction of the animation.
... value type: <number>|auto|auto-reverse; default value: 0; animatable: no note: for <animatemotion> the default value for the calcmode attribute is paced animation attributes animation timing attributes begin, dur, end, min, max, restart, repeatcount, repeatdur, fill animation value attributes calcmode, values, keytimes, keysplines, from, to, by other animation attributes most notably: attributename, additive, accumulate animation event attributes most notably: onbegin, onend, onrepeat global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes this element implements the svganimatemotionelement interface.
<feDropShadow> - SVG: Scalable Vector Graphics
value type: <number>; default value: 2; animatable: yes dy this attribute defines the y offset of the drop shadow.
... value type: <number>; default value: 2; animatable: yes stddeviation this attribute defines the standard deviation for the blur operation in the drop shadow.
... value type: <number>; default value: 2; animatable: yes global attributes core attributes most notably: id styling attributes class, style filter primitive attributes height, in, result, x, y, width presentation attributes most notably: flood-color, flood-opacity usage notes categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <script>, <set> specifications specification status comment filter effects module level 1the definition of '<fedropshadow>' in that specification.
<stop> - SVG: Scalable Vector Graphics
WebSVGElementstop
value type: <number>|<percentage>; default value: 0; animatable: yes stop-color this attribute defines the color of the gradient stop.
... value type: currentcolor|<color>|<icccolor>; default value: black; animatable: yes stop-opacity this attribute defines the opacity of the gradient stop.
... value type: <opacity>; default value: 1; animatable: yes global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes presentation attributes most notably: color, display, stop-color, stop-opacity, visibility usage notes categoriesgradient elementpermitted contentany number of the following elements, in any order:<animate>, <animatecolor>, <set> specifications specification status comment scalable vector graphics (svg) 2the definition of '<stop>' in that specification.
SVG In HTML Introduction - SVG: Scalable Vector Graphics
body.invalid #err { display:inline; } </style> <script> function signalerror() { document.getelementbyid('body').setattribute("class", "invalid"); } </script> </head> <body id="body" style="position:absolute; z-index:0; border:1px solid black; left:5%; top:5%; width:90%; height:90%;"> <form> <fieldset> <legend>html form</legend> <p><label>enter something:</label> <input type="text"> <span id="err">incorrect value!</span></p> <p><input type="button" value="activate!" onclick="signalerror();"></p> </fieldset> </form> <svg viewbox="0 0 100 100" preserveaspectratio="xmidymid slice" style="width:100%; height:100%; position:absolute; top:0; left:0; z-index:-1;"> <lineargradient id="gradient"> <stop class="begin" offset="0%"/> <stop class="end" offs...
...(for inline svg to work in both firefox and internet explorer it is necessary to serve documents with a different content-type to each browser.
... for this reason, if you're behind a proxy server that caches the page, the example wont work in the second browser you load it in because it will receive the wrong content-type.) ...
Same-origin policy - Web security
any.com/page.html failure different protocol http://store.company.com:81/dir/page.html failure different port (http:// is port 80 by default) http://news.company.com/dir/page.html failure different host inherited origins scripts executed from pages with an about:blank or javascript: url inherit the origin of the document containing that url, since these types of urls do not contain information about an origin server.
...due to the relaxed syntax rules of css, cross-origin css requires a correct content-type header.
...browsers may not respect the content-type header.
Tutorials
this module looks at the cascade and inheritance, all the selector types we have available, units, sizing, styling backgrounds and borders, debugging, and lots more.
... quick guide to implement web fonts (with @font-face) the @font-face feature from css3 allows you to use custom typefaces on the web in an accessible, manipulatable, and scalable way.
... javascript building blocks in this module, we continue our coverage of all javascript's key fundamental features, turning our attention to commonly-encountered types of code block such as conditional statements, loops, functions, and events.
<xsl:sort> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementsort
syntax <xsl:sort select=expression order="ascending" | "descending" case-order="upper-first" | "lower-first" lang=xml:lang-code data-type="text" | "number" /> required attributes none.
... data-type defines whether items are to be ordered alphabetically or numerically.
... type subinstruction, always appears as a child of <xsl:for-each>, where it must appear before the template proper or of <xsl:apply-templates>.
XSLT elements reference - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElement
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes there are two types of elements discussed here: top-level elements and instructions.
...a third type of element, not discussed here, is the literal result element (lre).
...ir" is defined as follows: <xsl:variable name="image-dir">/images</xsl:variable> the expression to be evaluated is placed inside curly brackets: <img src="{$image-dir}/mygraphic.jpg"/> this would result in the following: <img src="/images/mygraphic.jpg"/> the element annotations that follow include a description, a syntax listing, a list of required and optional attributes, a description of type and position, its source in the w3c recommendation and an explanation of the degree of present gecko support.
Compiling an Existing C Module to WebAssembly - WebAssembly
because functions in c can't have arrays as return types (unless you allocate memory dynamically), this example resorts to a static global array.
...code(p, image.width, image.height, 100); const resultpointer = api.get_result_pointer(); const resultsize = api.get_result_size(); const resultview = new uint8array(module.heap8.buffer, resultpointer, resultsize); const result = new uint8array(resultview); api.free_result(resultpointer); note: new uint8array(somebuffer) will create a new view onto the same memory chunk, while new uint8array(sometypedarray) will copy the data.
...to prove that it worked, turn your result buffer into a blob and use it on an <img> element: const blob = new blob([result], {type: 'image/webp'}); const bloburl = url.createobjecturl(blob); const img = document.createelement('img'); img.src = bloburl; document.body.appendchild(img) behold, the glory of a new webp image.
Cross-domain Content Scripts - Archive of obsolete content
//main.js var data = require("sdk/self").data; var pageworker = require("sdk/page-worker").page({ contenturl: data.url("page.html"), contentscriptfile: data.url("page-script.js") }); pageworker.on("message", function(message) { console.log(message); }); the "page.html" file embeds an iframe whose content is served from "http://en.m.wikipedia.org/": <!doctype html> <!-- page.html --> <html> <head></head> <body> <iframe id="wikipedia" src="http://en.m.wikipedia.org/"></iframe> </body> </html> the "page-script.js" file locates "today's featured article" and sends its content to "main.js": // page-script.js var iframe = window.document.getelementbyid("wikipedia"); var todaysfeaturedarticle = iframe.contentwindow.d...
...panel.html"), contentscriptfile: data.url("panel-script.js") }); forecast_panel.on("show", function(){ forecast_panel.port.emit("show"); }); require("sdk/ui/button/action").actionbutton({ id: "get-forecast", label: "get the forecast", icon: "./icon-16.png", onclick: function() { forecast_panel.show(); } }); the "panel.html" just includes a <div> block for the forecast: <!doctype html> <!-- panel.html --> <html> <head></head> <body> <div id="forecast_summary"></div> </body> </html> the "panel-script.js" uses xmlhttprequest to fetch the latest forecast: // panel-script.js var url = "http://datapoint.metoffice.gov.uk/public/data/txt/wxfcs/regionalforecast/json/500?key=your-api-key"; self.port.on("show", function () { var request = new xmlhttprequest(); r...
Communicating using "postMessage" - Archive of obsolete content
tmessage(event.target.tostring());" + "}, false);"; var pagemod = require('sdk/page-mod').pagemod({ include: ['*'], contentscript: pagemodscript, onattach: function(worker) { worker.on('message', function(message) { console.log('mouseover: ' + message); }); } }); the reason to prefer user-defined events is that as soon as you need to send more than one type of message, then both sending and receiving messages gets more complex.
...now we have to embed the event type in the message payload, and implement a switch function in the receiver to dispatch the message: var pagemodscript = "window.addeventlistener('mouseover', function(event) {" + " self.postmessage({" + " kind: 'mouseover'," + " element: event.target.tostring()" + " });" + "}, false);" + "window.addeventlistener('mouseout', function(event) {" + " self.postmessage({" + " kind: 'mouseout'," + " element: event.target.tostring()" + " });" + " }, false);...
Guides - Archive of obsolete content
classes and inheritance learn how classes and inheritance can be implemented in javascript, using constructors and prototypes, and about the helper functions provided by the sdk to simplify this.
... two types of scripts this article explains the differences between the apis available to your main add-on code and those available to content scripts.
windows - Archive of obsolete content
parameters options : object required options: name type url string string url to be opened in the new window.
... optional options: name type onopen function a callback function that is called when the window has opened.
content/worker - Archive of obsolete content
parameters options : object required options: name type window object the content window to create javascript sandbox for communication with.
... optional options: name type contentscriptfile string,array the local file urls of content scripts to load.
platform/xpcom - Archive of obsolete content
ister() function to unregister them, whether or not you have disabled automatic unregistration: xpcom.unregister(factory); you can find out whether a factory or service has been registered by using the isregistered() function: if (xpcom.isregistered(factory)) xpcom.unregister(factory); globals constructors factory(options) parameters options : object required options: name type component constructor constructor for the component this factory creates.
... optional options: name type contract string a contract id.
tabs/utils - Archive of obsolete content
options : object optional options: name type inbackground boolean if true, open the new tab, but keep the currently selected tab selected.
... url : string gettabcontenttype(tab) get the contenttype of the document hosted by the specified tab.
ui/toolbar - Archive of obsolete content
equire("sdk/ui/frame"); var frame = new frame({ url: "./frame.html" }); var toolbar = toolbar({ title: "my toolbar", items: [frame], hidden: true, onshow: showing, onhide: hiding }); function showing(e) { console.log("showing"); console.log(e); } function hiding(e) { console.log("hiding"); console.log(e); } parameters options : object required options: name type title string the toolbar's title.
... optional options: name type items array adding buttons to toolbars is only supported from firefox 30 onwards.
cfx - Archive of obsolete content
for example, if you type: cfx run ---no-run you will see something like: to launch the application, enter the following command: /path/to/firefox/firefox-bin -profile /path/to/profile/tmpjdnlp6.mozrunner -foreground -no-remote this enables you to run the add-on without going through cfx, which might be useful if you want to run it inside a debugger like gdb.
... for example, if you type: cfx run ---no-run you will see something like: to launch the application, enter the following command: /path/to/firefox/firefox-bin -profile /path/to/profile/tmpjdnlp6.mozrunner -foreground -no-remote this enables you to run the add-on without going through cfx, which might be useful if you want to run it inside a debugger like gdb.
Display a Popup - Archive of obsolete content
self.port.on("show", function onshow() { textarea.focus(); }); finally, the "text-entry.html" file defines the <textarea> element: <html> <head> <style type="text/css" media="all"> textarea { margin: 10px; } body { background-color: gray; } </style> </head> <body> <textarea rows="13" cols="33" id="edit-box"></textarea> </body> </html> finally, save these three icon files to the "data" directory: icon-16.png icon-32.png icon-64.png try it out: "i...
...type some text and press "return" and you should see the output in the console.
Getting Started (jpm) - Archive of obsolete content
navigate to it, type jpm init, and hit enter: mkdir my-addon cd my-addon jpm init you'll then be asked to supply some information about your add-on: this will be used to create your add-on's package.json file.
... next, create a directory called "data" in your add-on's root, mkdir data and save these three icon files to the "data" directory: icon-16.png icon-32.png icon-64.png back at the command prompt, type: jpm run this is the jpm command to run a new instance of firefox with your add-on installed.
Getting started (cfx) - Archive of obsolete content
navigate to it, type cfx init, and hit enter: mkdir my-addon cd my-addon cfx init you'll see some output like this: * lib directory created * data directory created * test directory created * doc directory created * readme.md written * package.json written * test/test-main.js written * lib/main.js written * doc/main.md written your sample add-on is now ready for testing: try "cfx test" and then "cfx run".
... next, save these three icon files to the "data" directory: icon-16.png icon-32.png icon-64.png back at the command prompt, type: cfx run this is the sdk command to run a new instance of firefox with your add-on installed.
Localization - Archive of obsolete content
for example, suppose your "package.json" defines a single preference: { "preferences": [ { "type": "string", "name": "monster_name", "value": "gerald", "title": "name" } ], "name": "monster-builder", "license": "mpl 2.0", "author": "me", "version": "0.1", "title": "monster builder", "id": "monster-builder@me.org", "description": "build your own monster" } in your "en-us.properties" file, include these two items: m...
... now when the browser's locale is set to "en-us", users see this in the add-ons manager: when the browser's locale is set to "fr", they see this: the menulist and the radio preference types have options.
Bootstrapped extensions - Archive of obsolete content
the data is a simple javascript object with the following properties: property type description id string the id of the add-on being bootstrapped.
...there are three changes you must make: you have to change the html file's extension to be .xhtml the doctype must be defined point to a dtd file in your locale folder such as: <!doctype html system "chrome://l10n/locale/mozilla.dtd"> must add xmlns attribute to html tag for example: <html xmlns="http://www.w3.org/1999/xhtml"> if you have multiple dtd files read on here: using multiple dtds the bare minimum needed is: file: install.rdf file: chrome.manifest file: bootstrap.js folder: locale ...
Boxes - Archive of obsolete content
make the box style="display: block" and the wrapping behavior will occur when the box is resized: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="yourwindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <hbox style="display: block"> <label value="aaa"/> <label value="bbb"/> <label value="ccc"/> <label value="ddd"/> <label value="eee"/> <label value="fff"/> <label value="ggg"/> <label value="hhh"/> <label value="iii"/> <label value="jjj"/> <label value="kkk"/> <labe...
...this keeps the image from stretching inside the box: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <box align="start" style="display:block"> <image src="chrome://global/skin/icons/error.png" style="padding:5px"/> <textbox /> <image src="chrome://global/skin/icons/error.png" style="padding:5px"/> <button label="hello"/> <image src="chrome://global/skin/icons/error.png" style="padding:5px"/> </...
Customizing the download progress bar - Archive of obsolete content
in your jar.mn file, add the following (replacing "myextension" with the name of your extension's chrome package): % overlay chrome://mozapps/content/downloads/downloads.xul chrome://myextension/content/downloads-overlay.xul in downloads-overlay.xul, reference the new stylesheet: <?xml version="1.0"?> <?xml-stylesheet href="chrome://myextension/skin/myextension.css" type="text/css"?> <overlay id="mydownloadoverlay" xmlns="http://www.mozilla.org/keymaster/gat...re.is.only.xul"> </overlay> in jar.mn, make sure that there is an asterisk in front of the entry for myextension.css so that it will be preprocessed.
...in your overlay file, add a javascript file between the <overlay> and </overlay> tags: <script type="application/javascript" src="chrome://myextension/content/downloads-overlay.js" /> the javascript file will look something like this: var mydownloadmanager = { defaultcreatedownloaditem : null, init : function fdm_init() { mydownloadmanager.defaultcreatedownloaditem = window.createdownloaditem; window.createdownloaditem = function(aattrs) { var dl = mydownloadmanager.d...
Drag & Drop - Archive of obsolete content
ata.split("\n")[0], null, null); } else { var file = data.value.queryinterface(components.interfaces.nsifile); if (file) uri = _ios.newfileuri(file); } } if (uri) uris.push(uri); } // use the array of file uris } the _dragover function checks the drag data to see if a simple text file or general purpose file types are available.
... if the file types are present in the drag data, the function returns that dropping the data is allowed.
Embedding SVG - Archive of obsolete content
<?xml version="1.0" encoding="utf-8"?> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <body> <!-- html and svg go here --> </body> </html> example: <?xml version="1.0" encoding="utf-8"?> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"...
...>hello</p> <svg:svg version="1.1" baseprofile="full" width="150" height="150"> <svg:rect x="10" y="10" width="100" height="100" fill="red"/> <svg:circle cx="50" cy="50" r="30" fill="blue"/> </svg:svg> <p>world</p> </body> </html> embedding into xul make sure you use the right namespace when embedding <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- xul and svg go here --> </window> example: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.
Examples and demos from articles - Archive of obsolete content
[article] typewriter effect [html] the following example will delete and re-type simulating a typewriter all the text content of the nodelist which match a specified group of selectors.
...[article] image preview before upload [html] the filereader.prototype.readasdataurl() method is useful, for example, to get a preview of an image before uploading it.
IsDefaultNamespace - Archive of obsolete content
// http://www.w3.org/tr/dom-level-3-core/core.html#node3-isdefaultnamespace // http://www.w3.org/tr/dom-level-3-core/namespaces-algorithms.html#isdefaultnamespacealgo function isdefaultnamespace(node, namespaceuri) { if (node.isdefaultnamespace) { return node.isdefaultnamespace(namespaceuri); } switch (node.nodetype) { case 1: // element_node if (!node.prefix) { return (node.namespaceuri === namespaceuri); } if (node.attributes.length) { for (var i=0; i < node.attributes.length; i++) { var att = node.attributes[i]; if (att.localname === 'xmlns') { return att.value === n...
...ay have to be skipped to get to it return isdefaultnamespace(node.parentnode, namespaceuri); } else { return false; // unknown; } case 9: // document_node return isdefaultnamespace(node.documentelement, namespaceuri); case 6: // entity_node case 12: // notation_node case 10: // document_type_node case 11: // document_fragment_node return false; // unknown case 2: // attribute_node: if (node.ownerelement ) { return isdefaultnamespace(node.ownerelement , namespaceuri); } else { return false; // unknown } default: if (node.parentnode) { // entityref...
LookupPrefix - Archive of obsolete content
function lookupprefix (node, namespaceuri) { var htmlmode = document.contenttype; // mozilla only // depends on private function _lookupnamespaceprefix() below and on https://developer.mozilla.org/en/code_snippets/lookupnamespaceuri // http://www.w3.org/tr/dom-level-3-core/core.html#node3-lookupnamespaceprefix // http://www.w3.org/tr/dom-level-3-core/namespaces-algorithms.html#lookupnamespaceprefixalgo // (the above had a few apparent 'bugs' in the pseudo-code which were corrected here) if (node.lookupprefix && htmlmode !== 'text/html') { // shouldn't use ...
...this in text/html for mozilla as will return null return node.lookupprefix(namespaceuri); } if (namespaceuri === null || namespaceuri === '') { return null; } switch (node.nodetype) { case 1: // node.element_node return _lookupnamespaceprefix(namespaceuri, node); case 9: // node.document_node return _lookupnamespaceprefix(namespaceuri, node.documentelement); case 6: // node.entity_node case 12: // node.notation_node case 11: // node.document_fragment_node case 10: // node.document_type_node return null; // type is unknown case 2: // node.attribute_node if (node.ownerelement) { return _lookupnamespaceprefix(namespaceuri, node.ownerelement); } return null; default: if (node.parentnode) { // entityreferences may have to be skipped to get to ...
Progress Listeners - Archive of obsolete content
astatus, amessage) {}, onsecuritychange: function(awebprogress, arequest, astate) {} } attach the progress listener to a <browser> or a <tabbrowser> element using addprogresslistener, for example for firefox put the following code in a load listener of a main window: gbrowser.addprogresslistener(mylistener); when used with a browser, the second argument is a mask which determines the type of events that will be received.
... when used with a tabbrowser, you cannot choose which types of events that will be received.
Delayed Execution - Archive of obsolete content
delete delay.timers[idx]; func(); }, timeout, ci.nsitimer.type_one_shot); // store a reference to the timer so that it's not reaped before it fires.
... let idx = delay.timers.push(timer) - 1; return idx; } delay.timers = []; function repeat(timeout, func) { let timer = new timer(function () { func(); }, timeout, ci.nsitimer.type_repeating_slack); // store a reference to the timer so that it's not reaped before it fires.
XPath - Archive of obsolete content
notes and sample code for xpath and ajax (the following was moved from document.evaluate) obj.evaluate(xpathexpression,contextnode,namespaceresolver,resulttype,result); //obj and contextnode should be the same object, if context is a ajax xml object (example: returnedxml) this should be used as : returnedxml.evaluate(xpathexpression,returnedxml,namespaceresolver,returntype,result); //contextnode should be used in the one in which it was created //add by mooring 2008-11-15 16:00 china var xhr = new ajax('post','demo.xml',parsexml,'xml'); //ajax is a class written by javascript which return responsexml object to parsexml function function parsexml(obj)//obj is the returnxml object now { if(!obj.documentelement) { alert("your browser does't support this script!"); return;...
... } var fields = [];//store the results if(window.activexobject) { var tobj = obj.documentelement.selectnodes("/root/field/item"); for(var i=0;i<tobj.length; i++) { fields.push(tobj[i].text); } } else { var tobj = obj.evaluate("/root/field/item",obj.documentelement,null, xpathresult.any_type, null); var tmp = tobj.iteratenext(); while(tmp) { fields.push(tmp.textcontent); tmp = tobj.iteratenext(); } } alert(fields); } //here is the demo xml file for xpath <?xml version="1.0"?> <root> <field> <item>art_id</item> <item>psection</item> <item>qkind</item> <item>qtitle</item> <item>question</item> <item>pic</item> <item>answer1</item> <item>answer2</item> <item>answer3</item> <item>answer4</item> </field> </root> //add by mooring 2008...
Extension Etiquette - Archive of obsolete content
these often include areas such as: object prototypes, such as string.prototype, which are often extended to add methods to native objects.
...scripts can be loaded into their own globals, such as commonjs modules, javascript modules, or sandboxes, to avoid most global variable and prototype conflicts.
Migrating raw components to add-ons - Archive of obsolete content
javascript c-types some add-on authors create binary components not because they want to interact with firefox at the c++ level, but strictly so that they can make use of third party dlls.
... if this is the only reason you are using a binary component instead of javascript, take a look at the new javascript c-types support introduced in firefox 3.6.
Offering a context menu for form controls - Archive of obsolete content
<overlay id="formcontrolcontextmenu-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://formcontrolcontextmenu/content/overlay.js"/> </overlay> change the right-click behavior the overlaid code is responsible for adjusting the behavior of right-clicking on form controls.
... window.addeventlistener("load", function() { let settargetoriginal = nscontextmenu.prototype.settarget; components.utils.reporterror(settargetoriginal); nscontextmenu.prototype.settarget = function(anode, arangeparent, arangeoffset) { settargetoriginal.apply(this, arguments); if (this.istargetaformcontrol(anode)) this.shoulddisplay = true; }; }, false); this code, which is run when the window is opened up, works by replacing the settarget() routine for the prototype of nscontextmenu with one that forces the context menu to display if the target of the menu is a form control.
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
javascript is a prototype-based object-oriented language, and as shown in listing 3, also permits independent class definitions.
... listing 3: an example of a class definition in javascript function myclass() { } myclass.prototype = { property1 : true, property2 : 'string', method : function() { alert('hello, world!'); } }; var obj = new myclass(); obj.method(); dom: an api for manipulating xml documents the document object model (dom) is a technical standard promulgated by the w3c, and is an api for manipulating the contents of xml documents as objects.
Adding sidebars - Archive of obsolete content
<menupopup id="viewsidebarmenu"> <menuitem id="xulschoolhello-sidebar" label="&xulschoolhello.sidebar.title;" accesskey="&xulschoolhello.sidebar.accesskey;" type="checkbox" autocheck="false" group="sidebar" sidebarurl="chrome://xulschoolhello/content/sidebar.xul" sidebartitle="&xulschoolhello.sidebar.title;" oncommand="togglesidebar('xulschoolhello-sidebar');" /> </menupopup> the example in the mdc page includes a shortcut key combination to toggle the new sidebar.
...this kind of positioning can be useful for various artistic effects, as well as some type of desktop-like or dashboard-like interface, where items are located in positions determined by the user, and they can overlap with each other.
Adding windows and dialogs - Archive of obsolete content
common dialogs and the prompt service there are several types of dialogs that are fairly common, so there are ways to create them easily without having to reinvent the wheel and write all their xul and js code all over again.
...the prompt service has a very rich set of functions that allow different kinds of inputs, such as text, passwords, usernames and passwords, and checkboxes that can be used for "never ask this again"-type dialogs.
The Box Model - Archive of obsolete content
it is important to know how it works in order to make interfaces that are easy to localize, skin and use in different types of operating systems, screen sizes and resolutions.
...here's a typical usage of the label element: <label control="xulschoolhello-greeting-textbox" value="&xulschoolhello.typegreeting.label;" /> <textbox id="xulschoolhello-greeting-textbox" /> the label says something like "type a greeting message", and the textbox next to it allows the user to type the message.
Extensions support in SeaMonkey 2 - Archive of obsolete content
these type of extensions have many advantages for both users and developers compared to the old xpinstall/-style extensions.
...in the urlbar-icons for both firefox and seamonkey 2.0, use this code: <hbox id="urlbar-icons"> <image popup="myext-menu"/> </hbox> <window id="main-window"> <menupopup id="myext-menu"> <menuitem label="menuitem"/> <menuitem label="menuitem"/> </menupopup> </window> instead of <hbox id="urlbar-icons"> <button type="menu"> <menupopup> <menuitem label="menuitem"/> <menuitem label="menuitem"/> <menuitem label="menuitem"/> </menupopup> </button> </hbox> technical note: the code that opens the url history popup just looks for any menupopup, so it goes wrong if you add your own.
Security best practices in extensions - Archive of obsolete content
give the element a type="content" attribute, which essentially sandboxes the code there and blocks callback rights into chrome.
... non-chrome urls in chrome xul or html such as the following example are not allowed: <script type="text/javascript" src="http://mysite.greatsite.com/js/wow-content.js" /> in general, scripts that are from remote sources that run in the chrome context are not acceptable, as many times the source of the script can never be 100% guaranteed, and they are vulnerable to man-in-the-middle attacks.
Session store API - Archive of obsolete content
knowing when to restore each time firefox is about to restore a tab, an event of type sstabrestoring is sent.
...an event of type sstabrestored fires each time a tab has finished restoring.
Creating reusable content with CSS and XBL - Archive of obsolete content
copy and paste the content from here: <!doctype html public "-//w3c//dtd html 4.0//en"> <html> <head> <title>mozilla css getting started - xbl demonstration</title> <link rel="stylesheet" type="text/css" href="style6.css"> </head> <body> <h1>xbl demonstration</h1> <div id="square">click me</div> </body> </html> make a new css file, style6.css.
...copy and paste the content from here: <?xml version="1.0"?> <!doctype bindings> <bindings xmlns="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml"> <binding id="square"> <resources> <stylesheet src="bind6.css"/> </resources> <content> <html:div anonid="square"/> <xul:button anonid="button" type="button"> <children/> </xul:button> </content> <implementation> <field name="square"><![cdata[ do...
XUL user interfaces - Archive of obsolete content
copy and paste the content from here, making sure that you scroll to get all of it: <?xml version="1.0"?> <?xml-stylesheet type="text/css" href="style7.css"?> <!doctype window> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="css getting started - xul demonstration" onload="init();"> <script type="application/javascript" src="script7.js"/> <label class="head-1" value="xul demonstration"/> <vbox> <groupbox class="demo-group"> <caption label="day of week calculator"/> ...
... <grid> <columns> <column/> <column/> </columns> <rows> <row> <label class="text-prompt" value="date:" accesskey="d" control="date-text"/> <textbox id="date-text" type="timed" timeout="750" oncommand="refresh();"/> </row> <row> <label value="day:"/> <hbox id="day-box"> <label class="day" value="sunday" disabled="true"/> <label class="day" value="monday" disabled="true"/> <label class="day" value="tuesday" disabled="true"/> <label class="day" value="wednesday" disabled="true"/> <label class="day" value="thursday" disabled="true"/> <label class="day" value="friday" disabled="true"/> <label...
MozAudioAvailable - Archive of obsolete content
properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
MozBeforeResize - Archive of obsolete content
general info specification mozilla specific interface event bubbles no cancelable no target window default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
cached - Archive of obsolete content
general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
... type string the type of event.
checking - Archive of obsolete content
general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
... type string the type of event.
downloading - Archive of obsolete content
general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
... type string the type of event.
error - Archive of obsolete content
general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
... type string the type of event.
noupdate - Archive of obsolete content
general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
... type string the type of event.
obsolete - Archive of obsolete content
general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
... type string the type of event.
progress - Archive of obsolete content
general info specification offline interface progressevent bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
... type string the type of event.
updateready - Archive of obsolete content
general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
... type string the type of event.
Install.js - Archive of obsolete content
install.initinstall(dispname, regname, this.extversion); // find directory to install into var installpath; if (this.profileinstall) installpath = profiledir; else installpath = install.getfolder('chrome'); // add jar file install.addfile(null, 'chrome/' + jarname, installpath, null); // register chrome var jarpath = install.getfolder(installpath, jarname); var installtype = this.profileinstall ?
... install.profile_chrome : install.delayed_chrome; // register content install.registerchrome(install.content | installtype, jarpath, 'content/' + this.extshortname + '/'); // register locales for (var locale in this.extlocalenames) { var regpath = 'locale/' + this.extlocalenames[locale] + '/' + this.extshortname + '/'; install.registerchrome(install.locale | installtype, jarpath, regpath); } // register skins for (var skin in this.extskinnames) { var regpath = 'skin/' + this.extskinnames[skin] + '/' + this.extshortname + '/'; install.registerchrome(install.skin | installtype, jarpath, regpath); } // perform install var err = install.performinstall(); if (err == install.success || err == install.reboot_needed) { if (!this.silentinstall && t...
Monitoring WiFi access points - Archive of obsolete content
<html> <head> <title>wifi monitor example</title> <script> var count = 0; function test() { } test.prototype = { onchange: function (accesspoints) { netscape.security.privilegemanager.enableprivilege('universalxpconnect'); var d = document.getelementbyid("d"); d.innerhtml = ""; for (var i=0; i<accesspoints.length; i++) { var a = accesspoints[i]; d.innerhtml += "<p>" + a.mac + " " + a.ssid + " " + a.signal + "</p>"; } var c = document.getelementbyid("c"); c.i...
...nableprivilege('universalxpconnect'); var listener = new test(); var wifi_service = components.classes["@mozilla.org/wifi/monitor;1"].getservice(components.interfaces.nsiwifimonitor); wifi_service.startwatching(listener); </script> </head> <body> <div id="d"><p></p></div> <div id="c"><p></p></div> </body> </html> the nsiwifilistener object the first thing the code above does is to prototype the listener object that will be receiving notifications of changes to the access point list.
Source Navigator - Archive of obsolete content
but on the other hand mxr can only allow you to type in the name for it to generate a long list of occurances.
... type <tt>snavigator</tt> followed by striking enter.
Visualizing an audio spectrum - Archive of obsolete content
<!doctype html> <html> <head> <title>javascript spectrum example</title> </head> <body> <audio id="audio-element" src="song.ogg" controls="true" style="width: 512px;"> </audio> <div><canvas id="fft" width="512" height="200"></canvas></div> <script> var canvas = document.getelementbyid('fft'), ctx = canvas.getcontext('2d'), ...
...< buffersize ) { for ( var i = 0; i < limit; i++ ) { this.reversetable[i + limit] = this.reversetable[i] + bit; } limit = limit << 1; bit = bit >> 1; } for ( var i = 0; i < buffersize; i++ ) { this.sintable[i] = math.sin(-math.pi/i); this.costable[i] = math.cos(-math.pi/i); } }; fft.prototype.forward = function(buffer) { var buffersize = this.buffersize, costable = this.costable, sintable = this.sintable, reversetable = this.reversetable, real = this.real, imag = this.imag, spectrum = this.spectrum; if ( buffersize !== buffer.length ) { throw "supplied buffe...
Creating a hybrid CD - Archive of obsolete content
it is used as the creator type for readme and other text files because it can handle unix and windows linebreaks, but teachtext cannot.
... # example filename mapping file used by mkhybrid for hfs # # extn xlate creator type comment .hqx ascii 'sitx' 'text' "binhex file" .zip raw 'sitx' 'zip ' "zip file" .gz raw 'sitx' 'zip ' "gzip file" .tgz raw 'sitx' 'zip ' "tar.gz gzip file" .tar raw 'sitx' 'tarf' "tar file" .tif raw '8bim' 'tiff' "photoshop tiff image" .doc raw 'mswd' 'wdbn' "word file" .mov raw 'tvod' 'moov' "quicktime movie" .bin raw 'sitx' 'bina' "mac binary" .h ascii 'cwie' 'text' "c/c++ header file" .c ascii 'cwie' 'text' "c source file" .cp ascii 'cwie' 'text' "c++ source file" .cpp ascii 'cwie' 'text' "c++ source file" .exp ascii 'cwie' ...
Creating a Microsummary - Archive of obsolete content
specifying the output type since the xslt transform sheet will generate a text microsummary, we should indicate this with the xslt <output> element: <?xml version="1.0" encoding="utf-8"?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1" name="firefox download count"> <template> <transform xmlns="http://www.w3.org/1999/xsl/transform" version="1.0"> <output method="text"/> </transform...
...we might do so via the following code: <script> const warning = "sorry, you need a microsummary-enabled browser like firefox 2.0 to install and use microsummary generators."; function addgenerator(url) { if (typeof window.sidebar == "object" && typeof window.sidebar.addmicrosummarygenerator == "function") window.sidebar.addmicrosummarygenerator(url); else alert(warning); } </script> <button onclick="addgenerator('http://people.mozilla.com/~myk/microsummaries/tutorial/sfx-generator.xml')">install the spread firefox home page microsummary!</button> note that due to bug 341283, add...
Style System Overview - Archive of obsolete content
nsiframe::getstyledata does the same thing for the frame's mstylecontext member, and the global ::getstyledata is a typesafe helper that doesn't require the style struct id.
... this style struct is always const, and should always be declared as such (evil old-style casts often used with the non-typesafe forms sometimes hide this error), since the struct may be shared with other elements.
JavaScript OS.Shared - Archive of obsolete content
all these tools are designed to be used with js-ctypes.
...global object os.shared.type properties void_t voidptr_t char jschar int unsigned_int int32_t uint32_t int64_t uint64_t long bool off_t size_t ssize_t fd (unix only) negativeone_or_fd (unix only) negativeone_or_nothing (unix only) string (unix only) null_or_string (unix only) handle (windows only) maybe_handle (windows only) dword (windows only) negative_or_dword (windows only) zero_or_dword (windows only) zero_or_nothing (windows only) declareffi() intn_t() uintn_t()instances of os.shared.type convert_from_c() releasewith() attributes global object os.shared.hollowstructure in_ptr out_ptr inout_ptr ...
Java in Firefox Extensions - Archive of obsolete content
the following is a somewhat simplified snippet from xquseme: var reflect = java.lang.reflect; // build an array of the class types which are expected by our constructor (in this case, java.io.file and a class from another jar we loaded, com.sleepycat.db.environmentconfig) var paramtypes = reflect.array.newinstance(java.lang.class, 2); // 2nd argument should indicate the number of items in following array paramtypes[0] = java.io.file; var envconfigclass = loader.loadclass('com.sleepycat.db.environmentconfig'); paramtypes[1] ...
...= envconfigclass; // get the constructor var constructor = envclass.getconstructor(paramtypes); // now that we have the constructor with the right parameter types, we can build the specific arguments we wish to pass to it var arglist = reflect.array.newinstance(java.lang.object, 2); // 2nd argument should indicate the number of items in the following array var mydir = new java.io.file(dirurl); // a file url arglist[0] = mydir; var envconfig = envconfigclass.newinstance(); arglist[1] = envconfig; // call our constructor with our arguments var env = constructor.newinstance(arglist); be aware that liveconnect, while now actively supported by sun has only recently been reimplemented for use in mozilla, so there may still be some bugs (though many prior liveconnect bugs, such as try-catch not catc...
Twitter - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
...textstatus is a simple string describing the type of error.
Settings - Archive of obsolete content
here is an example manifest definition: var manifest = { settings: [ { name: "twitter", type: "group", label: "twitter", settings: [ { name: "username", type: "text", label: "username" }, { name: "password", type: "password", label: "password" } ] }, { name: "facebook", type: "group", label: "facebook", settings: [ { name: "username", type: "text", label: "username", default: "jdoe" }, { name: "password", t...
...ype: "password", label: "secret" } ] }, { name: "music", type: "boolean", label: "music", default: true }, { name: "volume", type: "range", label: "volume", min: 0, max: 10, default: 5 } ] }; // import after defining manifest!
Clipboard - Archive of obsolete content
features can get and set the clipboard in various flavors of data type.
...if no other arguments are specified, the flavor of the content is assumed to 'plain'.string flavordata type.
Clipboard - Archive of obsolete content
features can get and set the clipboard in various flavors of data type.
...if no other arguments are specified, the flavor of the content is assumed to 'plain'.string flavordata type.
LIR - Archive of obsolete content
it is a typed assembly language.
... category op code code name return type featured description miscellaneous 0 start void start of a fragment 1 regfence void a register fence causes no code to be generated, but it affects register allocation so that no registers are live when it is reached.
Remote debugging - Archive of obsolete content
core dumps on mac and linux to generate a core dump on mac, type "ulimit -c unlimited", run firefox from the command line, and make firefox crash.
...the developer can give you appropriate commands to type into the debugger.
File object - Archive of obsolete content
file.type a string specifying the type of data or encoding contained in the file.
...file.input, file.output, file.error or a pipeline) methods file.open() opens the file, specifying file mode and type.
Running Tamarin performance tests - Archive of obsolete content
adb is used to access your android device and can run both direct and shell-type commands.
...just type the following commands after making sure you've set the environment variables correctly.
The Download Manager schema - Archive of obsolete content
the schema table field name type description id integer a unique id for the download.
... mimetype text the mime type of the file.
The life of an HTML HTTP request - Archive of obsolete content
now the channel knows the content type of the incoming data, so the documentloader can find an nsidocumentloaderfactory for the "text/html" content type (in this case an nslayoutdlf).
...each content node corresponds to one or more nsiframe, except content with displaytype "none".
The new nsString class implementation (1999) - Archive of obsolete content
ase structure eliminates class fragility problem; safe across dll boundaries offers c-style function api to manipulate nsstrimpl offers simple memory allocator api for specialized memory policy shares binary format with bstring coming soon: a new xpcom (nsistring) interface non-templatized; this is a requirement for gecko very efficient buffer manipulation architecture the fundamental data type in the new architecture is struct nsstrimpl, given below: struct nsstrimpl { print32 mlength; void* mbuffer; print32 mcapacity; char mcharsize; char munused; // and now for the nsstrimpl api...
...in the new prototype nsstrimpl and nsstring classes, the allocator is an intrinsic member installed during construction of the string (by default they share a global allocator).
Using gdb on wimpy computers - Archive of obsolete content
type "show copying" to see the conditions.
...type "show warranty" for details.
Venkman Internals - Archive of obsolete content
you can see the prototype for this object at http://lxr.mozilla.org/mozilla/sourc...ebugger.js#914 scriptwrapper.jsdscript is the reference to the jsdiscript object for the function.
...try starting up venkman and type "/watch-expr client.scriptmanagers", make sure to turn on "include functions".
DOM Interfaces - Archive of obsolete content
parameters documenturl of type domstring - the url of a binding document.
... if (element.ownerdocument instanceof ci.nsidomdocumentxbl) { var anonchildren = element.ownerdocument.getanonymousnodes(element); if (anonchildren) { for (var i = 0; i < anonchildren.length; i++) { if (anonchildren[i].nodetype == 1) return false; } } } return true; ...
Example Sticky Notes - Archive of obsolete content
view this example <!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html401/strict.dtd"> <html> <head> <title>xbl demo : sticky notes</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <style type="text/css"> body { background-color: #ffffff; color: #000000; font: 1em verdana, sans-serif; } h1 { font-size: 1.5em; } /* binding: */ .sticker { -moz-binding: url(notes.xml#default); } </style> </head> <body> <h1><a href="http://developer.mozilla.org/en/docs/xbl:xbl_1.0_reference">xbl</a> demo : sticky notes</h1> <div class="sticker"><p>acme,&nbsp;inc.
...--> <handler event="click"><![cdata[ if (this.priority == 'normal') { this.priority = 'high'; this.setborder('2px solid red'); } else { this.priority = 'normal'; this.setborder('2px solid blue'); } var str = this.innertext + '\n\n'; str+= ('on ' + event.type + ' priority set to: ' + this.priority); window.alert(str); ]]></handler> <handler event="mouseover"><![cdata[ this.$bg = this.style.backgroundcolor || '#ffff00'; this.style.backgroundcolor = '#ffcc00'; ]]></handler> <handler event="mouseout"><![cdata[ this.style.backgroundcolor = this.$bg; ]]></handler> </handlers> </binding> </bindings> notes.css .sticker { position: relativ...
Creating XPI Installer Modules - Archive of obsolete content
the barley package ui is a single xul window with an accompanying image: <?xml version="1.0"?> <?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?> <window title="barley window" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gat...re.is.only.xul" width="175" height="375" x="20" y="20" persist="width height x y" orient="vertical" autostretch="always"> <script src="barley.js"/> <image src="barley.gif" /> <box orient="horizontal" autostretch="never"> <button label="barle...
...hat installation script should read as follows: // initinstall(name + version, name, version); var err = initinstall("barley v", "barley", ""); logcomment("initinstall: " + err); addfile("barley grain", // displayname from contents.rdf "barley.jar", // jar source getfolder("chrome"), // target folder ""); // target subdir // registerchrome(type, location, source) registerchrome(package | delayed_chrome, getfolder("chrome","barley.jar"), "content/"); if (err==success) performinstall(); else cancelinstall(err); note that there is no version number on barley, and so the name + version parameter has a "v" and then nothing else.
Unix stub installer - Archive of obsolete content
on the shell prompt type "perl deliver.pl".
...then add the componentx into the appropriate setup types so the installer module installs it when users select the setup types you choose it to be in.
Windows stub installer - Archive of obsolete content
(if you need to rebuild stub installer, got to /mozilla/xpinstall/wizard/windows/setup and type "nmake /f makefile.win") go to mozilla/xpinstall/wizard/windows/builder on the shell prompt type "perl build.pl".
...then add the component <component> into the appropriate setup types so the installer module installs it when users select the setup types you choose it to be in.
A XUL Bestiary - Archive of obsolete content
the chrome url, which appears in place of the http url in pointers like the following global skin processing instruction: <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> specifies a chrome to be loaded by the gecko rendering engine.
...there are, unfortunately, different document object models corresponding to different types of documents and also to different proprietary notions about what in a document should be exposed programmatically.
searchbutton - Archive of obsolete content
« xul reference home searchbutton type: boolean if true, the search field will only fire a command event when the user presses the search button or presses the enter key.
...this attribute only applies to textboxes with the type search.
autocheck - Archive of obsolete content
« xul reference home autocheck type: boolean if this attribute is true or left out, the checked state of the button will be switched each time the button is pressed.
...when autocheck is true, the button type should be "checkbox" or "radio".
checkState - Archive of obsolete content
« xul reference home checkstate type: integer, values 0, 1, or 2 this attribute may be used to create three state buttons, numbered 0, 1 and 2.
...the type attribute must be set to checkbox for buttons with a check state.
checked - Archive of obsolete content
« xul reference home checked type: boolean indicates whether the element is checked or not.
... for buttons, the type attribute must be set to checkbox or radio for this attribute to have any effect.
menuitem.name - Archive of obsolete content
« xul reference home name type: string name radio menuitems with the same name as put into a group.
... example <toolbox> <menubar id="planets-menubar"> <menu id="planet-menu" label="planet"> <menupopup> <menuitem id="jupiter" label="jupiter" type="radio" name="planet"/> <menuitem id="saturn" label="saturn" type="radio" name="planet" checked="true"/> <menuitem id="uranus" label="uranus" type="radio" name="planet"/> </menupopup> </menu> </menubar> </toolbox> see also name and menus in the xul tutorial ...
onchange - Archive of obsolete content
a change event is fired in different ways for different xul input elements as listed below: onchange type: script code textbox when enter key is pressed radio/check box when the state is changed select list when the selected item is changed what is accessible the script context at this point can only access the following things: global values/functions i.e.
... window, document, or any of the functions/objects/variables bound to the window object event object example <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="text/javascript"> function myfunction(e){ /* do something cool here or just say the below */ alert(e.target.nodename); } </script> <textbox id="find-text" onchange="return myfunction(event);"/> </window> ...
searchSessions - Archive of obsolete content
« xul reference home searchsessions obsolete since gecko 26 type: space-separated list of session names set to a keyword indicating what type of data to look up for autocomplete.
... you may set multiple types by separating their names by spaces.
CheckboxStateChange - Archive of obsolete content
general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
DOMMenuItemActive - Archive of obsolete content
general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
DOMMenuItemInactive - Archive of obsolete content
general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
RadioStateChange - Archive of obsolete content
general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
ValueChange - Archive of obsolete content
general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
broadcast - Archive of obsolete content
general info specification xul interface event bubbles no cancelable no target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
close - Archive of obsolete content
properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
command - Archive of obsolete content
ArchiveMozillaXULEventscommand
general info specification xul interface xulcommandevent bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
commandupdate - Archive of obsolete content
properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
popuphidden - Archive of obsolete content
general info specification xul interface popupevent bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
popuphiding - Archive of obsolete content
general info specification xul interface popupevent bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
popupshowing - Archive of obsolete content
general info specification xul interface popupevent bubbles yes cancelable yes target element default action a popup is displayed properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
popupshown - Archive of obsolete content
general info specification xul interface popupevent bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
startFind - Archive of obsolete content
« xul reference home startfind( mode ) return type: no return value call this method to handle your application's "find" command.
... the mode should be one of find_normal, find_typeahead, or find_links.
getResultAt - Archive of obsolete content
« xul reference home getresultat( index ) obsolete since gecko 26 return type: nsiautocompleteitem returns the result item at the specified index.
... the item will be a value of type nsiautocompleteitem.
getSession - Archive of obsolete content
« xul reference home getsession( index ) obsolete since gecko 26 return type: nsiautocompletesession returns the session object with the given index.
... this will return an object of type nsiautocompletesession.
getSessionByName - Archive of obsolete content
« xul reference home getsessionbyname( name ) obsolete since gecko 26 return type: nsiautocompletesession returns the session object with the given name.
... this will return an object of type nsiautocompletesession.
makeEditable - Archive of obsolete content
« xul reference home makeeditable( editortype, waitforload ) return type: no return value this function enables editing for an editor.
... specify text or html as the editortype.
openPopup - Archive of obsolete content
« xul reference home openpopup( anchor , position , x , y , iscontextmenu, attributesoverride, triggerevent ) return type: no return value opens the popup relative to a specified node at a specific location.
... iscontextmenu the iscontextmenu argument should be true for context menus and false for all other types of popups.
openSubDialog - Archive of obsolete content
« xul reference home opensubdialog( url, features, params ) return type: window opens a child modal dialog.
...if the child dialog is also a prefwindow, set its type attribute to child so that preferences will be saved properly when the main dialog is closed.
Node - Archive of obsolete content
ArchiveMozillaXULNode
constants the nsidomnode interface is the primary datatype for the entire document object model.
...for more information on this interface please see dom-level-2-core short element_node 1 short attribute_node 2 short text_node 3 short cdata_section_node 4 short entity_reference_node 5 short entity_node 6 short processing_instruction_node 7 short comment_node 8 short document_node 9 short document_type_node 10 short document_fragment_node 11 short notation_node 12 methods node appendchild ( node newchild ) node clonenode ( boolean deep ) boolean hasattributes ( ) boolean haschildnodes ( ) node insertbefore ( node newchild , node refchild ) boolean issupported ( string feature , string version ) void normalize ( ) node removechild ( node oldchild ) node replacechild ( node newchild , node oldchild ) ...
ContextMenus - Archive of obsolete content
the nsiimageloadingcontent interface is implemented by all types of images.
...the result is that context clicking on images will show a menu with three items, but will only show one item for other types of elements.
Positioning - Archive of obsolete content
the position attribute the position of all types of popups can be controlled in two ways.
... <button label="popup" type="menu"> <menupopup style="margin-top: 2ex;"> <menuitem label="cat"/> <menuitem label="dog"/> </menupopup> </button> this technique is used internally for tooltips.
findMode - Archive of obsolete content
« xul reference findmode type: integer read only.
... possible values are: find_normal (0): normal find find_typeahead (1): typeahead find find_links (2): link find ...
listbox.currentIndex - Archive of obsolete content
« xul reference currentindex type: integer set to the index of the currently focused item in the list.
...(or, on some platforms, typeof(listboxcurrentindex) will be undefined) in a single selection list, the current index will always be the same as the selected index.
Providing Command-Line Options - Archive of obsolete content
using the example to use this sample code, save the commandline.js file into the components directory and add the following lines to your chrome.manifest file: component {2991c315-b871-42cd-b33f-bfee4fcbf682} components/commandline.js contract @mozilla.org/commandlinehandler/general-startup;1?type=myapp {2991c315-b871-42cd-b33f-bfee4fcbf682} category command-line-handler m-myapp @mozilla.org/commandlinehandler/general-startup;1?type=myapp the javascript code const cc = components.classes; const ci = components.interfaces; components.utils.import("resource://gre/modules/xpcomutils.jsm"); components.utils.import("resource://gre/modules/services.jsm"); // changeme: to the chrome uri of y...
... * @param aargument an argument to pass to the window (may be null) */ function openwindow(achromeurispec, aargument) { services.ww.openwindow(null, achromeurispec, "_blank", "chrome,menubar,toolbar,status,resizable,dialog=no", aargument); } // command line handler function commandlinehandler() { }; commandlinehandler.prototype = { classdescription: "myapphandler", // changeme: generate a unique id classid: components.id('{2991c315-b871-42cd-b33f-bfee4fcbf682}'), // changeme: change the type in the contractid to be unique to your application contractid: "@mozilla.org/commandlinehandler/general-startup;1?type=myapp", _xpcom_categories: [{ category: "command-line-handler", // changeme: // category ...
Additional Navigation - Archive of obsolete content
for instance, if items were identified with a type, the data could be filtered to include only items of a particular type.
...usually you won't be filtering on a title though--you would instead filter on a value that acts like a type.
Building Hierarchical Trees - Archive of obsolete content
he streets datasource: <tree flex="1" datasources="template-guide-streets.rdf" ref="http://www.xulplanet.com/rdf/myneighbourhood" flags="dont-build-content" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <treecols> <treecol id="address" primary="true" label="address" flex="1"/> <treecol id="floors" label="floors" flex="1"/> </treecols> <template> <rule rdf:type="http://www.xulplanet.com/rdf/house"> <treechildren> <treeitem uri="rdf:*"> <treerow> <treecell label="rdf:http://www.xulplanet.com/rdf/address"/> <treecell label="rdf:http://www.xulplanet.com/rdf/floors"/> </treerow> </treeitem> </treechildren> </rule> <rule> <treechildren> <treeitem uri="rdf:*"> ...
... <tree datasources="people2.xml" ref="*" querytype="xml" rows="10" flags="dont-build-content"> <treecols> <treecol id="name" primary="true" label="name" flex="1"/> </treecols> <template> <query expr="*"/> <action> <treechildren> <treeitem uri="?"> <treerow> <treecell label="?name"/> </treerow> </treeitem> </treechildren> </action> </template> </tree> �...
Namespaces - Archive of obsolete content
ng the following xml document containing a list of people: <people xmlns="www.example.com/people"> <person name="napoleon bonaparte" gender="male"/> <person name="cleopatra" gender="female"/> <person name="julius caesar" gender="male"/> <person name="ferdinand magellan" gender="male"/> <person name="laura secord" gender="female"/> </people> <listbox datasources="people.xml" ref="*" querytype="xml"> <template xmlns:ns="www.example.com/people"> <query expr="ns:person"/> <action> <listitem uri="?" label="?ns:name"/> </action> </template> </listbox> once added to the template element the namespaces can then be referenced inside temple rule elements too, this works both in rdf and xml templates.
... <listbox datasources="people.xml" ref="*" querytype="xml"> <template xmlns:ns="www.example.com/people"> <query expr="ns:person"/> <rule ns:gender="male"> <label uri="?" label="?ns:name"/> </action> </template> </listbox> ...
Result Generation - Archive of obsolete content
there are two types of nodes in rdf, resources which usually represent 'things', and literals which are values like the names, dates or sizes of those things, and so on.
...a resource's value is a uri which for your own rdf data you can just make up (though if you plan to use your model with others, it should be unique, preferably a url for a site you own, so as to avoid future conflicts with mixing of other types).
Template Builder Interface - Archive of obsolete content
both types of builder share much of the same code except for how they generate output to be displayed.
... both types of builders implement the nsixultemplatebuilder interface, while the tree builder also implements the nsixultreebuilder interface.
Template and Tree Listeners - Archive of obsolete content
listening for tree changes the second type of listener is used to handle particular actions related to trees.
...for example, in some situations you may want to require dragging onto a folder type of row.
Complete - Archive of obsolete content
where you see a url in the code with no file name, the application uses this default file name and an extension appropriate for the type of file expected.
... when the xul file, allcustom.xul is loaded, the doctype declaration near the top loads a dtd from chrome://allcustom/locale/.
Adding Methods to XBL-defined Elements - Archive of obsolete content
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.
...because mozilla uses javascript as its scripting language, and javascript is a non-typed language, you do not need to specify the types of the parameters.
Creating Dialogs - Archive of obsolete content
example dialog source view <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog id="donothing" title="dialog example" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" buttons="accept,cancel" ondialogaccept="return dook();" ondialogcancel="return docancel();"> <script> function dook(){ alert("you pressed ok!"); return true; } function docancel(){ alert("you pressed cancel!"); return true; } <...
... example dialog with more features <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog id="mydialog" title="my dialog" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="window.sizetocontent();" buttons="accept,cancel" buttonlabelaccept="set favourite" buttonaccesskeyaccept="s" ondialogaccept="return dosave();" buttonlabelcancel="cancel" buttonaccesskeycancel="n" ...
Creating a Wizard - Archive of obsolete content
the wizard a wizard is a special type of dialog that contains a number of pages.
... an example wizard source <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <wizard id="example-window" title="select a dog wizard" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <wizardpage> <description> this wizard will help you select the type of dog that is best for you." </description> <label value="why do you want a dog?"/> <menulist> <menupopup> <menuitem label="to scare people away"/>...
Focus and Selection - Archive of obsolete content
you can use it for any element and event type.
... it takes three parameters, the event type, a function to execute when the event occurs and a boolean indicating whether to capture or not.
Grids - Archive of obsolete content
ArchiveMozillaXULTutorialGrids
if the columns has been placed first, the rows would have grabbed the events and you would not be able to type into the fields.
...you can use a box type for example, and put other elements inside it if you want to use several elements.
Groupboxes - Archive of obsolete content
the groupbox is a type of box, and the elements it contains are aligned according to the xul box rules.
...the radiogroup is a type of box.
Introduction - Archive of obsolete content
the first three types all require an installation to be performed on the user's machine.
... however, these types of applications do not have security restrictions placed on them, so they may access local files and read and write preferences, for example.
Introduction to XBL - Archive of obsolete content
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.
...xul (example.xul): <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="chrome://example/skin/example.css" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <box class="okcancelbuttons"/> </window> css (example.css): box.okcancelbuttons { -moz-binding: url('chrome://example/skin/example.xml#okcancel'); } xbl (example.xml): <?xml version="1.0"?> <bindings xmlns="http://www.m...
Manifest Files - Archive of obsolete content
you can combine all of the three types into a single file if you wish.
...for example, in <!doctype window system "chrome://fireclipse/locale/fireclipse.dtd"> the dtd file must exist and its directory must be correctly addressed in the "locale" manifest or xml parsing will fail.
Modifying a XUL Interface - Archive of obsolete content
the createelement() function will create the default type of element for the document.
...here is an example of how to create this type of interface.
More Event Handlers - Archive of obsolete content
what will happen depends on the event and the type of element.
...example 3 : source view <button label="types" type="menu"> <menupopup onpopupshowing="event.preventdefault();"> <menuitem label="glass"/> <menuitem label="plastic"/> </menupopup> </button> alternatively, for attribute event listeners, you can just return false from the code.
More Wizards - Archive of obsolete content
for example, here are a set of wizard pages (the inner content has been omitted): <wizardpage pageid="type" next="font"> <wizardpage pageid="font" next="done"> <wizardpage pageid="color" next="done"> <wizardpage pageid="done"> the wizard always starts at the first page, which in this case has the page id type.
... wizard example source <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <wizard id="thewizard" title="secret code wizard" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script> function checkcode(){ document.getelementbyid('thewizard').canadvance = (document.getelementbyid('secretcode').value == "cabbage"); } </script> <wizardpage onpageshow="checkcode(); return true;"> <label value="enter the secret code:"/> ...
Progress Meters - Archive of obsolete content
there are two types of progress meters: determinate and indeterminate.
... determinate progress meter: indeterminate progress meter: the progress meter has the following syntax: <html:progress id="identifier" mode="determined" value="50" max="100"/> the attributes are as follows: id the unique identifer of the progress meter mode the type of the progress meter.
RDF Datasources - Archive of obsolete content
you can use rules to match specific types of content.
...example 3 : source view <window id="example-window" title="history list" xmlns:animals="http://www.some-fictitious-zoo.com/rdf#" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <button label="click here to see the mammals the zoo has" type="menu" datasources="animals.rdf" ref="http://www.some-fictitious-zoo.com/mammals"> <template> <rule animals:specimens="0"></rule> <rule> <menupopup> <menuitem uri="rdf:*" label="rdf:http://www.some-fictitious-zoo.com/rdf#name"/> </menupopup> </rule> </template> </button> </window> in this case only the mammals are desired, so we select the uri of the ...
Simple Menu Bars - Archive of obsolete content
the menubar has no special attributes but it is a type of box.
...it is a type of box which defaults to a vertical orientation.
Styling a Tree - Archive of obsolete content
you can create a progressmeter column by setting the type attribute on the column to progressmeter.
...the following properties are automatically set as needed: checked this property is set cells whose column is type="checkbox" focus this property is set if the tree currently has the focus.
Tree View Details - Archive of obsolete content
the tree box object is a specialized type of box object specific to trees and will be examined in detail in the next section.
...they are added near the end of the complete example, shown here: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window onload="init();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <tree id="elementlist" flex="1"> <treecols> <treecol id="element" label="element" primary="true" flex="1"/> </treecols> <treechildren/> </tree> <script> <![cdata[ var treeview = { childdata : { solids: ["silver", "gold", "lead"], liquids: ["mercury"], ga...
Using Visual Studio as your XUL IDE - Archive of obsolete content
as it does not work out of the box with unknown file extensions (like .xul, .xbl and .jsm), you have to do some registry tricks, so that va knows how to treat these file types.
...that has to do with the way mozilla implemented localization: < !doctype window system "chrome://loomo/locale/main.dtd"> visual studio doesn't recognize the chrome uri prefix, what will give you an error at the previous line ("the uri prefix is not recognized").
Using the standard theme - Archive of obsolete content
applying the standard theme in order to use the theme currently chosen by the user of the base application (the so called "global skin"), you have to add the following line to your xul file: <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> this imports the styles found in the <tt>global/skin</tt> chrome directory and will make the standard xul widgets of your application use the selected chosen theme.
... multiple <tt>xml-stylesheet</tt> processing instructions simply add one <tt>xml-stylesheet</tt> processing instruction for every style sheet you want to associate with your xul file: <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="chrome://myextension/skin/custom.css" type="text/css"?> <tt>@import</tt> chains first, import the global skin in your custom style sheet using the css <tt>@import</tt> rule: @import url("chrome://global/skin/"); you then have to associate your xul file with your custom style sheet only: <?xml-stylesheet href="chrome://myextension/skin/custom.css" type="text...
autohide - Archive of obsolete content
« xul reference home autohide type: boolean when set to true, the toolbar will be invisible unless the alt key is pressed by the user.
...this only has an effect on windows and needs to be combined with type="menubar" and a menubar element.
content - Archive of obsolete content
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 propiedades tag type: tag name this may be set to a tag name.
... uri type: ?
dropmarker - Archive of obsolete content
for instance the menulist and the popup type of datepicker use a dropmarker, that when pressed, will reveal a popup menu.
... examples properties accessibletype attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element.
grid - Archive of obsolete content
ArchiveMozillaXULgrid
« xul reference home [ examples | attributes | properties | methods | related ] a grid is a layout type that arranges elements in rows and columns.
... from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
groupbox - Archive of obsolete content
properties accessibletype examples <groupbox> <caption label="settings"/> <radiogroup> <radio label="black and white"/> <radio label="colour"/> </radiogroup> <checkbox label="enabled"/> </groupbox> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equa...
...lsize, 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.
member - Archive of obsolete content
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties child type: ?
... container type: ?
preferences - Archive of obsolete content
examples <preferences> <preference id="pref_one" name="extensions.myextension.one" type="bool"/> <preference id="pref_two" name="extensions.myextension.two" type="string"/> ...
... from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
spinbuttons - Archive of obsolete content
for instance, spinbuttons are used for the number type textbox, and with the timepicker and datepicker.
... from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
statusbar - Archive of obsolete content
properties accessibletype examples <statusbar> <statusbarpanel label="left panel"/> <spacer flex="1"/> <progressmeter mode="determined" value="82"/> <statusbarpanel label="right panel"/> </statusbar> 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, in...
...sertbefore, 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.
textnode - Archive of obsolete content
attributes value examples (example needed) attributes value type: uri the text value to display.
... from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
toolbarseparator - Archive of obsolete content
properties accessibletype examples <toolbox> <toolbar> <toolbarbutton label="button 1"/> <toolbarseparator /> <toolbarbutton label="button 2"/> </toolbar> </toolbox> 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, observ...
...es, 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.
toolbarspacer - Archive of obsolete content
properties accessibletype examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties ...
... accessibletype type: integer a value indicating the type of accessibility object for the element.
toolbarspring - Archive of obsolete content
properties accessibletype examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width pr...
...operties accessibletype type: integer a value indicating the type of accessibility object for the element.
treechildren - Archive of obsolete content
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.
... from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
treecols - Archive of obsolete content
attributes pickertooltiptext properties accessibletype examples (example needed) attributes pickertooltiptext type: string the text for the tooltip on the column picker.
... from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element.
treerow - 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.
... from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
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.
... from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
Building XULRunner with Python - Archive of obsolete content
of particular interested is access to msaa and iaccessible2 via the python comtypes package.
... using python in xul applications add the following to yourprefs.js during development pref("browser.dom.window.dump.enabled", true); pref("javascript.options.showinconsole", true); pref("javascript.options.strict", true); pref("nglayout.debug.disable_xul_cache", true); pref("nglayout.debug.disable_xul_fastload", true); html <script> tags specify that python is used withtype="application/x-python" attribute.
Deploying XULRunner - Archive of obsolete content
here's a sample one: <?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple computer//dtd plist 1.0//en" "http://www.apple.com/dtds/propertylist-1.0.dtd"> <plist version="1.0"> <dict> <key>cfbundledevelopmentregion</key> <string>english</string> <key>cfbundleexecutable</key> <string>xulrunner</string> <key>cfbundlegetinfostring</key> <string>1.0</string> <key>cfbundleiconfile</key> <string>app_icon.icns</string> <key>cfbundleidentifier</ke...
...y> <string>net.yourcompany.yourapplication</string> <key>cfbundleinfodictionaryversion</key> <string>6.0</string> <key>cfbundlename</key> <string>applicationname</string> <key>cfbundlepackagetype</key> <string>appl</string> <key>cfbundleshortversionstring</key> <string>1.0</string> <key>cfbundlesignature</key> <string>????</string> <!--only useful if your app handle urls--> <key>cfbundleurltypes</key> <array> <dict> <key>cfbundleurliconfile</key> <string>app_icon.icns</string> <key>cfbundleurlname</key> <string>yourapp entity</string> <key>cfbundleurlschemes</key> <array> <string>chrome</string> </array> </dict> </array> <key>cfbundleversion</key> <string>1.0</string> </dict> </plist> here's a sample of the pkginfo file aapl????
Getting started with XULRunner - Archive of obsolete content
toolkit.singletonwindowtype allows configuring the application to allow only one instance at a time.
... main.xul: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="main" title="my app" width="300" height="300" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://myapp/content/main.js"/> <caption label="hello world"/> <separator/> <button label="more >>" oncommand="showmore();"/> <separator/> <description id="more-text" hidden="true">this is a simple...
XULRunner Hall of Fame - Archive of obsolete content
mockery mockery is a gui design tool for creating and editing mockups, prototypes, and wireframes for web and desktop software.
...latest release: june 2010 - build instructions utilities / prototypes ajax toolkit framework (atf) a part of the eclipse web tools platform (wtp) aliwal geocoder geocode addresses onto a map benjamin's xulrunner examples "mybrowser is a very simple example browser", xulmine.
Using SOAP in XULRunner 1.9 - Archive of obsolete content
; for (var k in params) { body.appendchild(new soapobject(k).val(params[k])); } var req = new soaprequest(url, body); req.action = ns + '#' + method; soapclient.sendrequest(req, callback); diff between jqsoapclient.js and sasoapclient.js 42c42 < var jsout = $.xmltojson(xdata.responsexml); --- > var jsout = xmlobjectifier.xmltojson(xdata.responsexml); 46,60c46,62 < $.ajax({ < type: "post", < url: soapclient.proxy, < datatype: "xml", < processdata: false, < data: content, < complete: getresponse, < contenttype: soapclient.contenttype + "; charset=\"" + soapclient.charset + "\"", < beforesend: function(req) { < req.setrequestheader("method", "post"); < req.setrequestheader("content-length", soapclient.contentlength); < ...
...lient.soapserver); < req.setrequestheader("soapaction", soapreq.action); < } < }); --- > var xhr = new xmlhttprequest(); > xhr.mozbackgroundrequest = true; > xhr.open('post', soapclient.proxy, true); > xhr.onreadystatechange = function() { > if (4 != xhr.readystate) { return; } > getresponse(xhr); > }; > var headers = { > 'method': 'post', > 'content-type': soapclient.contenttype + '; charset="' + > soapclient.charset + '"', > 'content-length': soapclient.contentlength, > 'soapserver': soapclient.soapserver, > 'soapaction': soapreq.action > }; > for (var h in headers) { xhr.setrequestheader(h, headers[h]); } > xhr.send(content); ...
Windows and menus in XULRunner - Archive of obsolete content
here is an example: <?xml version="1.0"?> <?xml-stylesheet href="chrome://basicapp/skin/main.css" type="text/css"?> <!doctype window system "chrome://basicapp/locale/main.dtd"> <window id="main" title="&title;" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script src="main.js"/> ...
... building on the simple window code, here is what xul menus and toolbars look like: <?xml version="1.0"?> <?xml-stylesheet href="chrome://basicapp/skin/main.css" type="text/css"?> <!doctype window system "chrome://basicapp/locale/main.dtd"> <window id="main" title="&title;" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script src="main.js"/> <toolbox> <menubar id="menubar"> <menu id="file-menu" label="&file;"> <menupopup id="file-popup"> <menuitem label="&file.new;" oncommand="dofilenew();"/> ...
toolkit.defaultChromeFeatures - Archive of obsolete content
type: string specified by: default prefs of xulrunner applications default: "chrome,dialog=no,all" example: pref("toolkit.defaultchromefeatures", "chrome,resizable=no,dialog=no"); the toolkit.defaultchromefeatures preference allows simple xulrunner-based applications to specify what features are passed to window.open() when the main application window is opened.
... see also: xulrunner:specifying startup chrome window, dom:window.open, toolkit.defaultchromeuri, toolkit.singletonwindowtype.
toolkit.defaultChromeURI - Archive of obsolete content
type: string specified by: default prefs of xulrunner applications default: none example: pref("toolkit.defaultchromeuri", "chrome://myapp/content/"); the toolkit.defaultchromeuri preference allows simple xulrunner-based applications to open a new window when the application is launched.
...see also: xulrunner:specifying startup chrome window, toolkit.defaultchromefeatures, toolkit.singletonwindowtype.
xbDesignMode.js - Archive of obsolete content
* * contributor(s): doron rosenberg <doron@netscape.com> (original author) * * * * ***** end license block ***** */ /* xbdesignmode a javascript wrapper for browsers that support designmode */ function xbdesignmode(aiframe){ this.meditordocument = null; this.miframeelement = null; // argument is a string, therefore an id if ( (typeof(aiframe) == "string") && (document.getelementbyid(aiframe).tagname.tolowercase()=="iframe") ){ this.miframeelement = document.getelementbyid(aiframe); } else if( (typeof(aiframe)=="object") && (aiframe.tagname.tolowercase() == "iframe") ){ this.miframeelement = aiframe; } else { throw "argument isn't an id of an iframe or an iframe reference"; } if (this.miframeelement.cont...
...itordocument = this.miframeelement.contentdocument; this.meditordocument.designmode = "on"; } else { // ie this.meditordocument = this.miframeelement.contentwindow.document; this.meditordocument.designmode = "on"; // ie needs to reget the document element after designmode was set this.meditordocument = this.miframeelement.contentwindow.document; } } xbdesignmode.prototype.execcommand = function (acommandname, aparam){ if (this.meditordocument) this.meditordocument.execcommand(acommandname, false, aparam); else throw "no meditordocument found"; } xbdesignmode.prototype.setcsscreation = function (ausecss){ if (this.meditordocument) this.meditordocument.execcommand("usecss", false, ausecss); else throw "no meditordocument found"; } ...
Mozilla release FAQ - Archive of obsolete content
please send stats to me in the following format: cpu/mhz, architecture, ram, disk type, os version, compiler version, build type, tree date -- build time example: 21164/533, alpha, 512m edo, ultra2 scsi, linux kernel 2.2.11, gcc 2.95, non-debug, 19 august 1999 cvs -- 25 minutes how do i run the binary on unix?
...it is very difficult to determine what components of the webpage actually needs -- certain images may be shared between several pages, the user may have images turned off or lack capabilities to use a certain type of media.
2006-10-06 - Archive of obsolete content
pcast: similar to feed: just differentiating between different types of feeds and should be allowed access.
... webcal: & swebcal: should also be allowed as the security manager doesn't differentiate between access types.
2006-10-20 - Archive of obsolete content
discussions mp3's considered a malicious file type?
... --------------010306060708080008030904 content-type: audio/mpeg; name="eternals - babalus's wedding dayfinal.mp3" content-transfer-encoding: base64 content-id: <part1.00030607.05030...@gmail.com> content-disposition: inline; filename="eternals - babalus's wedding dayfinal.mp3" he wonders why this is.
NPAPI plugin developer guide - Archive of obsolete content
plug-in basics how plug-ins are used plug-ins and helper applications how plug-ins work understanding the runtime model plug-in detection how gecko finds plug-ins checking plug-ins by mime type overview of plug-in structure understanding the plug-in api plug-ins and platform independence windowed and windowless plug-ins the default plug-in using html to display plug-ins plug-in display modes using the object element for plug-in display nesting rules for html elements using the appropriate attributes using the embed element for plug-in display ...
...overview writing plug-ins registering plug-ins ms windows unix mac os x drawing a plug-in instance handling memory sending and receiving streams working with urls getting version and ui information displaying messages on the status line making plug-ins scriptable building plug-ins building, platforms, and compilers building carbonized plug-ins for mac os x type libraries installing plug-ins native installers xpi plug-ins installations plug-in installation and the windows registry initialization and destruction initialization instance creation instance destruction shutdown initialize and shutdown example drawing and event handling the npwindow structure drawing plug-ins printing the plug-in setting the window ...
NPByteRange - Archive of obsolete content
syntax typedef struct _npbyterange { int32 offset; /* negative offset = from the end */ uint32 length; struct _npbyterange* next; } npbyterange; fields the data structure has the following fields: offset offset in bytes to the start of the requested range.
...the only plug-in api call that uses the npbyterange type is npn_requestread(), which lets the plug-in read specified parts of a file without downloading it.
NPIdentifier - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary npidentifier is an opaque type used for method and property identifiers, such as strings or integers.
... syntax typedef void *npidentifier; ...
NPN_GetValueForURL - Archive of obsolete content
syntax #include <npapi.h> typedef enum { npnurlvcookie = 501, npnurlvproxy } npnurlvariable; nperror npn_getvalueforurl(npp instance, npnurlvariable variable, const char *url, char **value, uint32_t *len); parameters this function has the following parameters: instance pointer to the current plug-in instance.
... variable selects the type of information to be retrieved (npnurlvcookie or npnurlvproxy) url the url for which to fetch information.
NPN_RequestRead - Archive of obsolete content
syntax #include <npapi.h> nperror npn_requestread(npstream* stream, npbyterange* rangelist); parameters the function has the following parameters: stream stream of type np_seek from which to read bytes.
...seekable streams are created by calling npp_newstream() with np_seek as the stype mode.
NPObject - Archive of obsolete content
npobject is the type used to express objects exposed by either the plugin or by the browser through this api.
... syntax struct npobject { npclass *_class; uint32_t referencecount; /* * additional space may be allocated here by types of npobjects */ }; fields _class a pointer to the npclass of which the object is a member.
NPP_New - Archive of obsolete content
syntax #include <npapi.h> nperror npp_new(npmimetype plugintype, npp instance, uint16 mode, int16 argc, char *argn[], char *argv[], npsaveddata *saved); parameters the function has the following parameters: plugintype pointer to the mime type for new plug-in instance.
...it is called after np_initialize and is passed the mime type, embedded or full-screen display mode, and, for embedded plug-ins, information about html embed arguments.
NPSetWindowCallbackStruct - Archive of obsolete content
syntax typedef struct { int32 type; display* display; visual* visual; colormap colormap; unsigned int depth; } npsetwindowcallbackstruct; fields the data structure has the following fields: type always contains np_setwindow.
...the type field of this structure always contains np_setwindow.
NPStream - Archive of obsolete content
syntax typedef struct _npstream { void* pdata; /* plug-in private data */ void* ndata; /* netscape private data */ const char* url; uint32 end; uint32 lastmodified; void* notifydata; const char *headers; } npstream; fields the data structure has the following fields: plug-in-private value that the plug-in can use to store a pointer to private data associated with the instance; not modified by the browser.
...this field is used only for http and is null for other types of streams.
Writing a plugin for Mac OS X - Archive of obsolete content
the plugin also communicates its bundle type in that file, under the key cfbundlepackagetype; the type is 'brpl'.
... if the type isn't an npapi plugin type, the bundle won't load as an npapi plugin.
Security Controls - Archive of obsolete content
there are three types of security controls, as follows: management controls: the security controls that focus on the management of risk and the management of information system security.
... all three types of controls are necessary for robust security.
Scratchpad - Archive of obsolete content
you'll see the autocomplete box, as shown below: the icon next to each suggestion indicates the type, and the currently highlighted suggestion gets a popup with more information.
...for example, if you type document.addeventlistener, then press ctrl + shift + space, you'll see a popup that shows a summary of the function's syntax and a short description: the "[docs]" link takes you to the mdn documentation for the symbol.
Developing cross-browser and cross-platform pages - Archive of obsolete content
the browser identification approach relies on functions that check the browser type string value and browser version string value and that search for certains characters or sub-strings in the navigator.useragent property string.
... function hideelement(id_attribute_value) { if (document.getelementbyid && document.getelementbyid(id_attribute_value) && document.getelementbyid(id_attribute_value).style ) { document.getelementbyid(id_attribute_value).style.visibility = "hidden"; }; } // example: // <button type="button" onclick="hideelement('d1');">hide div</button> // <div id="d1">some text</div> these repeated calls to document.getelementbyid are not the most efficient way to check for the existence of particular objects or features in the browser's dom implementation, but they serve to illustrate clearly how object support detection works.
-ms-accelerator - Archive of obsolete content
initial valuefalseapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete syntax /* the object is not a keyboard shortcut (the default) */ -ms-accelerator: false /* the object is a keyboard shortcut */ -ms-accelerator: true values false the object is not a keyboard shortcut.
... <!doctype html> <html> <head> <title>accelerator</title> </head> <body> <label for="oname"><u style="-ms-accelerator: true; accelerator: true">n</u>ame: </label> <input type="text" id="oname" size="25" accesskey="n" value="your name here" /> </body> </html> specifications not part of any specification.
-ms-content-zoom-snap-points - Archive of obsolete content
initial valuesnapinterval(0%, 100%)applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values snapinterval( <percentage>, <percentage> ) specifies where the snap-points will be placed.
... formal syntax snapinterval( <percentage>, <percentage> ) | snaplist( <percentage># ) examples this example demonstrates both types of values for the -ms-content-zoom-snap-points property.
-ms-hyphenate-limit-zone - Archive of obsolete content
initial value0applies toblock container elementsinheritedyespercentagescalculated with respect to the width of the line boxcomputed valueas specifiedanimation typediscrete syntax values <percentage> an integer followed by a percent sign (%), which specifies the width of the hyphenation zone, calculated with respect to the line box.
...for more information about supported length units, see css basic data types.
-ms-scroll-chaining - Archive of obsolete content
initial valuechainedapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values chained initial value.
... .imagecontainer { -ms-scroll-chaining: chained; -ms-overflow-style: none; -ms-content-zooming: zoom; -ms-scroll-rails: none; -ms-content-zoom-limit-min: 100%; -ms-content-zoom-limit-max: 500%; -ms-scroll-snap-type: proximity; -ms-scroll-snap-points-x: snaplist(100%, 200%, 300%, 400%, 500%); -ms-overflow-style: none; width: 480px; height: 270px; overflow: auto; } specifications not part of any specification.
-ms-scrollbar-3dlight-color - Archive of obsolete content
initial valuedepends on user agentapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values <color> the color of the top and left edges of the scroll box and scroll arrows of the scroll bar.
... code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/scrollbarcolor.htm <!doctype html> <html> <head> <title>scrollbar-3dlight-color</title> <style> .blue3dlight { -ms-scrollbar-3dlight-color: blue; scrollbar-3dlight-color: blue; /* use the standard when available.
-ms-scrollbar-darkshadow-color - Archive of obsolete content
initial valuethreeddarkshadowapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values <color> the color of the scroll bar's gutter.
... code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/scrollbarcolor.htm <!doctype html> <html> <head> <title>scrollbar-darkshadow-color</title> <style> .blueshadow { scrollbar-darkshadow-color: blue; } </style> </head> <body> <textarea class="blueshadow">the gutter elements in the scroll bar for this element will be blue.</textarea> </body> </html> specifications not part of any specification.
-ms-scrollbar-shadow-color - Archive of obsolete content
initial valuethreeddarkshadowapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values <color> the color of the bottom and right edges of the scroll box and scroll arrows of a scroll bar.
... <!doctype html> <html> <head> <title>scrollbar-shadow-color</title> <style> .blueshadow { scrollbar-shadow-color: blue; } </style> </head> <body> <textarea class="blueshadow">the gutter elements in the scroll bar for this element will be blue.</textarea> </body> </html> specifications not part of any specification.
::-ms-browse - Archive of obsolete content
the ::-ms-browse css pseudo-element is a microsoft extension that represents the button that opens the file picker of <input type="file">.
...g color cursor display (values block, inline-block, none) @font-face font-size font-style font-weight height margin-bottom margin-left margin-right margin-top opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin visibility width syntax ::-ms-browse example html <label>select image: <input type="file"></label> css input[type="file"]::-ms-browse { color: red; background-color: yellow; } result output example specifications not part of any specification.
display-inside - Archive of obsolete content
the display-inside css property specifies the inner display type of the box generated by an element, dictating how its contents lay out inside the box.
...if the element's computed <display-outside> value is an layout-specific internal type, this elements acts as normal for its given <display-outside> value.
E4X - Archive of obsolete content
ArchiveWebE4X
to fully enable e4x, the <script> element needs to have the mime type "text/javascript;e4x=1" (i.e., have an attribute of the form type="text/javascript;e4x=1").
... the difference between the two modes is that without the "e4x=1" mime type, any statement-level xml/html comment literals (<!--...-->) are ignored for backwards compatibility with the comment hiding trick, and cdata sections (<![cdata[...]]>) are not parsed as cdata literals (which leads to a js syntax error in html since html's <script> element produces an implicit cdata section, and therefore cannot contain explicit cdata sections).
Array.unobserve() - Archive of obsolete content
examples unobserving an array var arr = [1, 2, 3]; var observer = function(changes) { console.log(changes); } array.observe(arr, observer); ​ arr.push(4); // [{type: "splice", object: <arr>, index: 3, removed:[], addedcount: 1}] array.unobserve(arr, observer); arr.pop(); // the callback wasn't called using an anonymous function var persons = ['khalid', 'ahmed', 'mohammed']; array.observe(persons, function (changes) { console.log(changes); }); persons.shift(); // [{type: "splice", object: <arr>, index: 0, removed: [ "khalid" ], addedcount: 0 }] array...
....unobserve(persons, function (changes) { console.log(changes); }); persons.push('abdullah'); // [{type: "splice", object: <arr>, index: 2, removed: [], addedcount: 1 }] // the callback will always be called ...
ArrayBuffer.transfer() - Archive of obsolete content
if (!arraybuffer.transfer) { arraybuffer.transfer = function(source, length) { if (!(source instanceof arraybuffer)) throw new typeerror('source must be an instance of arraybuffer'); if (length <= source.bytelength) return source.slice(0, length); var sourceview = new uint8array(source), destview = new uint8array(new arraybuffer(length)); destview.set(sourceview); return destview.buffer; }; } specifications specification status comment a...
...rraybuffer.prototype.transfer proposal draft stage 2 draft ...
VBArray.dimensions - Archive of obsolete content
<head> <script type="text/vbscript"> <!-- function createvbarray() dim i, j, k dim a(2, 2) k = 1 for i = 0 to 2 for j = 0 to 2 a(j, i) = k k = k + 1 next next createvbarray = a end function --> </script> <script type="text/javascript"> <!-- function vbarraytest(vba) { var i; var a = new vbarray(vba); var s = ""; for (i = 1; i <= a.dimensions(); i++) { ...
... s += "the upper bound of dimension "; s += i + " is "; s += a.ubound(i); s += ".<br />"; } return(s); } --> </script> </head> <body> <script type="text/javascript"> document.write(vbarraytest(createvbarray())); </script> </body> requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, and internet explorer 10 standards.
VBArray.getItem - Archive of obsolete content
<head> <script type="text/vbscript"> <!-- function createvbarray() dim i, j, k dim a(2, 2) k = 1 for i = 0 to 2 for j = 0 to 2 a(i, j) = k document.writeln(k) k = k + 1 next document.writeln("<br>") next createvbarray = a end function --> </script> <script type="text/javascript"> <!-- function getitemtest(vbarray) { var i, j; var a = new vbarray(vb...
...array); for (i = 0; i <= 2; i++) { for (j =0; j <= 2; j++) { document.writeln(a.getitem(i, j)); } } } --> </script> </head> <body> <script type="text/javascript"> <!-- getitemtest(createvbarray()); --> </script> </body> requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, and internet explorer 10 standards.
VBArray.lbound - Archive of obsolete content
<head> <script type="text/vbscript"> <!-- function createvbarray() dim i, j, k dim a(2, 2) k = 1 for i = 0 to 2 for j = 0 to 2 a(j, i) = k k = k + 1 next next createvbarray = a end function --> </script> <script type="text/javascript"> <!-- function vbarraytest(vba){ var i; var a = new vbarray(vba); var s = ""; for (i = 1; i <= a.dimensions(); i++) { ...
... s += "the lower bound of dimension "; s += i + " is "; s += a.lbound(i); s += ".<br />"; } return (s); } --> </script> </head> <body> <script type="text/javascript"> document.write(vbarraytest(createvbarray())); </script> </body> requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, and internet explorer 10 standards.
VBArray.toArray - Archive of obsolete content
<head> <script type="text/vbscript"> <!-- function createvbarray() dim i, j, k dim a(2, 2) k = 1 for i = 0 to 2 for j = 0 to 2 a(j, i) = k document.writeln(k) k = k + 1 next document.writeln("<br>") next createvbarray = a end function --> </script> <script type="text/javascript"> <!-- function vbarraytest(vbarray) { var a = new vbarray(vbarray); v...
...ar b = a.toarray(); var i; for (i = 0; i < 9; i++) { document.writeln(b[i]); } } --> </script> </head> <body> <script type="text/javascript"> <!-- vbarraytest(createvbarray()); --> </script> </body> requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, and internet explorer 10 standards.
VBArray.ubound - Archive of obsolete content
<head> <script type="text/vbscript"> <!-- function createvbarray() dim i, j, k dim a(2, 2) k = 1 for i = 0 to 2 for j = 0 to 2 a(j, i) = k k = k + 1 next next createvbarray = a end function --> </script> <script type="text/javascript"> <!-- function vbarraytest(vba) { var i; var a = new vbarray(vba); var s = ""; for (i = 1; i <= a.dimensions(); i++) { ...
... s += "the upper bound of dimension "; s += i + " is "; s += a.ubound(i); s += ".<br />"; } return (s); } --> </script> </head> <body> <script type="text/javascript"> document.write(vbarraytest(createvbarray())); </script> </body> requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, and internet explorer 10 standards.
VBArray - Archive of obsolete content
<head> <script type="text/vbscript"> <!-- function createvbarray() dim i, j, k dim a(2, 2) k = 1 for i = 0 to 2 for j = 0 to 2 a(j, i) = k document.writeln(k) k = k + 1 next document.writeln("<br />") next createvbarray = a end function --> </script> <script type="text/javascript"> <!-- function vbarraytest(vbarray){ var a = new vbarray(vbarray); ...
...var b = a.toarray(); var i; for (i = 0; i < 9; i++) { document.writeln(b[i]); } } --> </script> </head> <body> <script type="text/javascript"> <!-- vbarraytest(createvbarray()); --> </script> </body> properties the vbarray object has no properties.
New in JavaScript 1.1 - Archive of obsolete content
--> new features in javascript 1.1 new objects array boolean function number new properties number.max_value number.min_value nan number.negative_infinity number.positive_infinity new methods array.prototype.join() array.prototype.reverse() array.prototype.sort() array.prototype.split() new operators typeof void other new features <noscript> liveconnect.
... constructor and prototype properties on objects added.
New in JavaScript 1.8 - Archive of obsolete content
using javascript 1.8 in order to use some of the new features of javascript 1.8 in html, use: <script type="application/javascript;version=1.8"> ...
... array.prototype.reduce() array.prototype.reduceright() changed functionality in javascript 1.8 changes in destructuring for..in one change that occurred in the release of javascript 1.8 was a bug fix related to the key/value destructuring of arrays introduced in javascript 1.7.
Object.unobserve() - Archive of obsolete content
examples unobserving an object var obj = { foo: 0, bar: 1 }; var observer = function(changes) { console.log(changes); } object.observe(obj, observer); ​ obj.newproperty = 2; // [{name: 'newproperty', object: <obj>, type: 'add'}] object.unobserve(obj, observer); obj.foo = 1; // the callback wasn't called using an anonymous function var person = { name: 'ahmed', age: 25 }; object.observe(person, function(changes) { console.log(changes); }); person.age = 40; // [{name: 'age', object: <obj>, oldvalue: 25, type: 'update'}] object.unobserve(person, function(changes) { console.log(changes); }); person.a...
...ge = 63; // [{name: 'age', object: <obj>, oldvalue: 40, type: 'update'}] // the callback will always be called specifications not part of any standard.
handler.enumerate() - Archive of obsolete content
interceptions this trap can intercept these operations: property enumeration / for...in: for (var name in proxy) {...} reflect.enumerate() invariants if the following invariants are violated, the proxy will throw a typeerror: the enumerate method must return an object.
... var p = new proxy({}, { enumerate(target) { return 1; } }); for (var x in p) {} // typeerror is thrown note: both examples make use of the shorthand syntax for method definitions.
Troubleshooting XForms Forms - Archive of obsolete content
troubleshooting check the file type is the page parsed as an xhtml document?
...the type field should say application/xhtml+xml.
RFE to the Custom Controls Interfaces - Archive of obsolete content
l as getting the various states of that node nsixformsdelegate - used to obtain the nsixformsaccessors interface nsixformsuiwidget - used by the xforms processor to update the value/state of an xforms element when its bound node's value/state is changed our current mechanism that allows authors to build custom controls assumes that the controls will be bound to instance nodes of simple content type.
...if you need to have a custom control that works with complext content or you find our interfaces too limiting to create the type of control that you have in mind, then this is the right place to pass along your requirements and any usecase that you are trying to solve.
XForms Repeat Element - Archive of obsolete content
attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control.
... number - isn't supported type restrictions the repeat element can be bound to a nodeset.
XForms Select1 Element - Archive of obsolete content
attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control.
... incremental - supported, default value is true properties selection - see corresponding attribute incremental - see corresponding attribute type restrictions the select1 element can be bound to a node containing simple content.
XForms Trigger Element - Archive of obsolete content
attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control accesskey - used to specify the keyboard shortcut for focusing this control single-node binding type restrictions the trigger element can be bound to a node containing data of any type.
...characteristics analogous widgets are <html:input type="button"/> and <xul:button/> link/clickable text xforms authors can use this representation if they want to have a widget like a xhtml anchor (xhtml only).
Using XForms and PHP - Archive of obsolete content
to do that, you need to use the header() php function: <?php header("content-type: application/xhtml+xml; charset=utf-8"); ...
... parsing submitted data depending on the submission type, you might get different data formats on the server side.
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
at the high level, there are two primary types of standards: procedural (how do we do it) vs.
... other standards it is also important to follow other types of standards across an organization.
Parsing microformats in JavaScript - Archive of obsolete content
propertyvalue = microformats.parser.defaultgetter(propnode, parentnode, datatype); parameters propnode the dom node to check.
... datatype "html" if the search should be done using innerhtml(), or "text" to use innertext().
bootstrap.js - Extensions
function startup(data, reason) { /// bootstrap data structure @see /docs/extensions/bootstrapped_extensions#bootstrap_data /// string id /// string version /// nsifile installpath /// nsiuri resourceuri /// /// reason types: /// app_startup /// addon_enable /// addon_install /// addon_upgrade /// addon_downgrade } function shutdown(data, reason) { /// bootstrap data structure @see /docs/extensions/bootstrapped_extensions#bootstrap_data /// string id /// string version /// nsifile installpath /// nsiuri resourceuri /// /// reason types: /// app...
..._shutdown /// addon_disable /// addon_uninstall /// addon_upgrade /// addon_downgrade } function install(data, reason) { /// bootstrap data structure @see /docs/extensions/bootstrapped_extensions#bootstrap_data /// string id /// string version /// nsifile installpath /// nsiuri resourceuri /// /// reason types: /// addon_install /// addon_upgrade /// addon_downgrade } function uninstall(data, reason) { /// bootstrap data structure @see /docs/extensions/bootstrapped_extensions#bootstrap_data /// string id /// string version /// nsifile installpath /// nsiuri resourceuri /// /// reason types: /// addon_uninstall /// addon_upgrade /// addon_downgrade } ...
Anatomy of a video game - Game development
imagine that you are developing a "find the differences between these two similar pictures"-type game.
...you may have multiple components driven by multiple different types of events.
Explaining basic 3D theory - Game development
objects different types of objects are built using vertices.
...the standard phong lighting model implemented in webgl has four basic types of lighting: diffuse: a distant directional light, like the sun.
Building up a basic demo with Babylon.js - Game development
html structure here's the html structure we will use: <!doctype html> <html> <head> <meta charset="utf-8"> <title>mdn games: babylon.js demo</title> <style> html,body,canvas { margin: 0; padding: 0; width: 100%; height: 100%; font-size: 0; } </style> </head> <body> <script src="babylon.js"></script> <canvas id="render-canvas"></canvas> <script> var canvas = document.getelementbyid("render-canvas"); /* all our javascript code go...
...there are many types of materials that can be used, but for now the standard one should be enough for us.
Audio for Web games - Game development
music is an important part of the gaming experience and depending on the type of game you are making you may wish to invest significant effort into getting it right.
...music is an important part of the gaming experience and depending on the type of game you are making you may wish to invest significant effort into getting it right.
Gecko FAQ - Gecko Redirect 1
gecko also offers the ability to parse various document types (html, xml, svg, etc), advanced rendering capabilities including compositing and transformations, and support for embedded javascript and plugins.
... xml 1.0: full support, except for processing to manipulate default attributes rdf: full support, except for abouteach, abouteachprefix, and parsetype javascript 1.5, including ecma-262 edition 3 (ecmascript) compliance, except for date.todatestring and date.totimestring, which are not implemented transfer protocols: http 1.1 (including gzip compression), ftp ssl unicode oji (open java interface) image formats png gif jpeg, pjpeg does "full support" mean that gecko has zero bugs today or will have zero bugs at some poin...
Boolean - MDN Web Docs Glossary: Definitions of Web-related terms
in computer science, a boolean is a logical data type that can have only the values true or false.
... learn more general knowledge boolean on wikipedia technical reference the javascript global object: boolean javascript data types and data structures ...
DoS attack - MDN Web Docs Glossary: Definitions of Web-related terms
types of dos attack dos attacks are more of a category than a particular kind of attack.
... here is a non-exhaustive list of dos attack types: bandwidth attack service request flood syn flooding attack icmp flood attack peer-to-peer attack permanent dos attack application level flood attack learn more denial-of-service attack on wikipedia denial-of-service on owasp ddos ...
Denial of Service - MDN Web Docs Glossary: Definitions of Web-related terms
types of dos attack dos attacks are more of a category than a particular kind of attack.
... here is a non-exhaustive list of dos attack types: bandwidth attack service request flood syn flooding attack icmp flood attack peer-to-peer attack permanent dos attack application level flood attack learn more denial-of-service attack on wikipedia denial-of-service on owasp ddos ...
Distributed Denial of Service - MDN Web Docs Glossary: Definitions of Web-related terms
there are two types of ddos attacks: a network-centric attack (which overloads a service by using up bandwidth) and an application-layer attack (which overloads a service or database with application calls).
... the united states computer emergency readiness team (us-cert) defines symptoms of denial-of-service attacks to include: unusually slow network performance (opening files or accessing websites) unavailability of a particular website inability to access any website dramatic increase in the number of spam emails received—(this type of dos attack is considered an email bomb) disconnection of a wireless or wired internet connection longterm denial of access to the web or any internet services learn more general knowledge denial-of-service attack on wikipedia ...
Dynamic typing - MDN Web Docs Glossary: Definitions of Web-related terms
dynamically-typed languages are those (like javascript) where the interpreter assigns variables a type at runtime based on the variable's value at the time.
... learn more learn about it javascript data types and data structures general knowledge type system on wikipedia ...
Function - MDN Web Docs Glossary: Definitions of Web-related terms
different types of functions an anonymous function is a function without a function name.
... only function expressions can be anonymous, function declarations must have a name: // when used as a function expression (function () {}); // or using the ecmascript 2015 arrow notation () => {}; the following terms are not used in the ecmascript language specification, they're jargon used to refer to different types of functions.
Hoisting - MDN Web Docs Glossary: Definitions of Web-related terms
instead, the variable and function declarations are put into memory during the compile phase, but stay exactly where you typed them in your code.
... hoisting works well with other data types and variables.
JSON - MDN Web Docs Glossary: Definitions of Web-related terms
json does not natively represent more complex data types like functions, regular expressions, dates, and so on.
... (date objects by default serialize to a string containing the date in iso format, so the information isn't completely lost.) if you need json to represent additional data types, transform values as they are serialized or before they are deserialized.
mime - MDN Web Docs Glossary: Definitions of Web-related terms
initially used for e-mail attachments, it has become the de facto standard to define types of documents anywhere.
... see also mime-type learn more general knowledge mime on wikipedia ...
Media (CSS) - MDN Web Docs Glossary: Definitions of Web-related terms
typically, this is a screen—but it may also be a printer, a speech synthesizer, braille display, or another type of device.
... css offers several features that allow you to tweak your document's styles—or even offer different styles—according to the media type (such as screen or print, to name two) or media capabilities (such as width, resolution, or other values) of the viewer's device.
Polymorphism - MDN Web Docs Glossary: Definitions of Web-related terms
polymorphism is the presentation of one interface for multiple data types.
... for example, integers, floats, and doubles are implicitly polymorphic: regardless of their different types, they can all be added, subtracted, multiplied, and so on.
Semantics - MDN Web Docs Glossary: Definitions of Web-related terms
semantics in css in css, consider styling a list with li elements representing different types of fruits.
...arkup are as follows: search engines will consider its contents as important keywords to influence the page's search rankings (see seo) screen readers can use it as a signpost to help visually impaired users navigate a page finding blocks of meaningful code is significantly easier than searching though endless divs with or without semantic or namespaced classes suggests to the developer the type of data that will be populated semantic naming mirrors proper custom element/component naming when approaching which markup to use, ask yourself, "what element(s) best describe/represent the data that i'm going to populate?" for example, is it a list of data?; ordered, unordered?; is it an article with sections and an aside of related information?; does it list out definitions?; is it a figure...
CSS and JavaScript accessibility best practices - Learn web development
form elements elements to allow users to input data into websites: <div> <label for="name">enter your name</label> <input type="text" id="name" name="name"> </div> you can see some good example css in our form-css.html example (see it live also).
...we've used <label> elements to make sure the form labels are unambiguously linked to their inputs, so screen readers can read them out alongside: <label for="name">enter your name:</label> <input type="text" name="name" id="name"> we only do the validation when the form is submitted — this is so that we don't update the ui too often and potentially confuse screen reader (and possibly other) users: form.onsubmit = validate; function validate(e) { errorlist.innerhtml = ''; for(let i = 0; i < formitems.length; i++) { const testitem = formitems[i]; if(testitem.input.value === '') ...
Backgrounds and borders - Learn web development
you can read more about the different types of gradients and things you can do with them on the mdn page for the <gradient> data type.
... previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Responsive design - Learn web development
media queries enable the type of layout switch that cameron adams had previously explored using javascript, using only css.
... html { font-size: 1em; } h1 { font-size: 2rem; } @media (min-width: 1200px) { h1 { font-size: 4rem; } } we have edited our responsive grid example above to also include responsive type using the method outlined.
Supporting older browsers - Learn web development
you should also consider the type of devices and the way people use your site, for example, you may expect a higher than an average number of mobile devices.
... the ie10 and 11 prefixed version of grid the css grid specification was initially prototyped in internet explorer 10; this means that while ie10 and ie11 do not have modern grid support, they do have a version of grid layout that is very usable, although different to the modern specification documented on this site.
What is a URL? - Learn web development
deeper dive basics: anatomy of a url here are some examples of urls: https://developer.mozilla.org https://developer.mozilla.org/docs/learn/ https://developer.mozilla.org/search?q=url any of those urls can be typed into your browser's address bar to tell it to load the associated page (resource).
... how to use urls any url can be typed right inside the browser's address bar to get to the resource behind it.
Test your skills: HTML5 controls - Learn web development
this aim of this skill test is to assess whether you've understood our the html5 input types article.
... html5 controls 1 first let's explore some of the new html5 input types.
Example - Learn web development
a simple form html content <form action="/my-handling-form-page" method="post"> <div> <label for="name">name:</label> <input type="text" id="name" name="user_name"> </div> <div> <label for="mail">e-mail:</label> <input type="email" id="mail" name="user_email"> </div> <div> <label for="msg">message:</label> <textarea id="msg" name="user_message"></textarea> </div> <div class="button"> <button type="submit">send your message</button> </div> </form> css content form { /* just to center the form on the page */ margin: 0 auto; width: 400px; /* to see the limits of the form */ padding: 1em; border: 1px solid #ccc; border-radius: 1em; } div + div { margin-top: ...
...width: 300px; -moz-box-sizing: border-box; box-sizing: border-box; /* to harmonize the look & feel of text field border */ border: 1px solid #999; } input:focus, textarea:focus { /* to give a little highligh on active elements */ border-color: #000; } textarea { /* to properly align multiline text field with their label */ vertical-align: top; /* to give enough room to type some text */ height: 5em; /* to allow users to resize any textarea vertically it works only on chrome, firefox and safari */ resize: vertical; } .button { /* to position the buttons to the same position of the text fields */ padding-left: 90px; /* same size as the label elements */ } button { /* this extra magin represent the same space as the space between the labels and...
Web forms — Working with user data - Learn web development
the different form controls basic native form controls we start off this section by looking at the functionality of the the original html <input> types in detail, looking at what options are available to collect different types of data.
... the html5 input types here we continue our deep dive into the <input> element, looking at the additional input types provided when html5 was released, and the various ui controls and data collection enhancements they provide.
JavaScript basics - Learn web development
ring a variable, you can give it a value: myvariable = 'bob'; also, you can do both these operations on the same line: let myvariable = 'bob'; you retrieve the value by calling the variable name: myvariable; after assigning a value to a variable, you can change it later in the code: let myvariable = 'bob'; myvariable = 'steve'; note that variables may hold values that have different data types: variable explanation example string this is a sequence of text known as a string.
... note: mixing data types can lead to some strange results when performing calculations.
Debugging HTML - Learn web development
well, generally when you do something wrong in code, there are two main types of error that you'll come across: syntax errors: these are spelling errors in your code that actually cause the program not to run, like the rust error shown above.
... you will know when all your errors are fixed when you see the following banner in your output: summary so there we have it, an introduction to debugging html, which should give you some useful skills to count on when you start to debug css, javascript, and other types of code later on in your career.
Document and website structure - Learn web development
<!doctype html> <html> <head> <meta charset="utf-8"> <title>my page title</title> <link href="https://fonts.googleapis.com/css?family=open+sans+condensed:300|sonsie+one" rel="stylesheet" type="text/css"> <link rel="stylesheet" href="style.css"> <!-- the below three lines are a fix to get html5 semantic elements working in old versions of internet explorer--> <!--[if lt ie 9]> ...
...--> <form> <input type="search" name="q" placeholder="search query"> <input type="submit" value="go!"> </form> </nav> <!-- here is our page's main content --> <main> <!-- it contains an article --> <article> <h2>article heading</h2> <p>lorem ipsum dolor sit amet, consectetur adipisicing elit.
Marking up a letter - Learn web development
block/structural semantics use appropriate document structure including doctype, and <html>, <head> and <body> elements.
... use an appropriate list type to mark up the semester start dates, study subjects, and exotic dances.
Adding vector graphics to the Web - Learn web development
on the web, you'll work with two types of image — raster images, and vector images: raster images are defined using a grid of pixels — a raster image file contains information showing exactly where each pixel is to be placed, and exactly what color it should be.
... </text> </svg> </textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution" disabled> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); c...
Multimedia and Embedding - Learn web development
images in html there are other types of multimedia to consider, but it is logical to start with the humble <img> element used to embed a simple image in a webpage.
... from <object> to <iframe> — other embedding technologies at this point we'd like to take somewhat of a sideways step, looking at a couple of elements that allow you to embed a wide variety of content types into your webpages: the <iframe>, <embed> and <object> elements.
HTML table basics - Learn web development
LearnHTMLTablesBasics
a table allows you to quickly and easily look up values that indicate some kind of connection between different types of data, for example a person and their age, or a day of the week, or the timetable for a local swimming pool.
... adding headers with <th> elements now let's turn our attention to table headers — special cells that go at the start of a row or column and define the type of data that row or column contains (as an example, see the "person" and "age" cells in the first example shown in this article).
Making asynchronous programming easier with async and await - Learn web development
converting this to async/await (see live demo and source code), this now looks like so: async function fetchanddecode(url, type) { let response = await fetch(url); let content; if (!response.ok) { throw new error(`http error!
... status: ${response.status}`); } else { if(type === 'blob') { content = await response.blob(); } else if(type === 'text') { content = await response.text(); } return content; } } async function displaycontent() { let coffee = fetchanddecode('coffee.jpg', 'blob'); let tea = fetchanddecode('tea.jpg', 'blob'); let description = fetchanddecode('description.txt', 'text'); let values = await promise.all([coffee, tea, description]); let objecturl1 = url.createobjecturl(values[0]); let objecturl2 = url.createobjecturl(values[1]); let desctext = values[2]; let image1 = document.createelement('img'); let image2 = document.createelement('img'); image1.src = objecturl1; image2.src = objecturl2; document.body.appendchild(image1); document.body...
Choosing the right approach - Learn web development
single delayed operation repeating operation multiple sequential operations multiple simultaneous operations no yes (recursive callbacks) yes (nested callbacks) no code example an example that loads a resource via the xmlhttprequest api (run it live, and see the source): function loadasset(url, type, callback) { let xhr = new xmlhttprequest(); xhr.open('get', url); xhr.responsetype = type; xhr.onload = function() { callback(xhr.response); }; xhr.send(); } function displayimage(blob) { let objecturl = url.createobjecturl(blob); let image = document.createelement('img'); image.src = objecturl; document.body.appendchild(image); } loadasset('coffee.jpg', 'blob', disp...
...e delayed operation repeating operation multiple sequential operations multiple simultaneous operations no no no yes code example the following example fetches several resources from the server, and uses promise.all() to wait for all of them to be available before then displaying all of them — see it live, and see the source code: function fetchanddecode(url, type) { // returning the top level promise, so the result of the entire chain is returned out of the function return fetch(url).then(response => { // depending on what type of file is being fetched, use the relevant function to decode its contents if(type === 'blob') { return response.blob(); } else if(type === 'text') { return response.text(); } }) .catch(e => { ...
Test your skills: Loops - Learn web development
you should use a type of loop that you've not used in the previous task.
... you should use a type of loop that you've not used in the previous two tasks.
JavaScript building blocks - Learn web development
in this module, we continue our coverage of all javascript's key fundamental features, turning our attention to commonly-encountered types of code blocks such as conditional statements, loops, functions, and events.
...functions allow you to store a piece of code that does a single task inside a defined block, and then call that code whenever you need it using a single short command — rather than having to type out the same code multiple times.
Test your skills: Math - Learn web development
check the data type of finalresult using typeof; you'll probably see that it is actually of string type!
... write a line of code that converts it to a number type, storing the result in a variable called finalnumber.
Test your skills: Object-oriented JavaScript - Learn web development
the aim of this skill test is to assess whether you've understood our object-oriented javascript for beginners, object prototypes, and inheritance in javascript articles.
...we want you to: add a new method to the shape class's prototype, calcperimeter(), which calculates its perimeter (the length of the shape's outer edge) and logs the result to the console.
Introducing JavaScript objects - Learn web development
object prototypes prototypes are the mechanism by which javascript objects inherit features from one another, and they work differently to inheritance mechanisms in classical object-oriented programming languages.
... in this article, we explore that difference, explain how prototype chains work, and look at how the prototype property can be used to add methods to existing constructors.
Routing in Ember - Learn web development
it contains the following contents: import emberrouter from '@ember/routing/router'; import config from './config/environment'; export default class router extends emberrouter { location = config.locationtype; rooturl = config.rooturl; } router.map(function() { this.route('completed'); this.route('active'); }); the highlighted lines were added when the 2nd and 3rd commands above were run.
... 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 svelte deployment and next steps ...
Accessibility in React - Learn web development
the textbox <input> in your editing template should be updated like this: <input id={props.id} classname="todo-text" type="text" value={newname} onchange={handlechange} ref={editfieldref} /> the "edit" button in your view template should read like this: <button type="button" classname="btn" onclick={() => setediting(true)} ref={editbuttonref} > edit <span classname="visually-hidden">{props.name}</span> </button> focusing on our refs with useeffect to use our refs for their intended purpose, we ne...
... 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 svelte deployment and next steps ...
Using Vue computed properties - Learn web development
<input type="checkbox" class="checkbox" :id="id" :checked="isdone" @change="$emit('checkbox-changed')" /> since all we need to do is emit that the checkbox was checked, we can include the $emit() inline.
... 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 svelte deployment and next steps ...
Cross browser testing - Learn web development
what users, browsers, and devices do you most need to worry about?), how to go about doing testing, the main issues that you'll face with different types of code and how to mitigate them, what tools are most useful in helping you test and fix problems, and how to use automation to speed up testing.
... guides introduction to cross browser testing this article starts the module off by providing an overview of the topic of cross browser testing, answering questions such as "what is cross browser testing?", "what are the most common types of problems you'll encounter?", and "what are the main approaches for testing, identifying, and fixing problems?" strategies for carrying out testing next, we drill down into carrying out testing, looking at identifying a target audience (e.g.
Accessibility Features in Firefox
bookmarks can have a keyword assigned to them which can be typed into the address bar to bring up the bookmark.
...it also assists users of input aids because there are far fewer keys to type to get the desired location.
Mozilla’s UAAG evaluation report
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, :after, content: p(oor) 8.2 conform to specifications.
...(p2) p dom inspector provides a type of outline view, although it is not intended for end users page info (ctrl+i) gives lists of links, media, forms/elements can use a user style sheet to implement an outline bug 127030 has been filed for an outline view.
Add-ons
among other things, an add-on could: change the appearance or content of particular websites modify the firefox user interface add new features to firefox there are several types of add-ons, but the most common type are extensions.
... other types of add-ons in addition to extensions, there are a few other add-on types that allow users to customize firefox.
Adding a new CSS property
but don't use nsstylecoord if you only need a single type that nsstylecoord provides.
... (we should also make this part of adding properties much more automated and make the code smaller.) animation if the existing animation behaviors in nsstyleanimation aren't sufficient for how this new property is interpolated (as its specification should describe), then you'll need to implement a new behavior type in nsstyleanimation and reference it from nscssproplist.h.
Creating MozSearch plugins
h plugin for searching using yahoo!: <searchplugin xmlns="http://www.mozilla.org/2006/browser/search/"> <shortname>yahoo</shortname> <description>yahoo search</description> <inputencoding>utf-8</inputencoding> <image width="16" height="16">data:image/x-icon;base64,r0lgodlheaaqajecap8aaaaaap///waaach5baeaaaialaaaaaaqabaaaaipli+py+0nogquybdened2khkffwuamezmpzsfmaihphrrguum/ft+uwaaow==</image> <url type="application/x-suggestions+json" method="get" template="http://ff.search.yahoo.com/gossip?output=fxjson&amp;command={searchterms}" /> <url type="text/html" method="get" template="http://search.yahoo.com/search"> <param name="p" value="{searchterms}"/> <param name="ei" value="utf-8"/> <mozparam name="fr" condition="pref" pref="yahoo-fr" /> </url> <searchform>http://search.yahoo.com/</s...
...bia%2bcuotgaccued3tdqn75d4xmavcok9armhbzaw0aecibhkalc0mdy7x9abna3obazxiaa6ikecglmvqhwwyjyul2d4v2cpg8vzswx7ghyaaak7aoif7saboqcmn4ha3ahfsidtgpq%2fvlz8p4mskj2w9h8ggbjevxvhdo4fquqg%2fkdypqcg4h8luiacnq%2fsobmyi8basajfpcj1aaeejwvqqlpabxmh5bjjqi0gi9dtaagdbbccavlkgmq7ykczxpcqxquzhaeccj4xgml493ug21zd%2badaxh0wlm4a9mzpxjkjiiawtar5pqmalacabquulttbgccagcnnzgabbgamj5thwgvjlaaaaabjru5erkjggg%3d%3d</image> <url type="text/html" method="get" template="http://developer.mozilla.org/en/docs/special:search?search={searchterms}"/> <searchform>http://developer.mozilla.org/en/docs/special:search</searchform> </searchplugin> notice in this case that instead of using <param> to define parameters to the search engine, they're simply embedded inside the template url.
Configuring Build Options
mozconfig contains two types of options: options prefixed with mk_add_options are passed to client.mk.
...some extensions are not compatible with all apps, for example: cookie is not compatible with thunderbird typeaheadfind is not compatible with any toolkit app (firefox, thunderbird) unless you know which extensions are compatible with which apps, do not use the --enable-extensions option; the build system will automatically select the proper default set of extensions.
Installing headers using EXPORTS
for xpidl-generated headers, you may also set xpidl_module to determine which typelib file is produced from the idl files.
... the distinction between xpidl_module and module is that each directory with idl files must have a unique typelib file, but several directories may export headers to the same location.
Creating Custom Events That Can Pass Data
you will find that there is a bunch of code like: if (aeventtype.lowercaseequalsliteral("{somethingsomething}event")) return ns_{somethingsomething}event(adomevent, aprescontext, nsnull); you can either have a function like this or write the code straight in nseventlistenermanager::createevent() like this: if (aeventtype.lowercaseequalsliteral("nsmyevent")){ //note: the lowercase is important!
...you can find the prototypes for the function in nsiprivatedomevent.
Interface Compatibility
js-ctypes is the recommended way for extensions to call into os or third-party native code.
... you should strongly consider migrating existing code to use js-ctypes instead of binary components.
Commenting IDL for better documentation
if an interface is used as a parameter or as the type of the value returned by a method, please use the full name of the interface in the description of the method.
... */ const integer cookie_flavor_double_chocolate = 4; /** * an unknown type of cookie.
Obsolete Build Caveats and Tips
if you're using visual studio, go to project properties > c/c++ > language > treat wchar_t as built-in type and set it to "yes".
... if you are building mozilla source code from before firefox 5, then you must first select the mozilla application that you want to build (see below), and you will probably also need to set at least some of the other basic configuration options (such as whether to build a debug build or not) to get the type of build that you need.
SVG Guidelines
you shouldn't include doctypes in your svgs either; they are a source of many issues, and the svg wg recommends not to include them.
...here are some commonly seen examples: style="display: none;" on <defs> elements (a <defs> element is hidden by default) type="text/css" on <style> elements stroke: none or stroke-width: 0 svg grouping style grouping group similarly styled shapes under one <g> tag; this avoids having to set the same class/styles on many shapes.
Message manager overview
this article describes the different types of message manager, how to access them, and at a high level, what sorts of things you can use them for.
... communicate with frame scripts using message-passing apis there are various types of frame message managers, as depicted in this diagram: this diagram shows the setup when there are 2 browser windows open, one with 2 tabs open and one with 1 tab open.
HTMLIFrameElement.getScreenshot()
syntax var instanceofdomrequest = instanceofhtmliframeelement.getscreenshot(maxwidth, maxheight, mimetype); returns a domrequest for handling the screenshot request.
... mimetype optional a mime type specifying the format of the image to be returned; if not specified, the default used is image/jpeg.
mozbrowserclose
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 event target (the topmost target in the dom tree).
... type read only domstring the type of event.
mozbrowsercontextmenu
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.
...its properties are as follows: type a domstring representing the type of context menu displayed.
mozbrowserdocumentfirstpaint
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 event target (the topmost target in the dom tree).
... type read only domstring the type of event.
mozbrowserfirstpaint
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 event target (the topmost target in the dom tree).
... type read only domstring the type of event.
mozbrowserloadstart
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 event target (the topmost target in the dom tree).
... type read only domstring the type of event.
mozbrowseropensearch
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.
HTMLIFrameElement.sendMouseEvent()
syntax instanceofhtmliframeelement.sendmouseevent(type, x, y, button, clickcount, modifiers); returns void.
... parameters type a string representing the event type.
HTMLIFrameElement.sendTouchEvent()
syntax instanceofhtmliframeelement.sendtouchevent(type, x, y, rx, ry, rotationangles, forces, count, modifiers); returns void.
... parameters type a string representing the event type.
overflow-clip-box
/* keyword values */ overflow-clip-box: padding-box; overflow-clip-box: content-box; /* two values */ overflow-clip-box: padding-box content-box; overflow-clip-box: content-box content-box; /* global values */ overflow-clip-box: inherit; overflow-clip-box: initial; overflow-clip-box: unset; note: on gecko, by default, padding-box is used everywhere, but <input type="text"> and similar use the value content-box.
... initial valuepadding-boxapplies toall elementsinheritednomediavisualcomputed valueas specifiedanimation typediscretecanonical orderthe unique non-ambiguous order defined by the formal grammar syntax values padding-box this keyword makes the clipping be related to the padding box.
MozScrolledAreaChanged
specification mozilla specific interface uievent bubbles yes cancelable yes target defaultview, document default action none properties property type description targetread only eventtarget the event target (the topmost target in the dom tree).
... typeread only domstring the type of event.
smartcard-insert
the smartcard-insert event is fired when the insertion of a smart card has been detected specification mozilla specific interface event bubbles no cancelable no target document default action none properties property type description targetread only eventtarget the event target (the topmost target in the dom tree).
... typeread only domstring the type of event.
smartcard-remove
specification mozilla specific interface event bubbles no cancelable no target document default action none properties property type description targetread only eventtarget the event target (the topmost target in the dom tree).
... typeread only domstring the type of event.
Embedding the editor
this type of embedding requires that the composer code is agnostic to where its ui is coming from; communication between the core editor and the ui needs to go through one or more interfaces that insulate the editor from its host application.
...it is likely that we'd use xbl to implement this type of widget, as is the plan for other form controls.
Internationalized Domain Names (IDN) Support in Mozilla Browsers
during the discussion phase of the idn protocols development, there were some competing ascii-compatible encoding (ace) schemes proposed but an agreement was reached eventually to standardize on a type of ace called "punycode".
...if you find idn test sites under the .com and .net top domains, and if you cannot successfully access these sites, you can use the following workaround until the conversion to punycode is completed for these top domains: using netscape 7.1 or mozilla 1.4: type about:config into the location/url bar.
AddonInstall
method overview void install() void cancel() void addlistener(in installlistener listener) void removelistener(in installlistener listener) properties attribute type description name string the name of the add-on being installed.
... type string the type of the add-on being installed.
AddonUpdateChecker
/gre/modules/addonupdatechecker.jsm"); method overview updateinfo getcompatibilityupdate(in updateinfo updates[], in string version, in boolean ignorecompatibility, in string appversion, in string platformversion) updateinfo getnewestcompatibleupdate(in updateinfo updates[], in string appversion, in string platformversion) void checkforupdates(in string id, in string type, in string updatekey, string url, in updatechecklistener listener) constants constant description error_timeout the update check timed out.
... void checkforupdates( in string id, in string type, in string updatekey, string url, in updatechecklistener listener ) parameters id the id of the add-on being checked for updates type the type of add-on being checked for updates updatekey an optional update key for the add-on url the url of the add-on's update manifest listener an observer to notify of results ...
Add-on Manager
the apis are designed to be generic and support many different types of add-ons.
...tartupchanges(addonmanager.startup_change_disabled); if (addonids.length > 0) { // addonids is now an array of the add-on ids that have been disabled alert("note: " + addonids.length + " add-ons have been disabled."); } open add-on manager tab the add-on manager tab can be opened programatically with the function browseropenaddonsmgr which is available on chrome window of "navigator:browser" type.
Add-on Repository
/modules/addonrepository.jsm"); method overview string getrecommendedurl() string getsearchurl(in string searchterms) void cancelsearch() void retrieverecommendedaddons(in integer maxresults, in searchcallback callback) void searchaddons(in string searchterms, in integer maxresults, in searchcallback callback) properties property type description homepageurl string the url of the repository site's home page.
...the results will match what you would get if you typed this string in the search box on the amo web site.
Dict.jsm
ource://gre/modules/dict.jsm"); creating a dictionary you can create a new, empty dictionary by simply calling the dict() constructor: var newdict = new dict(); if you wish, you may also pass in an object literal of key/value pairs with which to initialize the dictionary: var someobj = {}; var newdict = new dict({key1: "foo", key2: someobj}); note that values may be any javascript object type.
... method overview dict copy(); boolean del(string akey); object get(string akey, [optional] object adefault); boolean has(string akey); array listitems(); array listkeys(); array listvalues(); void set(string akey, object avalue); string tojson(); string tostring(); properties attribute type description count number the number of items in the dictionary.
NetUtil.jsm
m asource, nsioutputstream asink, [optional] acallback) void asyncfetch(asource, acallback) nsichannel newchannel(awhattoload, [optional] aorigincharset, [optional] nsiuri abaseuri) nsiuri newuri(atarget, [optional] aorigincharset, [optional] nsiuri abaseuri) string readinputstreamtostring(ainputstream, acount, aoptions) attributes attribute type description ioservice nsiioservice returns a reference to nsiioservice.
... get("tmpd", ci.nsifile); file.append("test-file.tmp"); file.createunique(ci.nsifile.normal_file_type, 0666); // then, we need an output stream to our output file.
PopupNotifications.jsm
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.
... id a unique id string for the type of notification being displayed.
Deferred
esolve(); else deferred.reject(); }); return deferred.promise; would be return new promise(function(resolve, reject) { dosomething(function cb(good) { if (good) resolve(); else reject(); }); }); method overview void resolve([optional] avalue); void reject([optional] areason); properties attribute type description promise read only promise a newly created promise, initially in the pending state.
... function deferred() { // update 062115 for typeof if (typeof(promise) != 'undefined' && promise.defer) { //need import of promise.jsm for example: cu.import('resource:/gree/modules/promise.jsm'); return promise.defer(); } else if (typeof(promiseutils) != 'undefined' && promiseutils.defer) { //need import of promiseutils.jsm for example: cu.import('resource:/gree/modules/promiseutils.jsm'); return promiseutils.defer(); } else { /*...
Task.jsm
method overview function async(atask); promise spawn(atask); properties attribute type description result read only constructor constructs a special exception that, when thrown inside a legacy generator function, allows the associated task to be resolved with a specific value.
... promise spawn( atask ); parameters atask this parameter accepts different data types: if you specify a generator function, it is called with no arguments to retrieve the associated iterator.
Using JavaScript code modules
creating a javascript code module a very simple javascript module looks like this: var exported_symbols = ["foo", "bar"]; function foo() { return "foo"; } var bar = { name : "bar", size : 3 }; var dummy = "dummy"; notice that the module uses normal javascript to create functions, objects, constants, and any other javascript type.
... scope 1: components.utils.import("resource://app/my_module.jsm"); bar = "foo"; alert(bar); // displays "foo" scope 2: components.utils.import("resource://app/my_module.jsm"); alert(bar); // displays "[object object]" the main effect of the by-value copy is that global variables of simple types won't be shared across scopes.
JavaScript code modules
ctypes.jsm provides an interface that allows javascript code to call native libraries without requiring the development of an xpcom component.
... jni.jsm abstracts the js-ctypes to provide an interface that allows javascript code to call code running in native jvms.
Index
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.
... 38 localization formats there are 4 main approaches to web l10n with regards to the choice of technology used for localization logic: 39 setting up the infrastructure apache, infrastructure, localization, php, svn, unix first, make your project's file type decision (see localization formats for details): 40 what every mozilla translator should know internationalization, localization l10n stands for localization = l + another 10 letters + n 41 writing localizable code internationalization, localization this page tells you about best practices and guidelines when dealing with ui code with respect to localizat...
Localization content best practices
however, linguistically these are different types of sentences and will be handled differently in other languages.
...there are two types of languages, those that have yes/no as a single word, and those that don't and work on mirroring the verb.
Localization quick start guide
note: this guide is written for two types of contributors: those starting a new localization and those joining an existing localization.
... it is important to know which information applies to which type of contributor.
Localization formats
there are 4 main approaches to web l10n with regards to the choice of technology used for localization logic: html/php .lang gettext (.po) wiki (tbd) the choice of the filetype depends on a couple of factors: how much content is there to be localized?
... wiki blogging, documentation, and other types of mozilla content often surface as wikis.
MathML In Action
next to it is this tiny formula, det | a c b d | = a d - b c , which can also be typeset in displaystyle as det | a b c d | = a d - b c .
... mathematical typesetting is picky.
Mozilla Quirks Mode Behavior
use box-sizing:border-box for most input types and textarea.
... (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.
DMD
ry/replace/dmd/dmd.cpp:1286) #02: malloc (/home/njn/moz/mi5/go64dmd/memory/build/../../../memory/build/replace_malloc.c:153) #03: moz_xmalloc (/home/njn/moz/mi5/memory/mozalloc/mozalloc.cpp:84) #04: nscyclecollectingautorefcnt::incr(void*, nscyclecollectionparticipant*) (/home/njn/moz/mi5/go64dmd/dom/xul/../../dist/include/nsisupportsimpl.h:250) #05: nsxulelement::create(nsxulprototypeelement*, nsidocument*, bool, bool,mozilla::dom::element**) (/home/njn/moz/mi5/dom/xul/nsxulelement.cpp:287) #06: nsxblcontentsink::createelement(char16_t const**, unsigned int, mozilla::dom::nodeinfo*, unsigned int, nsicontent**, bool*, mozilla::dom::fromparser) (/home/njn/moz/mi5/dom/xbl/nsxblcontentsink.cpp:874) #07: nscomptr<nsicontent>::startassignment() (/home/njn/moz/mi5/go64dmd/dom...
...t (/home/njn/moz/mi5/dom/base/nsattrandchildarray.cpp:880) #04: mozilla::dom::fragmentorelement::sizeofexcludingthis(unsigned long (*)(void const*)) const (/home/njn/moz/mi5/dom/base/fragmentorelement.cpp:2337) #05: nsinode::sizeofincludingthis(unsigned long (*)(void const*)) const (/home/njn/moz/mi5/go64dmd/parser/html/../../../dom/base/nsinode.h:307) #06: mozilla::dom::nodeinfo::nodetype() const (/home/njn/moz/mi5/go64dmd/dom/base/../../dist/include/mozilla/dom/nodeinfo.h:127) #07: nshtmldocument::docaddsizeofexcludingthis(nswindowsizes*) const (/home/njn/moz/mi5/dom/html/nshtmldocument.cpp:3710) #08: nsidocument::docaddsizeofincludingthis(nswindowsizes*) const (/home/njn/moz/mi5/dom/base/nsdocument.cpp:12820) } } the choice of whether to record an allocation stack tra...
Leak-hunting strategies and tips
(by most of the leaks, i mean the leaks of large numbers of different types of objects or leaks of objects that are known to entrain many non-logged objects such as js objects.
...these roots are printed on shutdown in debug builds, and the name of the root should give the type of object it is associated with.
Memory reporting
that said, note that for some classes these methods may be virtual.) mfbt/memoryreporting.h defines mozilla::mallocsizeof as follows: typedef size_t (*mallocsizeof)(const void* p); functions with this signature measure the size of p by asking the heap allocator how big it is (via moz_malloc_usable_size).
... return moz_collect_report( "explicit/mystring", kind_heap, units_bytes, gmystring->sizeofincludingthis(mallocsizeof), "memory used for mystring."); } }; ns_impl_isupports1(mystringreporter, nsimemoryreporter) note that moz_define_malloc_size_of defines a function of type mozilla::mallocsizeof that is specific to this memory reporter (and will be identified as such in dmd's output).
A guide to searching crash reports
fields are provided for four common search criteria: product, version, platform, and process type.
...the operators available for each field depends on its type.
L20n Javascript API
currently available event types: ready - fired when all resources are available and the context instance is ready to be used.
...04 error when fetching a resource file, or recursive import statements in resource files), context.translationerror, when there is a missing translation in one of supported locales; the context instance will try to retrieve a fallback translation from the next locale in the fallback chain, compiler.error, when l20n is unable to evaluate an entity to a string; there are two types of errors in this category: compiler.valueerror, when l20n can still try to use the literal source string of the entity as fallback, and compiler.indexerror otherwise.
Leak And Bloat Tests
eremail", "tinderbox@invalid.com"); user_pref("mail.identity.id1.valid", true); user_pref("mail.root.none-rel", "[profd]mail"); user_pref("mail.root.pop3-rel", "[profd]mail"); user_pref("mail.server.server1.directory-rel", "[profd]mail/local folders"); user_pref("mail.server.server1.hostname", "local folders"); user_pref("mail.server.server1.name", "local folders"); user_pref("mail.server.server1.type", "none"); user_pref("mail.server.server1.username", "nobody"); user_pref("mail.server.server2.check_new_mail", false); user_pref("mail.server.server2.directory-rel", "[profd]mail/tinderbox"); user_pref("mail.server.server2.download_on_biff", true); user_pref("mail.server.server2.hostname", "tinderbox"); user_pref("mail.server.server2.login_at_startup", false); user_pref("mail.server.server2.name...
...", "tinderbox@invalid.com"); user_pref("mail.server.server2.type", "pop3"); user_pref("mail.server.server2.username", "tinderbox"); user_pref("mail.smtp.defaultserver", "smtp1"); user_pref("mail.smtpserver.smtp1.hostname", "tinderbox"); user_pref("mail.smtpserver.smtp1.username", "tinderbox"); user_pref("mail.smtpservers", "smtp1"); user_pref("mail.startup.enabledmailcheckonce", true); user_pref("mailnews.start_page_override.mstone", "1.9pre"); user_pref("mail.shell.checkdefaultclient", false); // ensure os x and outlook/oe books are disabled user_pref("ldap_2.servers.osx.position", 0); user_pref("ldap_2.servers.oe.position", 0); preferences in generated profile, but not set: user_pref("mail.root.none", "/home/moztest/.thunderbird/t7i1txfw.minimum/mail"); user_pref("mail.root.pop3", "/home/mo...
NSPR Contributor Guide
should you need to have a similar api, with some slightly different behavior or different function prototype, then suggest a new api with a different name.
...provide header file descriptions that fully document your public typedefs, enums, macros and functions.
Optimizing Applications For NSPR
nspr functions returning floating point types and structs by value, including the derived types print64, are declared <tt>__pascal</tt>.
... digital unix is the main platform used for nspr's prototype use of ipv6.
Logging
conditional compilation and execution log types and variables logging functions and macros use example conditional compilation and execution nspr's logging facility is conditionally compiled in and enabled for applications using it.
... log types and variables two types supporting nspr logging are exposed in the api: prlogmoduleinfo prlogmodulelevel two environment variables control the behavior of logging at execution time: nspr_log_modules nspr_log_file logging functions and macros the functions and macros for logging are: pr_newlogmodule pr_setlogfile pr_setlogbuffering pr_logprint pr_logflush pr_log_test pr_log...
PLHashEnumerator
syntax #include <plhash.h> typedef printn (pr_callback *plhashenumerator)(plhashentry *he, printn index, void *arg); /* return value */ #define ht_enumerate_next 0 /* continue enumerating entries */ #define ht_enumerate_stop 1 /* stop enumerating entries */ #define ht_enumerate_remove 2 /* remove and free the current entry */ #define ht_enumerate_unhash 4 /* just unhash the current entry */ description plhashenumerator is a function type used in the enumerating a hash table.
... when all the table entries are enumerated, each entry is passed to a user-specified function of type plhashenumerator with the hash table entry, an integer index, and an arbitrary piece of user data as argument.
PLHashTable
syntax #include <plhash.h> typedef struct plhashtable plhashtable; description the opaque plhashtable structure represents a hash table.
... entries in the table have the type plhashentry and are organized into buckets.
PRErrorCode
type for error codes that can be retrieved with pr_geterror.
... syntax #include <prerror.h> typedef print32 prerrorcode description the service nspr offers in this area is the ability to associate a thread-specific condition with an error number.
PRFileDesc
syntax #include <prio.h> struct prfiledesc { priomethods *methods; prfileprivate *secret; prfiledesc *lower, *higher; void (*dtor)(prfiledesc *fd); prdescidentity identity; }; typedef struct prfiledesc prfiledesc; parameters methods the i/o methods table.
... for more details about the use of prfiledesc and related structures, see file descriptor types.
PRFileMap
type returned by pr_createfilemap and passed to pr_memmap and pr_closefilemap.
... syntax #include <prio.h> typedef struct prfilemap prfilemap; description the opaque structure prfilemap represents a memory-mapped file object.
PRFloat64
the nspr floating-point type is always 64 bits.
... syntax #include <prtypes.h> typedef double prfloat64; ...
PRIPv6Addr
type used in the ipv6.ip field of the prnetaddr structure.
... syntax #include <prio.h> #if defined(_pr_inet6) typedef struct in6_addr pripv6addr; #endif /* defined(_pr_inet6) */ description pripv6addr represents a 128-bit ipv6 address.
PRInt32
syntax #include <prtypes.h> typedefdefinition print32; description may be defined as an int or a long, depending on the platform.
... for syntax details for each platform, see prtypes.h.
PRInt64
syntax #include <prtypes.h> typedef definition print64; description may be defined in several different ways, depending on the platform.
... for syntax details for each platform, see prtypes.h.
PRIntervalTime
a platform-dependent type that represents a monotonically increasing integer--the nspr runtime clock.
... syntax #include <prinrval.h> typedef pruint32 printervaltime; #define pr_interval_min 1000ul #define pr_interval_max 100000ul #define pr_interval_no_wait 0ul #define pr_interval_no_timeout 0xfffffffful description the units of printervaltime are platform-dependent.
PRLinger
syntax #include <prio.h> typedef struct prlinger { prbool polarity; printervaltime linger; } prlinger; fields the structure has the following fields: polarity polarity of the option's setting: pr_false means the option is off, in which case the value of linger is ignored.
...the pr_sockopt_linger socket option, with a value represented by a structure of type prlinger, makes it possible to change this default as follows: if polarity is set to pr_false, pr_close returns immediately, but if there are any data remaining in the socket send buffer, the runtime attempts to deliver the data to the peer.
PRLogModuleLevel
the enumerated type prlogmodulelevel defines levels of logging available to application programs.
... syntax #include <prlog.h> typedef enum prlogmodulelevel { pr_log_none = 0, pr_log_always = 1, pr_log_error = 2, pr_log_warning = 3, pr_log_debug = 4, pr_log_notice = pr_log_debug, pr_log_warn = pr_log_warning, pr_log_min = pr_log_debug, pr_log_max = pr_log_debug } prlogmodulelevel; ...
PRMcastRequest
syntax #include <prio.h> struct prmcastrequest { prnetaddr mcaddr; prnetaddr ifaddr; }; typedef struct prmcastrequest prmcastrequest; fields the structure has the following fields: mcaddr ip multicast address of group.
... description the mcaddr and ifaddr fields are of the type prnetaddr, but their port fields are ignored.
PRNetAddr
type used with socket manipulation functions to specify a network address.
... syntax #include <prio.h> union prnetaddr { struct { pruint16 family; char data[14]; } raw; struct { pruint16 family; pruint16 port; pruint32 ip; char pad[8]; } inet; #if defined(_pr_inet6) struct { pruint16 family; pruint16 port; pruint32 flowinfo; pripv6addr ip; } ipv6; #endif /* defined(_pr_inet6) */ }; typedef union prnetaddr prnetaddr; fields the structure has the following fields: family address family: pr_af_inet|pr_af_inet6 for raw.family, pr_af_inet for inet.family, pr_af_inet6 for ipv6.family.
PRPtrdiff
signed pointer difference type.
... syntax #include <prtypes.h> typedef ptrdiff_t prptrdiff; ...
PRStatus
type for status code returned by some functions.
... syntax #include <prtypes.h> typedef enum { pr_failure = -1, pr_success = 0 } prstatus; ...
PRThreadScope
syntax #include <prthread.h> typedef enum prthreadscope { pr_local_thread, pr_global_thread pr_global_bound_thread } prthreadscope; enumerators pr_local_thread a local thread, scheduled locally by nspr within the process.
... pr_global_bound_thread a global bound (kernel) thread, scheduled by the host os description an enumerator of type prthreadscope specifies how a thread is scheduled: either locally by nspr within the process (a local thread) or globally by the host (a global thread).
PRTimeParamFn
this type defines a callback function to calculate and return the time parameter offsets from a calendar time object in gmt.
... syntax #include <prtime.h> typedef prtimeparameters (pr_callback_decl *prtimeparamfn) (const prexplodedtime *gmt); description the type prtimeparamfn represents a callback function that, when given a time instant in gmt, returns the time zone information (offset from gmt and dst offset) at that time instant.
PRUint32
syntax #include <prtypes.h> typedefdefinition pruint32; description may be defined as an unsigned int or an unsigned long, depending on the platform.
... for syntax details for each platform, see prtypes.h.
PRUint64
syntax #include <prtypes.h> typedef definition pruint64; description may be defined in several different ways, depending on the platform.
... for syntax details for each platform, see prtypes.h.
PRUint8
there is no type equivalent to a plain char.
... syntax #include <prtypes.h> typedefdefinition pruint8; ...
PRUnichar
an unsigned 16-bit type, like char in java or the "characters" of a javascript string defined in /mozilla/xpcom/base/nscore.h.
... syntax #if defined(ns_win32) typedef wchar_t prunichar; #else typedef pruint16 prunichar; #endif ...
PRUptrdiff
unsigned pointer difference type.
... syntax #include <prtypes.h> typedef unsigned long pruptrdiff; ...
PR_Accept
addr a pointer to a structure of type prnetaddr.
... timeout a value of type printervaltime specifying the time limit for completion of the accept operation.
PR_CALLBACK
syntax #include <prtypes.h>type pr_callbackimplementation description functions that are implemented in an application (or shared library) that are intended to be called from another shared library (such as nspr) must be declared with the pr_callback attribute.
...the pr_callback attribute is included as part of the function's definition between its return value type and the function's name.
PR_CreateFileMap
returns if successful, a file mapping of type prfilemap.
... description the prfilemapprotect enumeration used in the prot parameter is defined as follows: typedef enum prfilemapprotect { pr_prot_readonly, pr_prot_readwrite, pr_prot_writecopy } prfilemapprotect; pr_createfilemap only prepares for the mapping a file to memory.
PR_CreateThread
syntax #include <prthread.h> prthread* pr_createthread( prthreadtype type, void (*start)(void *arg), void *arg, prthreadpriority priority, prthreadscope scope, prthreadstate state, pruint32 stacksize); parameters pr_createthread has the following parameters: type specifies that the thread is either a user thread (pr_user_thread) or a system thread (pr_system_thread).
...nspr does not assess the type or the validity of the value passed in this parameter.
PR_GetSpecialFD
syntax #include <prio.h> prfiledesc* pr_getspecialfd(prspecialfd id); parameter the function has the following parameter: id a pointer to an enumerator of type prspecialfd, indicating the type of i/o stream desired: pr_standardinput, pr_standardoutput, or pr_standarderror.
... description type prspecialfd is defined as follows: typedef enum prspecialfd{ pr_standardinput, pr_standardoutput, pr_standarderror } prspecialfd; #define pr_stdin pr_getspecialfd(pr_standardinput) #define pr_stdout pr_getspecialfd(pr_standardoutput) #define pr_stderr pr_getspecialfd(pr_standarderror) file descriptors returned by pr_getspecialfd are owned by the runtime and should not be closed by the caller.
PR_IMPLEMENT
syntax #include <prtypes.h> pr_implement(type)implementation description pr_implement is used to define implementations of externally visible routines and globals.
... for syntax details for each platform, see prtypes.h.
PR_NEW
syntax #include <prmem.h> _type * pr_new(_struct); parameter _struct the name of a type.
... returns an pointer to a buffer sized to contain the type _struct, or if the allocation attempt fails, null.
PR_ReadDir
description pr_readdir returns a pointer to a directory entry structure: struct prdirentry { const char *name; }; typedef struct prdirentry prdirentry; the structure has the following field: name name of entry, relative to directory name.
... the flags parameter is an enum of type prdirflags: typedef enum prdirflags { pr_skip_none = 0x0, pr_skip_dot = 0x1, pr_skip_dot_dot = 0x2, pr_skip_both = 0x3, pr_skip_hidden = 0x4 } prdirflags; the memory associated with the returned prdirentry structure is managed by nspr.
PR_Writev
timeout a value of type printervaltime describing the time limit for completion of the entire write operation.
... this is the type definition for priovec: typedef struct priovec { char *iov_base; int iov_len; } priovec; the priovec structure has the following fields: iov_base a pointer to the beginning of the buffer.
Certificate functions
the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references.
...verify for multiple usages use cert_verifycertificatenow cert_verifyocspresponsesignature mxr 3.6 and later cert_verifysigneddata mxr 3.4 and later cert_verifysigneddatawithpublickey mxr 3.7 and later cert_verifysigneddatawithpublickeyinfo mxr 3.7 and later nss_cmpcertchainwcanames mxr 3.2 and later nss_findcertkeatype mxr 3.2 and later ...
Introduction to Network Security Services
the two libraries exist to provide optimal performance on each of the two types of cpus.
...linking the application against one or the other of these libraries may produce an application program that can only run on one type of cpu (e.g.
NSS 3.12.4 release notes
few remaining issues with nss's new revocation flags bug 489710: byteswap optimize for msvc++ bug 490154: cryptokey framework requires module to implement generatekey when they support keypairgeneration bug 491044: remove support for vms (a.k.a., openvms) from nss bug 491174: cert_pkixverifycert reports wrong error code when ee cert is expired bug 491919: cert.h doesn't have valid functions prototypes bug 492131: a failure to import a cert from a p12 file leaves error code set to zero bug 492385: crash freeing named crl entry on shutdown bug 493135: bltest crashes if it can't open the input file bug 493364: can't build with --disable-dbm option when not cross-compiling bug 493693: sse2 instructions for bignum are not implemented on os/2 bug 493912: sqlite3_reset should be invoked in sdb_findo...
...bug 504408: pkix_pl_crldp_create will always fail if dp->distpointtype != generalname bug 504456: exploitable heap overflow in nss shell expression (filename globbing) parsing bug 505559: need function to identify the one and only default internal private key slot.
NSS 3.12.6 release notes
ssl_snisocketconfighook ssl_reconfigfd ssl_configserversessionidcachewithopt ssl_settrustanchors ssl_getnegotiatedhostinfo new enum for sni: sslsninametype (see sslt.h) new functions in cert.h certdistnames: duplicate distinguished name array.
... ssl_getimplementedciphers ssl_getnumimplementedciphers ssl_handshakenegotiatedextension new error codes in sslerr.h ssl_error_unsafe_negotiation ssl_error_rx_unexpected_uncompressed_record new types in sslt.h sslextensiontype new environment variables sqlite_force_proxy_locking 1 means force always use proxy, 0 means never use proxy, null means use proxy for non-local files only.
NSS 3.15.5 release notes
the extension type value is 35655, which may change when an official extension type value is assigned by iana.
...applications should still take care when converting struct iov to priovec because the iov_len members of the two structures have different types (size_t vs.
NSS 3.16.1 release notes
new functions in pk11pub.h pk11_exportderprivatekeyinfo and pk11_exportprivkeyinfo - exports a private key in a der-encoded asn.1 privatekeyinfo type or a seckeyprivatekeyinfo structure.
... new types in sslt.h ssl_padding_xtn - the value of this enum constant changed from the experimental value 35655 to the iana-assigned value 21.
NSS Sample Code Sample1
appedenckey) { rv = 1; goto done; } mwrappedmackey = secitem_dupitem(wrappedmackey); if (!mwrappedmackey) { rv = 1; goto done; } done: return rv; } int server::start() { int rv; seckeyprivatekey *prvkey = 0; rv = getprivatekey(&prvkey); if (rv) goto done; if (!menckey) { // unwrap the encryption key from the "file" // this function uses a mechanism rather than a key type // does this need to be "withflags"??
... menckey = pk11_pubunwrapsymkey(prvkey, mwrappedenckey, ckm_aes_cbc_pad, cka_encrypt, 0); if (!menckey) { rv = 1; goto done; } } if (!mmackey) { // unwrap the mac key from the "file" // this function uses a mechanism rather than a key type // does this need to be "withflags"??
NSS Sample Code sample6
should succeed on first run on a fresh db, * should fail on successive runs because key with that id already exists */ genkey(2); /* generate a key with id 1 - this will fail because key with that id * already exists */ genkey(1); } void genkey(int id) { pk11slotinfo* slot = null; pk11symkey* key = null; secitem keyiditem; int keyid[1]; ck_mechanism_type ciphermech; /* using ckm_aes_cbc_pad mechanism for example */ ciphermech = ckm_aes_cbc_pad; slot = pk11_getinternalkeyslot(); /* slot = pk11_getbestslot(ciphermech, null); didn't work.
... */ if (slot == null) { fprintf(stderr, "unable to find security device (err %d)\n", pr_geterror()); return; } keyid[0] = id; keyiditem.type = sibuffer; keyiditem.data = (void *)keyid; keyiditem.len = sizeof(keyid[0]); /* note: keysize must be 0 for fixed key-length algorithms like des.
PKCS 7 functions
the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references.
...and later sec_pkcs7addrecipient mxr 3.2 and later sec_pkcs7addsigningtime mxr 3.2 and later sec_pkcs7containscertsorcrls mxr 3.4 and later sec_pkcs7contentisencrypted mxr 3.4 and later sec_pkcs7contentissigned mxr 3.4 and later sec_pkcs7contenttype mxr 3.2 and later sec_pkcs7copycontentinfo mxr 3.4 and later sec_pkcs7createcertsonly mxr 3.3 and later sec_pkcs7createdata mxr 3.2 and later sec_pkcs7createencrypteddata mxr 3.2 and later sec_pkcs7createenvelopeddata mxr 3.2 and later ...
NSS tools : cmsutil
to run cmsutil, type the command cmsutil option [arguments] where option and arguments are combinations of the options and arguments listed in the following section.
...-u certusage set type of cert usage (default is certusageemailsigner).
NSS reference
data types based on "selected ssl types and structures" in the ssl reference.
...certnow cert_verifycert cert_verifycertname cert_checkcertvalidtimes nss_cmpcertchainwcanames manipulating certificates cert_dupcertificate cert_destroycertificate sec_deletepermcertificate __cert_closepermcertdb getting certificate information cert_findcertbyname cert_getcertnicknames cert_freenicknames cert_getdefaultcertdb nss_findcertkeatype comparing secitem objects secitem_compareitem key functions key functions seckey_getdefaultkeydb seckey_destroyprivatekey digital signatures this api consists of the routines used to perform signature generation and the routines used to perform signature verification.
S/MIME functions
the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references.
... source code nss versions nss_cmscontentinfo_getbulkkey mxr 3.2 and later nss_cmscontentinfo_getbulkkeysize mxr 3.2 and later nss_cmscontentinfo_getcontent mxr 3.2 and later nss_cmscontentinfo_getcontentencalgtag mxr 3.2 and later nss_cmscontentinfo_getcontenttypetag mxr 3.2 and later nss_cmscontentinfo_setbulkkey mxr 3.2 and later nss_cmscontentinfo_setcontent mxr 3.2 and later nss_cmscontentinfo_setcontent_data mxr 3.2 and later nss_cmscontentinfo_setcontentencalg mxr 3.2 and later nss_cmscontentinfo_setcontent_diges...
TLS Cipher Suite Discovery
the sslciphersuiteinfo structure contains this information, declared in "sslt.h": typedef struct sslciphersuiteinfostr { pruint16 length; pruint16 ciphersuite; /* cipher suite name */ const char * ciphersuitename; /* server authentication info */ const char * authalgorithmname; sslauthtype authalgorithm; /* key exchange algorithm info */ const char * keatypename; sslkeatype...
... keatype; /* symmetric encryption info */ const char * symciphername; sslcipheralgorithm symcipher; pruint16 symkeybits; pruint16 symkeyspace; pruint16 effectivekeybits; /* mac info */ const char * macalgorithmname; sslmacalgorithm macalgorithm; pruint16 macbits; pruintn isfips : 1; pruintn isexportable : 1; pruintn nonstandard : 1; pruintn reservedbits :29; } sslciphersuiteinfo; (unfinished, to be completed here) ...
Utility functions
the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references.
...ter hash_clone mxr 3.10 and later hash_create mxr 3.4 and later hash_destroy mxr 3.4 and later hash_end mxr 3.4 and later hash_gethashobject mxr 3.2 and later hash_gethashobjectbyoidtag mxr 3.8 and later hash_gethashtypebyoidtag mxr 3.8 and later hash_gettype mxr 3.12 and later hash_hashbuf mxr 3.10 and later hash_resultlen mxr 3.4 and later hash_resultlenbyoidtag mxr 3.10 and later hash_resultlencontext mxr 3.10 and later hash_update mxr ...
NSS Tools cmsutil
syntax to run cmsutil, type the command cmsutil option [arguments] where option and arguments are combinations of the options and arguments listed in the following section.
... -u certusage set type of cert usage (default is <tt>certusageemailsigner)</tt>.
NSS tools : cmsutil
MozillaProjectsNSStoolscmsutil
to run cmsutil, type the command cmsutil option [arguments] where option and arguments are combinations of the options and arguments listed in the following section.
... -u certusage set type of cert usage (default is certusageemailsigner).
Necko Architecture
mimetype - mime <-> file extension mapping nkabout - about: protocol nkdata - data: protocol nkfile - file: protocol nkftp - ftp: protocol nkkeyword - keyword: protocol nkresrc - resource: protocol cnvts - stream converters stremcnv - stream converter service these libraries will change with time and illustrate the modularity of necko.
... transports underlying i/o functionality has been consolidated into "transports." there is a transport for each type of i/o.
Rhino FAQ
creating arrays of primitive types is slightly different: you must use the type field.
... for example, creating an array of seven ints can be done with the code var intarray = java.lang.reflect.array.newinstance(java.lang.integer.type, 7); when i try to execute a script i get the exception required security context missing.
Rhino shell
the shell will also quit in interactive mode if an end-of-file character is typed at the prompt.
...the next invocation has no arguments, so the shell goes into interactive mode, reading and evaluating each line as it is typed in.
SpiderMonkey Build Documentation
no configure: error: installation or configuration problem: c compiler cannot create executables." you can try configuring like so: cc=clang cxx=clang++ ../configure it is also possible that baldrdash may fail to compile with /usr/local/cellar/llvm/7.0.1/lib/clang/7.0.1/include/inttypes.h:30:15: fatal error: 'inttypes.h' file not found /usr/local/cellar/llvm/7.0.1/lib/clang/7.0.1/include/inttypes.h:30:15: fatal error: 'inttypes.h' file not found, err: true this is because, starting from mohave, headers are no longer installed in /usr/include.
... for a list of other available build options, type (assuming the current working directory is one of the above-created build directories): /bin/sh ../configure.in --help generating a compilation database some tools (like ides, static analyzers and refactoring tools) consume a file called compile_commands.json which contains a description of all the pieces required to build a piece of software so that tools don't have to also understand a buil...
Tracing JIT
each spidermonkey jscontext holds a trace monitor of type jstracemonitor.
... recording when the trace monitor enters recording mode, it constructs a new trace recorder, of type tracerecorder.
BOOLEAN_TO_JSVAL
cast a c integer to a boolean js::value without any type checking or error handling.
... syntax jsval boolean_to_jsval(bool b); name type description b bool c integer value to be converted to a boolean jsval.
INT_FITS_IN_JSVAL
*/ name type description i jsint the c integer value to check.
... warning: the type of the argument i must be jsint, but the c/c++ compiler does not enforce type safety here.
JS::Add*Root
, const char *name); bool js::addnamedstringroot(jscontext *cx, js::heap<jsstring *> *rp, const char *name); bool js::addnamedobjectroot(jscontext *cx, js::heap<jsobject *> *rp, const char *name); bool js::addnamedscriptroot(jscontext *cx, js::heap<jsscript *> *rp, const char *name); name type description cx jscontext * the context in which to add the new root.
... vp/rp is the address of a c/c++ variable (or field, or array element) of type js::value, jsstring *, jsobject *, or jsscript *.
JS::DoubleNaNValue
this article covers features introduced in spidermonkey 24 create a not-a-number (nan) floating-point number as a value of type js::value.
... syntax js::value js::doublenanvalue() description js::doublenanvalue returns a value of type js::value that represents an ieee floating-point quiet not-a-number (nan).
JS::HandleValueArray
js::autovaluevector& values); js::handlevaluearray(const js::autovaluearray<n>& values); js::handlevaluearray(const js::callargs& args); js::handlevaluearray::frommarkedlocation(size_t len, const js::value *elements); js::handlevaluearray::subarray(const js::handlevaluearray& values, size_t startindex, size_t len); js::handlevaluearray::empty(); name type description value js::rootedvalue &amp; an element of newly created 1-length array.
...this is useful as a parameter type, or a temporal local variable for it.
JS::MutableHandle
} methods here, ptr represents the private member of js::mutablehandle<t>, typed with t *.
... there are typedefs available for the main types: namespace js { typedef mutablehandle<jsfunction*> mutablehandlefunction; typedef mutablehandle<jsid> mutablehandleid; typedef mutablehandle<jsobject*> mutablehandleobject; typedef mutablehandle<jsscript*> mutablehandlescript; typedef mutablehandle<jsstring*> mutablehandlestring; typedef mutablehandle<js::symbol*> mutablehandlesymbol; typedef mutable...
JS::NumberValue
syntax js::value js::numbervalue(float f) js::value js::numbervalue(double dbl) js::value js::numbervalue(int8_t i) js::value js::numbervalue(uint8_t i) js::value js::numbervalue(int16_t i) js::value js::numbervalue(uint16_t i) js::value js::numbervalue(int32_t i) js::value js::numbervalue(uint32_t i) name type description f or dbl or i any c integer or floating-point value to convert.
... description js::numbervalue converts a c integer or floating-point value to js::value, the type of javascript values.
JS::SetLargeAllocationFailureCallback
syntax void js::setlargeallocationfailurecallback(jsruntime *rt, js::largeallocationfailurecallback afc, void *data); name type description rt jsruntime * the jsruntime for which to set the gc callback.
...added in spidermonkey 38 callback syntax typedef void (* js::largeallocationfailurecallback)(void *data); name type description data void * data parameter passed to js::setlargeallocationfailurecallback.
JS::SetOutOfMemoryCallback
syntax void js::setoutofmemorycallback(jsruntime *rt, js::outofmemorycallback cb, void *data); name type description rt jsruntime * the jsruntime for which to set the gc callback.
...added in spidermonkey 38 callback syntax typedef void (* outofmemorycallback)(jscontext *cx, void *data); name type description data void * data parameter passed to js::setoutofmemorycallback.
JSBool
jsbool is the return type of many jsapi functions and callbacks.
...jsbool is an integer type.
JSEnumerateOp
jsenumerateop is the type of the jsclass.enumerate callback.
... syntax typedef bool (* jsenumerateop)(jscontext *cx, js::handleobject obj); name type description cx jscontext * pointer to the js context in which the enumeration is taking place.
JSFinalizeOp
jsfinalizeop is the type of jsclass.finalize.
... syntax typedef void (* jsfinalizeop)(jsfreeop *fop, jsobject *obj); name type description cx jscontext * the js context in which garbage collection is taking place.
JSFunction
jsfunction is a type in the jsapi.
... the apis js_newfunction, js_definefunction, js_compilefunction, and their unicode equivalents return values of type jsfunction *.
JSID_EMPTY
internal jsid value which is used in type inference.
... syntax const jsid jsid_empty; const js::handleid jsid_emptyhandle; // added in spidermonkey 31 description jsid_empty is an internal jsid value which is used in type inference code.
JSMarkOp
jsmarkop is the type of the jsclass.mark callback in spidermonkey 1.7 and earlier.
... syntax typedef uint32 (* jsmarkop)(jscontext *cx, jsobject *obj, void *arg); name type description cx jscontext * the js context in which the mark phase of garbage collection is occurring.
JSObjectOp
jsobjectop is the type of several jsapi callbacks that map an object to another object, or null if an error or exception occurred.
... typedef jsobject * (*jsobjectop)(jscontext *cx, jsobject *obj); the callbacks of this type are: jsextendedclass.outerobject jsextendedclass.innerobject jsextendedclass.wrappedobject jsobjectops.thisobject ...
JSObjectPrincipalsFinder
jsobjectprincipalsfinder is the type of a security callback that can be configured using js_setobjectprincipalsfinderjsapi 1.8 and earlier or js_setruntimesecuritycallbacksadded in spidermonkey 1.8.1.
... callback syntax typedef jsprincipals * (* jsobjectprincipalsfinder)(jscontext *cx, jsobject *obj); name type description cx jscontext * the context in which to find principals.
JSPrincipals
properties name type description refcount mozilla::atomic<int32_t> reference count.
... see also mxr id search for jsprincipals js_newglobalobject js_holdprincipals js_dropprincipals bug 715417 - removed getprincipalarray and globalprivilegesenabled bug 728250 - added dump method, removed codebase, destroy, and subsume properties bug 884676 - changed refcount type to mozilla::atomic ...
JSPrincipalsTranscoder
jsprincipalstranscoder is the type of a security callback that can be configured using js_setprincipalstranscoderjsapi 1.8 and earlier or js_setruntimesecuritycallbacksadded in spidermonkey 1.8.1.
... callback syntax typedef jsbool (*jsprincipalstranscoder)(jsxdrstate *xdr, jsprincipals **principalsp); name type description xdr jsxdrstate * the xdr reader/writer.
JSPropertySpec
union { jsnativewrapper native; selfhostedwrapper selfhosted; } getter; union { jsnativewrapper native; selfhostedwrapper selfhosted; } setter; /* obsolete since jsapi 29 */ /* added in jsapi 28 */ const char *selfhostedgetter; const char *selfhostedsetter; }; name type description name const char * name to assign the property.
...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_defineproperties 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 selfhostedgetter and selfhostedsetter bug 958262 - changed type of getter and setter to union, and removed selfhostedgetter and selfhostedsetter.
JSReserveSlotsOp
jsreserveslotsop is the type of the jsclass.reserveslots.
... syntax typedef uint32 (* jsreserveslotsop)(jscontext *cx, jsobject *obj); name type description cx jscontext * the js context in which the new object is being created.
JSSecurityCallbacks.contentSecurityPolicyAllows
jscheckaccessop is the type of the callback.
... (it is also the type of the callback set by js_setcheckobjectaccesscallback.) syntax typedef jsbool (*jscspevalchecker)(jscontext *cx); name type description cx jscontext * the js context in which the property access attempt is occurring.
JSVAL_IS_INT
to convert between c integer types and jsval, use jsval_to_int, int_fits_in_jsval, and int_to_jsval.
... example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if statement to see if it is a js integer data type.
JSVAL_TO_BOOLEAN
cast a boolean javascript value to a c integer, either 0 or 1, without any type checking or error handling.
...these are constants of type jsbool, which is an integer type, the spidermonkey version of bool.
JSVAL_TO_GCTHING
cast a jsval to a raw pointer of type void *.
...the type of the result is void *.
JSVersion
the values of the jsversion enumerated type stand for particular versions of the javascript run-time.
... description the jsversion enumerated type includes the following values.
JSXDRObjectOp
jsxdrobjectop is the type for jsclass.xdrobject.
... syntax typedef jsbool (* jsxdrobjectop)(jsxdrstate *xdr, jsobject **objp); name type description xdr jsxdrstate * the xdr reader or writer.
JS_AddArgumentFormatter
syntax jsbool js_addargumentformatter(jscontext *cx, const char *format, jsargumentformatter formatter); void js_removeargumentformatter(jscontext *cx, const char *format); name type description cx jscontext * the context in which to install the formatter.
...callback syntax jsbool (*jsargumentformatter)(jscontext *cx, const char *format, jsbool fromjs, jsval **vpp, va_list *app); name type description cx jscontext * the context in which the conversion is being performed.
JS_AddFinalizeCallback
syntax bool js_addfinalizecallback(jsruntime *rt, jsfinalizecallback cb, void *data); // added in spidermonkey 38 (jsapi 32) void js_removefinalizecallback(jsruntime *rt, jsfinalizecallback cb); // added in spidermonkey 38 (jsapi 32) void js_setfinalizecallback(jsruntime *rt, jsfinalizecallback cb); // obsolete since jsapi 32 name type description rt jsruntime * the jsruntime for which to set the finalization callback.
... callback syntax typedef enum jsfinalizestatus { jsfinalize_group_start, jsfinalize_group_end, jsfinalize_collection_end } jsfinalizestatus; typedef void (* jsfinalizecallback)(jsfreeop *fop, jsfinalizestatus status, bool iscompartment, void *data); name type description fop jsfreeop * a pointer to an instance of jsfreeop.
JS_Add*Root
*cx, jsobject **opp); jsbool js_addgcthingroot(jscontext *cx, void **rp); jsbool js_addnamedvalueroot(jscontext *cx, jsval *vp, const char *name); jsbool js_addnamedstringroot(jscontext *cx, jsstring **spp, const char *name); jsbool js_addnamedobjectroot(jscontext *cx, jsobject **opp, const char *name); jsbool js_addnamedgcthingroot(jscontext *cx, void **rp, const char *name); name type description cx jscontext * the context in which to add the new root.
... vp/spp/opp/rp is the address of a c/c++ variable (or field, or array element) of type jsstring *, jsobject *, or jsval.
JS_AlreadyHasOwnProperty
handleobject obj, const char16_t *name, size_t namelen, bool *foundp); boo js_alreadyhasownpropertybyid(jscontext *cx, js::handleobject obj, js::handleid id, bool *foundp); // added in spidermonkey 1.8.1 boo js_alreadyhasownelement(jscontext *cx, js::handleobject obj, uint32_t index, bool *foundp); name type description cx jscontext * pointer to a js context.
...this means that: the prototype chain of obj is not searched.
JS_BeginRequest
syntax void js_beginrequest(jscontext *cx); void js_endrequest(jscontext *cx); name type description cx jscontext * the context in which the calling thread intends to call jsapi functions.
...in this reference, the cx parameter of such functions is documented with the phrase “requires request”, like this: name type description cx jscontext * the context to use.
JS_ClearNonGlobalObject
syntax void js_clearnonglobalobject(jscontext *cx, jsobject *obj); name type description cx jscontext * the context in which to clear the object.
...properties belonging to objects on obj's prototype chain are not affected.
JS_ClearScope
syntax void js_clearscope(jscontext *cx, jsobject *obj); name type description cx jscontext * the context in which to clear the object.
...properties belonging to objects on obj's prototype chain are not affected.
JS_ContextIterator
syntax jscontext * js_contextiterator(jsruntime *rt, jscontext **iterp); name type description rt jsruntime * the runtime to walk.
... iterp must point to a variable of type jscontext *.
JS_DefineElement
nt(jscontext *cx, js::handleobject obj, uint32_t index, double value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); /* obsolete since jsapi 32 */ js_defineelement(jscontext *cx, jsobject *obj, uint32_t index, jsval value, jspropertyop getter, jsstrictpropertyop setter, unsigned attrs); name type description cx jscontext * the context in which to create the new property.
... see also mxr id search for js_defineelement js_defineconstdoubles js_definefunction js_definefunctions js_defineobject js_defineproperties js_defineproperty js_definepropertywithtinyid js_deleteelement js_getarraylength js_getelement js_isarrayobject js_lookupelement js_newarrayobject js_setelement bug 959787 - changed parameter types ...
JS_DefineFunctions
name type description cx jscontext * the context in which to define functions.
... see also mxr id search for js_definefunctions js_callfunctionname js_defineobject js_defineproperties js_newfunction bug 959787 - make fs type to const bug 825199 - added propertydefinitionbehavior ...
JS_DefineObject
syntax jsobject * js_defineobject(jscontext *cx, js::handleobject obj, const char *name, const jsclass *clasp = nullptr, unsigned attrs = 0); name type description cx jscontext * the context in which to create the new object.
... proto js::handleobject prototype object to use for the new object, or null.
JS_DefineProperty
js::handleobject obj, js::handleid id, uint32_t value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_definepropertybyid(jscontext *cx, js::handleobject obj, js::handleid id, double value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); name type description cx jscontext * the context in which to define the property.
...that is, it must be a jsobject * that points to a javascript function, cast to type jspropertyop.
JS_DeleteElement
syntax bool js_deleteelement(jscontext *cx, js::handleobject obj, uint32_t index); // added in spidermonkey 45 bool js_deleteelement(jscontext *cx, js::handleobject obj, uint32_t index, js::objectopresult &result); name type description cx jscontext * pointer to a js context from which to derive runtime information.
...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.
JS_DeleteElement2
renamed to js_deleteelement in jsapi 39 syntax bool js_deleteelement2(jscontext *cx, js::handleobject obj, uint32_t index, bool *succeeded); name type description cx jscontext * pointer to a js context from which to derive runtime information.
...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.
JS_DeleteProperty
text *cx, js::handleobject obj, const char *name, js::objectopresult &result); bool js_deletepropertybyid(jscontext *cx, js::handleobject obj, js::handleid id, js::objectopresult &result); bool js_deleteucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, js::objectopresult &result); name type description cx jscontext * pointer to a js context from which to derive runtime information.
...then one of the following cases applies: if obj has no property with the given name or id, or if obj inherits the specified property from its prototype, then obj's jsclass.delproperty hook is called.
JS_DeleteProperty2
xt *cx, js::handleobject obj, const char *name, bool *succeeded); bool js_deleteucproperty2(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, bool *succeeded); bool js_deletepropertybyid2(jscontext *cx, js::handleobject obj, js::handleid id, bool *succeeded); // added in spidermonkey 1.8.1 name type description cx jscontext * pointer to a js context from which to derive runtime information.
...then one of the following cases applies: if obj has no property with the given name or id, or if obj inherits the specified property from its prototype, then *succeeded is set to true and obj's jsclass.delproperty hook is called (which may change *succeeded).
JS_Enumerate
syntax jsidarray * js_enumerate(jscontext *cx, js::handleobject obj); name type description cx jscontext * the context in which to enumerate object properties.
...(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 properties.
JS_EnumerateDiagnosticMemoryRegions
syntax void js_enumeratediagnosticmemoryregions(jsenumeratediagnosticmemorycallback callback); name type description callback jsenumeratediagnosticmemorycallback pointer to the new callback function to use.
... callback syntax typedef bool (* jsenumeratediagnosticmemorycallback)(void *ptr, size_t length); name type description ptr void * pointer to the allocated memory.
JS_FlattenString
syntax jsflatstring * js_flattenstring(jscontext *cx, jsstring *str); name type description cx jscontext * the context.
...to catch errors, an opaque jsflatstring type is returned.
JS_GET_CLASS
syntax #ifdef js_threadsafe #define js_get_class(cx,obj) js_getclass(cx, obj) #else #define js_get_class(cx,obj) js_getclass(obj) #endif parameter type description cx jscontext * any context associated with the runtime in which obj exists.
...to check the type of an object, use js_hasinstance instead.
JS_GetClass
syntax const jsclass * js_getclass(jsobject *obj); name type description cx jscontext * any context associated with the runtime in which obj exists.
...to check the type of an object, use js_hasinstance instead.
JS_GetCompartmentPrivate
syntax void js_setcompartmentprivate(jscompartment *compartment, void *data); void * js_getcompartmentprivate(jscompartment *compartment); name type description compartment jscompartment * any compartment data void * (in js_setcompartmentprivate) pointer to application-defined data to be associated with the compartment.
... description each jscompartment has a field of type void * which the application may use for any purpose.
JS_GetConstructor
syntax jsobject * js_getconstructor(jscontext *cx, js::handle<jsobject*> proto); name type description cx jscontext * a context.
...to get an object's prototype, use js_getprototype.
JS_GetContextPrivate
syntax void * js_getcontextprivate(jscontext *cx); void js_setcontextprivate(jscontext *cx, void *data); void * js_getsecondcontextprivate(jscontext *cx); // added in spidermonkey 17 void js_setsecondcontextprivate(jscontext *cx, void *data); // added in spidermonkey 17 name type description cx jscontext * any context.
... description each jscontext has two fields of type void * which the application may use for any purpose.
JS_GetElement
syntax bool js_getelement(jscontext *cx, js::handleobject obj, uint32_t index, js::mutablehandlevalue vp); name type description cx jscontext * the context in which to perform the property lookup.
... description js_getelement examines a specified js object, obj, and its prototype chain, for an element or numeric property numbered index.
JS_GetEmptyStringValue
get the empty string as a value of type js::value.
... syntax // added in spidermonkey 42 js::value js_getemptystringvalue(jscontext *cx); // obsolete since spidermonkey 42 jsval js_getemptystringvalue(jscontext *cx); name type description cx jscontext * a context.
JS_GetFunctionFlags
syntax unsigned int js_getfunctionflags(jsfunction *fun); name type description fun jsfunction * the function to examine.
... function flags are a value of type unsigned int, the bitwise or of zero or more of the jsfun flags described below.
JS_GetGCParameter
syntax uint32_t js_getgcparameter(jsruntime *rt, jsgcparamkey key); void js_setgcparameter(jsruntime *rt, jsgcparamkey key, uint32_t value); uint32_t js_getgcparameterforthread(jscontext *cx, jsgcparamkey key); // added in spidermonkeysidebar 17 void js_setgcparameterforthread(jscontext *cx, jsgcparamkey key, uint32_t value); // added in spidermonkeysidebar 17 name type description rt jsruntime * the runtime to configure.
... typedef enum jsgcparamkey { jsgc_max_bytes, jsgc_max_malloc_bytes, jsgc_max_nursery_bytes, jsgc_bytes, jsgc_number, jsgc_mode, jsgc_unused_chunks, jsgc_total_chunks, jsgc_slice_time_budget, jsgc_mark_stack_limit, jsgc_high_frequency_time_limit, jsgc_high_frequency_low_limit, jsgc_high_frequency_high_limit, jsgc_high_frequency_heap_growth_max, jsgc_high_frequency_heap_growth_min, jsgc_low_frequ...
JS_GetOwnPropertyDescriptor
le<jspropertydescriptor> desc); bool js_getownpropertydescriptorbyid(jscontext *cx, js::handleobject obj, js::handleid id, js::mutablehandle<jspropertydescriptor> desc); bool js_getownucpropertydescriptor(jscontext *cx, js::handleobject obj, const char16_t *name, js::mutablehandle desc); // added in spidermonkey 45 name type description cx jscontext * a context.
...if desc->obj is null, then this property was not found on the prototype chain.
JS_GetParent
syntax jsobject * js_getparent(jsobject *obj); name type description obj jsobject * object for which to retrieve the parent.
... objects created by standard library functions, such as array.prototype.concat, have the global object as their parent.
JS_GetPositiveInfinityValue
retrieve a floating-point infinity as a value of type js::value.
... syntax // added in spidermonkey 42 js::value js_getpositiveinfinityvalue(jscontext *cx); js::value js_getnegativeinfinityvalue(jscontext *cx); // obsolete since spidermonkey 42 jsval js_getpositiveinfinityvalue(jscontext *cx); jsval js_getnegativeinfinityvalue(jscontext *cx); name type description cx jscontext * a context.
JS_GetProperty
j, const char *name, js::mutablehandlevalue vp); bool js_getucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, js::mutablehandlevalue vp); bool js_getpropertybyid(jscontext *cx, js::handleobject obj, js::handleid id, js::mutablehandlevalue vp); // added in spidermonkey 1.8.1 name type description cx jscontext * a context.
... description js_getproperty examines a specified js object obj and its prototype chain for a property with the specified name.
JS_GetPropertyAttributes
syntax jsbool js_getpropertyattributes(jscontext *cx, jsobject *obj, const char *name, unsigned int *attrsp, jsbool *foundp); jsbool js_getucpropertyattributes(jscontext *cx, jsobject *obj, const jschar *name, size_t namelen, unsigned int *attrsp, jsbool *foundp); name type description cx jscontext * the context in which to look up property attributes.
... if obj does not have the specified property, or if it inherits it from some other object (on its prototype chain, for example), then *foundp is set to js_false.
JS_GetPropertyAttrsGetterAndSetter
dsetter(jscontext *cx, jsobject *obj, const jschar *name, size_t namelen, unsigned int *attrsp, jsbool *foundp, jspropertyop *getterp, jspropertyop *setterp); jsbool js_getpropertyattrsgetterandsetterbyid(jscontext *cx, jsobject *obj, jsid id, unsigned int *attrsp, jsbool *foundp, jspropertyop *getterp, jspropertyop *setterp); // added in spidermonkey 1.8.1 name type description cx jscontext * the context in which to perform the property lookup.
...when this attribute is present, the value stored in getterp (or setterp) does not really point to a c/c++ function; it is a jsobject *, pointing to a javascript function, cast to type jspropertyop.
JS_GetPropertyDefault
syntax bool js_getpropertydefault(jscontext *cx, jsobject *obj, const char *name, jsval def, js::mutablehandle<js::value> vp); bool js_getpropertybyiddefault(jscontext *cx, jsobject *obj, jsid id, jsval def, js::mutablehandle<js::value> vp); name type description cx jscontext * a context.
... description js_getpropertydefault examines a specified js object obj and its prototype chain for a property with the specified name.
JS_GetRuntimePrivate
syntax void * js_getruntimeprivate(jsruntime *rt); void js_setruntimeprivate(jsruntime *rt, void *data); name type description rt jsruntime * any js runtime.
... description each jsruntime has a field of type void * which the application may use for any purpose.
JS_GetSecurityCallbacks
backs); const jssecuritycallbacks * js_getsecuritycallbacks(jsruntime *rt); /* obsolete since jsapi 13 */ jssecuritycallbacks * js_setcontextsecuritycallbacks(jscontext *cx, jssecuritycallbacks *callbacks); jssecuritycallbacks * js_getruntimesecuritycallbacks(jsruntime *rt); jssecuritycallbacks * js_setruntimesecuritycallbacks(jsruntime *rt, jssecuritycallbacks *callbacks); name type description rt jsruntime * a runtime to get/set the security callbacks.
... contentsecuritypolicyallows; // added in spidermonkey 1.8.5 jssubsumesop subsumes; // added in spidermonkey 31 jscheckaccessop checkobjectaccess; // obsolete since jsapi 29 jsprincipalstranscoder principalstranscoder; // obsolete since jsapi 13 jsobjectprincipalsfinder findobjectprincipals; // obsolete since jsapi 13 }; name type description contentsecuritypolicyallows jscspevalchecker a pointer to the function which checks if a csp instance wants to disable eval() and friends.
JS_HasElement
syntax bool js_haselement(jscontext *cx, js::handleobject obj, uint32_t index, bool *foundp); name type description cx jscontext * the context in which to perform the property lookup.
... description js_haselement examines a specified js object, obj, and its prototype chain, for an element or numeric property numbered index.
JS_HasOwnProperty
syntax bool js_hasownproperty(jscontext* cx, handleobject obj, const char* name, bool* foundp) bool js_hasownpropertybyid(jscontext* cx, handleobject obj, handleid id, bool* foundp) name type description cx jscontext * a context.
... foundp bool * non-null pointer to a variable of type bool.
JS_IdToProtoKey
syntax jsprotokey js_idtoprotokey(jscontext *cx, js::handleid id); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... description js_idtoprotokey converts a specified js id, id, to a prototype key.
JS_InitStandardClasses
syntax bool js_initstandardclasses(jscontext *cx, js::handle<jsobject*> obj); name type description cx jscontext * pointer to the executable script context for which to initialize js function and object classes.
...these include all the standard ecmascript global properties defined in ecma 262-3 §15.1: array, boolean, date, decodeuri, decodeuricomponent, encodeuri, encodeuricomponent, error, eval, evalerror, function, infinity, isnan, isfinite, math, nan, number, object, parseint, parsefloat, 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.
JS_IterateCompartments
syntax void js_iteratecompartments(jsruntime *rt, void *data, jsiteratecompartmentcallback compartmentcallback); name type description cx jsruntime * the runtime of the compartments to iterate over.
... callback function typedef void (*jsiteratecompartmentcallback)(jsruntime *rt, void *data, jscompartment *compartment); name type description cx jsruntime * the runtime of the compartments.
JS_New
syntax jsobject * js_new(jscontext *cx, js::handleobject ctor, const js::handlevaluearray& args); // added in jsapi 32 jsobject * js_new(jscontext *cx, jsobject *ctor, unsigned argc, jsval *argv); // obsolete since jsapi 32 name type description cx jscontext * the context in which to create the new object.
...if ctor is not an object that can be used as a constructor, a typeerror is raised.
JS_NewGlobalObject
syntax jsobject * js_newglobalobject(jscontext *cx, const jsclass *clasp, jsprincipals *principals, js::onnewglobalhookoption hookoption, const js::compartmentoptions &options = js::compartmentoptions()); name type description cx jscontext * the context in which to create the new global object.
...it initially has no prototype either, since it is typically the first object created; call js_initstandardclasses to create all the standard objects, including object.prototype, and set the global object's prototype.
JS_NewPlainObject
syntax jsobject * js_newplainobject(jscontext *cx); name type description cx jscontext * the context in which to create the new object.
... description js_newplainobject creates a new plain object, like new object(), with object.prototype as [[prototype]].
JS_NewPropertyIterator
syntax jsobject * js_newpropertyiterator(jscontext *cx, js::handle<jsobject*> obj); name type description cx jscontext * the js context in which to enumerate properties.
...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.
JS_NewScriptObject
syntax jsobject * js_newscriptobject(jscontext *cx, jsscript *script); name type description cx jscontext * the context in which to create the new script object.
... a script object has no properties, and its prototype is object.prototype.
JS_NewStringCopyN
syntax jsstring * js_newstringcopyn(jscontext *cx, const char *s, size_t n); jsstring * js_newucstringcopyn(jscontext *cx, const char16_t *s, size_t n); name type description cx jscontext * pointer to a js context from which to derive runtime information.
...the two functions differ only in the type of the character array s; both functions create ordinary javascript strings, and all javascript strings are made up of 16-bit characters.
JS_SET_TRACING_DETAILS
syntax js_set_tracing_details(trc, printer, arg, index) name type description trc jstracer * the tracer whose debugging hooks are to be set.
... callback syntax typedef void (*jstracenameprinter)(jstracer *trc, char *buf, size_t bufsize); name type description trc jstracer * the tracer.
JS_ScheduleGC
syntax void js_schedulegc(jscontext *cx, uint32_t count); name type description cx jscontext * a context.
... at this point, if zeal is one of the types that trigger periodic collection, then nextscheduled is reset to the value of frequency.
JS_SetAllNonReservedSlotsToUndefined
syntax void js_setallnonreservedslotstoundefined(jscontext *cx, jsobject *objarg); name type description cx jscontext * the context in which to clear the object.
...properties belonging to objects on obj's prototype chain are not affected.
JS_SetBranchCallback
syntax jsbranchcallback js_setbranchcallback(jscontext *cx, jsbranchcallback cb); name type description cx jscontext * the context to hook.
... callback syntax jsbool (*jsbranchcallback)(jscontext *cx, jsscript *script); name type description cx jscontext * pointer to a jscontext which the callback may use to call into jsapi functions.
JS_SetCallReturnValue2
syntax void js_setcallreturnvalue2(jscontext *cx, jsval v); name type description cx jscontext * the context in which the native function is running.
... description calling js_setcallreturnvalue2 indicates to the runtime that the native will return a value of type reference.
JS_SetCompartmentNameCallback
syntax void js_setcompartmentnamecallback(jsruntime *rt, jscompartmentnamecallback callback); name type description cx jsruntime * the runtime to set the callback function.
... callback function typedef void (* jscompartmentnamecallback)(jsruntime *rt, jscompartment *compartment, char *buf, size_t bufsize); name type description cx jsruntime * the runtime of the compartments.
JS_SetDestroyCompartmentCallback
syntax void js_setdestroycompartmentcallback(jsruntime *rt, jsdestroycompartmentcallback callback); name type description cx jsruntime * the runtime to set the callback function.
... callback function typedef void (* jsdestroycompartmentcallback)(jsfreeop *fop, jscompartment *compartment); name type description cx jsruntime * the runtime of the compartments.
JS_SetErrorReporter
syntax jserrorreporter js_geterrorreporter(jsruntime *rt); jserrorreporter js_seterrorreporter(jsruntime *rt, jserrorreporter er); name type description cx jsruntime * pointer to a js runtime whose errors should be reported via your function.
... callback syntax typedef void (* jserrorreporter)(jscontext *cx, const char *message, jserrorreport *report); name type description cx jscontext * the context in which the error happened.
JS_SetFunctionCallback
syntax void js_setfunctioncallback(jscontext *cx, jsfunctioncallback fcb); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... note that debuggers should probably use js_setcallhook in preference to this function, because it is invoked when the javascript stack is guaranteed to be in a consistent state (and therefore it is valid to inspect and modify local variables, generate stack traces, and set breakpoints.) callback syntax typedef void (* jsfunctioncallback)(const jsfunction *fun,const jsscript *scr, const jscontext *cx, int entering); name type description fun const jsfunction * the javascript function being invoked or exited.
JS_SetGCCallback
syntax void js_setgccallback(jsruntime *rt, jsgccallback cb, void *data); jsgccallback js_setgccallback(jscontext *cx, jsgccallback cb); // obsolete since jsapi 13 jsgccallback js_setgccallbackrt(jsruntime *rt, jsgccallback cb); // obsolete since jsapi 13 name type description cx jscontext * (for the old js_setgccallback) any jscontext.
... callback syntax typedef enum jsgcstatus { jsgc_begin, jsgc_end, jsgc_mark_end, // obsolete since jsapi 13 jsgc_finalize_end // obsolete since jsapi 13 } jsgcstatus; typedef void (* jsgccallback)(jsruntime *rt, jsgcstatus status, void *data); name type description cx jscontext * the context in which garbage collection is happening.
JS_SetInterruptCallback
syntax jsinterruptcallback js_setinterruptcallback(jsruntime *rt, jsinterruptcallback callback); jsinterruptcallback js_getinterruptcallback(jsruntime *rt); void js_requestinterruptcallback(jsruntime *rt); name type description rt jsruntime * the runtime.
... callback syntax bool (* jsinterruptcallback)(jscontext *cx); name type description cx jscontext * pointer to a jscontext in which this callback was installed.
JS_SetPrivate
syntax void js_setprivate(jsobject *obj, void *data); name type description obj jsobject * object for which to set private data.
... description if a jsclass has the jsclass_has_private flag, each object of that class has a private field of type void * which the application may use for any purpose.
JS_SetVersion
syntax jsversion js_setversion(jscontext *cx, jsversion version); name type description cx jscontext * pointer to a js context from which to derive runtime information.
...the version comes from the jsversion enumerated type.
JS_SetVersionForCompartment
syntax void js_setversionforcompartment(jscompartment *compartment, jsversion version); name type description compartment jscompartment * pointer to a js compartment.
...the version comes from the jsversion enumerated type.
JS_THREADSAFE
in this reference, these jsapi functions are marked with the words "requires request", like this: name type description cx jscontext * the context to use.
...these callbacks are (unreliably!) documented with the words "provides request", like this: name type description cx jscontext * the context in which the event ocurred.
JS_TracerInit
syntax void js_tracerinit(jstracer *trc, jsruntime *rt, jstracecallback callback); name type description trc jstracer * the tracer to be initialized.
... callback syntax typedef void (*jstracecallback)(jstracer *trc, void *thing, uint32 kind); name type description trc jstracer * the tracer visiting obj.
JS_ValueToString
syntax jsstring * js_valuetostring(jscontext *cx, jsval v); name type description cx jscontext * the context in which to perform the conversion.
... otherwise conversion fails with a typeerror.
OBJECT_TO_JSVAL
syntax jsval object_to_jsval(jsobject *obj); name type description obj jsobject * a pointer to a javascript object to convert to a jsval.
... description object_to_jsval casts obj from type jsobject * to jsval.
PRIVATE_TO_JSVAL
cast raw void * pointers to type jsval and vice versa.
... the private data pointer can point to application-defined memory of any type, but the pointer must be two-byte-aligned (that is, (int) p must be even).
STRING_TO_JSVAL
syntax jsval string_to_jsval(jsstring *str) name type description obj jsstring * a pointer to a js string to convert to a jsval.
...str must be a non-null pointer of type jsstring *.
jschar
jschar is the type of javascript "characters", the 16-bit elements that make up strings.
... jschar, a typedef for the standard c++ type char16_t, will be removed in jsapi 38.
JSDBGAPI
_settrap js_gettrapopcode js_cleartrap js_clearscripttraps js_clearalltraps js_handletrap js_setinterrupt js_clearinterrupt watchpoints js_setwatchpoint js_clearwatchpoint js_clearwatchpointsforobject js_clearallwatchpoints inspecting the stack js_pctolinenumber js_linenumbertopc js_getfunctionscript js_getfunctionnative js_getfunctionfastnative js_getscriptprincipals typedef jsstackframe js_frameiterator js_getframescript js_getframepc js_getscriptedcaller js_stackframeprincipals js_evalframeprincipals js_getframeannotation js_setframeannotation js_getframeprincipalarray js_isnativeframe js_getframeobject js_getframescopechain js_getframecallobject js_getframethis js_getframefunction js_getframefunctionobject js_isconstructorframe js_isdebugger...
...etframereturnvalue js_setframereturnvalue js_getframecalleeobject js_getscriptfilename js_getscriptbaselinenumber js_getscriptlineextent js_getscriptversion js_gettopscriptfilenameflags js_getscriptfilenameflags js_flagscriptfilenameprefix jsfilename_null jsfilename_system jsfilename_protected evaluating debug code js_evaluateinstackframe examining object properties typedef jspropertydesc jspd_enumerate jspd_readonly jspd_permanent jspd_alias jspd_argument jspd_variable jspd_exception jspd_error typedef jspropertydescarray js_propertyiterator js_getpropertydesc js_getpropertydescarray js_putpropertydescarray hooks js_setdebuggerhandler js_setsourcehandler js_setexecutehook js_setcallhook js_setobjecthook js_setthrowhook js_setdebu...
Signing Mozilla apps for Mac OS X
these types of accounts only allow for the "agent" role to create developer ids.
...the man page for codesign is available online, or you can simply type "man codesign" in a terminal window.
Gecko events
is supported: yes event_dom_significant_change an object's properties or content have changed significantly so that the type of object has really changed, and therefore the accessible should be destroyed or recreated.
... is supported: yes event_asynch_show a hidden object is shown -- this is a layout occurance and is thus asynchronous is supported: yes event_asynch_hide an object is hidden -- this is a layout occurance and is thus asynchronous is supported: yes event_asynch_significant_change an object had a significant layout change which could affect the type of accessible object -- this is a layout occurance and is thus asynchronous is supported: yes event_active_decendent_changed the active descendant of a component has changed.
XForms Accessibility
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 attributes redefines datatype aria attribute.
... its value is xml schema builit-in datatype of instance node that xforms element is bound to.
Retrieving part of the bookmarks tree
rootnode.containeropen = false; if you encounter a node with a type of result_type_folder or another type of container, you can open these folders and descend into the hierarchy.
... you will want to read the section "using the results" in places:query system to understand the different result types.
extIApplication
method overview boolean quit() boolean restart() void getextensions(extiextensionscallback acallback) attributes the following interfaces are available to all applications: attribute type description id readonly attribute astring the id of the application.
...supports: "load", "ready", "quit", "unload" the following interfaces are only available to firefox: attribute type description bookmarks readonly attribute fuelibookmarkroots the root bookmarks object for the application.
Aggregating the In-Memory Datasource
private: nscomptr<nsisupports> minner; }; construct the datasource delegate when your object is constructed (or, at worst, when somebody qi's for it): rv = nscomponentmanager::createinstance( krdfinmemorydatasourcecid, this, /* the "outer" */ nscomtypeinfo<nsisupports>::getiid(), getter_addrefs(minner)); note passing this as the "outer" parameter.
...aresult) return ns_error_null_pointer; if (aiid.equals(nscomtypeinfo<nsimyinterface>::getiid()) || aiid.equals(nscomtypeinfo<nsisupports>::getiid())) { *aresult = ns_static_cast(nsiglobalhistory*, this); } else if (aiid.equals(nscomtypeinfo<nsirdfdatasource>::getiid())) { return minner->queryinterface(aiid, aresult); } else { *aresult = nsnull; return ns_nointerface; } ns_addref(ns_static_cast(nsisupports*, aresult)); retur...
Fun With XBL and XPConnect
<binding name="autocomplete" extends="xul:box"> <content> <xul:textfield class="addressingwidget"/> <xul:menupopup/> </content> <implementation> <property name="autocompletesession"> <![cdata[ components.classes['component://netscape/messenger/autocomplete&type=addrbook'].
... <handlers> <handler type="keypress" keycode="vk_return" value="autocomplete(anonymouscontent[0].value, this.autocompletelistener);"/> </handlers> </implementation> </binding> original document information author(s): scott macgregor last updated date: april 13, 2000 copyright information: copyright (c) scott macgregor ...
Preface
conventions the formatting conventions listed below are used to designate specific types of information in the book and make things easier to scan.
... the goal is to use as few formats as possible, but to distinguish the various different types of information clearly.
Components.utils
getglobalforobject() returns the global object with which a given object is associated (through its prototype chain at birth, for example).
... properties property type description sandbox nsixpccomponents_utils_sandbox creates sandbox objects for use with evalinsandbox().
EndReading
« xpcom api reference summary the endreading function returns a const char_type pointer to the element just beyond the last element of the string's internal buffer.
... const char_type* endreading() const; remarks it is generally illegal to dereference the returned pointer, unless it is known that the string's internal buffer is null-terminated.
EndReading
« xpcom api reference summary the endreading function returns a const char_type pointer to the element just beyond the last element of the string's internal buffer.
... const char_type* endreading() const; remarks it is generally illegal to dereference the returned pointer, unless it is known that the string's internal buffer is null-terminated.
nsDependentCString
this class does not own its data, so the creator of objects of this type must take care to ensure that a nstdependentstring continues to reference valid memory for the duration of its use.
... if size_type(-1) is passed for newlen, then the current length of the string is used.
nsDependentString
this class does not own its data, so the creator of objects of this type must take care to ensure that a nstdependentstring continues to reference valid memory for the duration of its use.
... if size_type(-1) is passed for newlen, then the current length of the string is used.
nsEmbedCString
}; typedefs self_type [nsembedcstring] an alias for the type of this class.
... abstract_string_type [nsacstring] an alias for the abstract string type this class specializes.
nsEmbedString
}; typedefs self_type [nsembedstring] an alias for the type of this class.
... abstract_string_type [nsastring] an alias for the abstract string type this class specializes.
nsXPIDLCString
class declaration nstxpidlstring extends nststring such that: (1) mdata can be null (2) objects of this type can be automatically cast to |const chart*| (3) getter_copies method is supported to adopt data allocated with ns_alloc, such as "out string" parameters in xpidl.
... if size_type(-1) is passed for newlen, then the current length of the string is used.
nsXPIDLString
class declaration nstxpidlstring extends nststring such that: (1) mdata can be null (2) objects of this type can be automatically cast to |const chart*| (3) getter_copies method is supported to adopt data allocated with ns_alloc, such as "out string" parameters in xpidl.
... if size_type(-1) is passed for newlen, then the current length of the string is used.
XPCOM glue classes
it is similar to nscomptr, but does not require that the type be an xpcom interface.
...this is done using the functions addref() and release(), which respectively modify a variable of type nsautorefcnt, which basically is a wrapper around a count of the number of references refering to the class.nsstringclass declarationnsstring externalclass declarationnsstringcontainer (external)class declarationnssupportsweakreferenceinherit from this c++ class to add canonical support for nsisupportsweakreference.nsxpidlcstringclass declarationnsxpidlstringclass declarationpromiseflatcstring (external)class declarationpromiseflatstring (external)class declaration ...
IAccessibleImage
method overview [propget] hresult description([out] bstr description ); [propget] hresult imageposition([in] enum ia2coordinatetype coordinatetype, [out] long x, [out] long y ); [propget] hresult imagesize([out] long height, [out] long width ); methods description() returns the localized description of the image.
...[propget] hresult imageposition( [in] enum ia2coordinatetype coordinatetype, [out] long x, [out] long y ); parameters coordinatetype specifies whether the returned coordinates should be relative to the screen or the parent object.
IAccessibleTable
modelchange() returns the type and extents describing how a table changed.
...[propget] hresult modelchange( [out] ia2tablemodelchange modelchange ); parameters modelchange a struct of (type(insert, delete, update), firstrow, lastrow, firstcolumn, lastcolumn).
IAccessibleTable2
modelchange() returns the type and extents describing how a table changed.
...[propget] hresult modelchange( [out] ia2tablemodelchange modelchange ); parameters modelchange a struct of (type(insert, delete, update), firstrow, lastrow, firstcolumn, lastcolumn).
amIInstallTrigger
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview boolean enabled(); boolean install(in nsivariant aargs, [optional] in amiinstallcallback acallback); boolean installchrome(in pruint32 atype, in astring aurl, in astring askin); deprecated since gecko 2.0 boolean startsoftwareupdate(in astring aurl, [optional] in print32 aflags); deprecated since gecko 2.0 boolean updateenabled(); deprecated since gecko 2.0 constants retained for backwards compatibility.
... boolean installchrome( in pruint32 atype, in astring aurl, in astring askin ); parameters atype unused, retained for backwards compatibility.
mozIAsyncHistory
not providing a visitdate and transitiontype for each mozivisitinfo.
... providing an invalid transitiontype (see nsinavbookmarksservice.constants) for a mozivisitinfo.
mozIStorageError
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports attributes attribute type description message autf8string a human readable error string with details; this may be null if no details are available.
... mismatch 20 a data type mismatch occurred.
mozIStorageService
openspecialdatabase() opens a connection to a named special database storage that identifies the type of storage requested.
...mozistorageconnection openspecialdatabase( in string astoragekey ); parameters astoragekey a string key identifying the type of storage requested.
mozITXTToHTMLConv
constant type description kentities unsigned long enables conversion of basic special characters to html entities.
... warning: don't use the kglyphsubstitution conversion type with this method, as doing so generates html that is non-standard.
mozIVisitInfo
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) attributes attribute type description referreruri nsiuri read only: the referring uri of this visit.
... transitiontype long read only: the transition type used to get to this visit.
nsIAbCard
void copy(in nsiabcard srccard) boolean equals(in nsiabcard card) string converttobase64encodedxml() astring converttoxmlprintdata() string converttoescapedvcard() astring generatename(in long agenerateformat,[optional] in nsistringbundle abundle) astring generatephoneticname(in boolean alastnamefirst) attributes attribute type description firstname astring lastname astring phoneticfirstname astring phoneticlastname astring displayname astring nickname astring primaryemail astring secondemail astring workphone astring homephone astring faxnu...
...mber astring pagernumber astring cellularnumber astring workphonetype astring homephonetype astring faxnumbertype astring pagernumbertype astring cellularnumbertype astring homeaddress astring homeaddress2 astring homecity astring homestate astring homezipcode astring homecountry astring workaddress astring workaddress2 astring workcity astring workstate astring workzipcode astring workcountry astring jobtitle astring department astring ...
nsIAccessibleImage
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void getimageposition(in unsigned long coordtype, out long x, out long y); void getimagesize(out long width, out long height); methods getimageposition() returns the coordinates of the image accessible.
...void getimageposition( in unsigned long coordtype, out long x, out long y ); parameters coordtype specifies coordinates origin (for available constants refer to nsiaccessiblecoordinatetype).
nsIAccessibleRole
it is used for xul:checkbox, html:input@type="checkbox", role="checkbox", boolean xforms:input.
...it is used for xul:radio, html:input@type="radio", role="radio".
nsIAppShellService
attributes attribute type description applicationprovidedhiddenwindow boolean return true if the application hidden window was provided by the application.
... void gethiddenwindowandjscontext( out nsidomwindow ahiddendomwindow, out jscontext ajscontext ); parameters ahiddendomwindow the hidden window queryinterface'd to type nsidomwindow.
nsIChannelEventSink
flags flags indicating the type of redirect.
... flags flags indicating the type of redirect.
nsIChannelPolicy
attributes attribute type description contentsecuritypolicy nsisupports a nsicontentsecuritypolicy object to determine if the load should be allowed.
... loadtype unsigned long indicates what type of content is being loaded, for example nsicontentpolicy::type_image.
nsIClassInfo
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsisupports gethelperforlanguage(in pruint32 language); void getinterfaces(out pruint32 count, [array, size_is(count), retval] out nsiidptr array); attributes attribute type description classdescription string a human readable string naming the class, or null.
... implementationlanguage obsolete since gecko 40 pruint32 the language type in which this class is implemented.
nsICommandLine
ag(in astring aflag, in boolean acasesensitive); astring getargument(in long aindex); boolean handleflag(in astring aflag, in boolean acasesensitive); astring handleflagwithparam(in astring aflag, in boolean acasesensitive); void removearguments(in long astart, in long aend); nsifile resolvefile(in astring aargument); nsiuri resolveuri(in astring aargument); attributes attribute type description length long number of arguments in the command line.
... state unsigned long the type of command line being processed.
nsICommandLineRunner
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsicommandline method overview void init(in long argc, in nscharptrarray argv, in nsifile workingdir, in unsigned long state); void run(); void setwindowcontext(in nsidomwindow awindow); attributes attribute type description helptext autf8string process and combine the help text provided by each command-line handler.
...state the type of command line being processed.
nsIContentPrefService
ivariant agroup, in astring aname); void removegroupedprefs(); void removeobserver(in astring aname, in nsicontentprefobserver aobserver); void removepref(in nsivariant agroup, in astring aname); void removeprefsbyname(in astring aname); void setpref(in nsivariant agroup, in astring aname, in nsivariant avalue); attributes attribute type description dbconnection mozistorageconnection the database connection to the content preferences database.
...the result may be null (nsidatatype:vtype_empty) if the preference's value is either null, or undefined (nsidatatype:vtype_void) if there is no saved preference by the specified name.
nsICookieManager
it is implemented by the @mozilla.org/cookiemanager;1 component, but should generally be accessed via services.cookies method overview void remove(in autf8string ahost, in acstring aname, in autf8string apath, in boolean ablocked, in jsval aoriginattributes); void removeall(); attributes attribute type description enumerator nsisimpleenumerator called to enumerate through each cookie in the cookie list.
... the objects enumerated over are of type nsicookie.
nsIDBFolderInfo
obsolete since gecko 1.8 void setproperty(in string propertyname, in astring propertystr); void setuint32property(in string propertyname, in unsigned long propertyvalue); attributes attribute type description charactersetoverride boolean expiredmark nsmsgkey expungedbytes long flags long folderdate unsigned long foldername string foldersize unsigned long highwate...
...ong imapunreadpendingmessages long knownartsset string locale astring mailboxname astring nummessages long numunreadmessages long sortorder nsmsgviewsortordervalue sorttype nsmsgviewsorttypevalue version unsigned long viewflags nsmsgviewflagstypevalue viewtype nsmsgviewtypevalue methods andflags() long andflags( in long flags ); parameters flags missing description return value missing description exceptions thrown missing excep...
nsIDOMClientRect
the type of box is specified by the method that returns such an object.
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) attributes attribute type description bottom float y-coordinate, relative to the viewport origin, of the bottom of the rectangle box.
nsIDOMGeoPositionAddress
attributes attribute type description city domstring the city.
... historical note, which is likely of no interest to most readers: the types of the attributes below all changed from string to domstring in gecko 1.9.2 beta 5.
nsIDOMHTMLAudioElement
unsigned long mozwriteaudio( in jsval data ); parameters data the samples to write into the audio stream, specified either as a javascript array or as a numeric typed array.
...ns_error_dom_type_mismatch_err the data isn't a valid data type (an array or typed array of numeric values).
nsIDOMOrientationEvent
last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsidomevent method overview void initorientationevent(in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg, in double x, in double y, in double z); attributes attribute type description x double the amount of tilt along the x axis.
...void initprogressevent( in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg, in double x, in double y, in double z ); parameters eventtypearg the type of event.
nsIDOMProgressEvent
method overview void initprogressevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in boolean lengthcomputablearg, in unsigned long long loadedarg, in unsigned long long totalarg); deprecated since gecko 22.0 attributes attribute type description lengthcomputable boolean specifies whether or not the total size of the transfer is known.
... void initprogressevent( in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in boolean lengthcomputablearg, in unsigned long long loadedarg, in unsigned long long totalarg ); parameters typearg the type of event.
nsIDOMStorageEventObsolete
method overview void initstorageevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in domstring keyarg, in domstring oldvaluearg, in domstring newvaluearg, in domstring urlarg, in nsidomstorage storageareaarg); attributes attribute type description domain domstring the domain of the storage area which changed, or "#session" if the event represents a change to session storage.
... void initstorageevent( in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in domstring domainarg ); parameters typearg the type argument.
nsIDOMXPathException
inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description code unsigned short the error code; see error codes for details.
... type_err 52 an attempt was made to reference an unavailable type.
nsIDownload
attributes attribute type description amounttransferred long long the number of bytes downloaded so far.
... mimeinfo nsimimeinfo provides the targets relevant mime information, including its mime type, helper application, and whether or not the helper should be executed automatically once the download is complete.
nsIDragSession
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void getdata( in nsitransferable atransferable, in unsigned long aitemindex ); boolean isdataflavorsupported( in string adataflavor ); attributes attribute type description candrop boolean set the current state of the drag, whether it can be dropped or not.
... boolean isdataflavorsupported( in string adataflavor ); parameters adataflavor a string representing the mime type of the data to be matched, such as "text/unicode".
nsIDroppedLinkItem
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) attributes attribute type description url domstring url of the dropped link.
... type domstring mime-type of the dropped link.
nsIEventListenerInfo
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview nsisupports getdebugobject(); astring tosource(); attributes attribute type description allowsuntrusted boolean indicates whether or not the event listener allows untrusted events.
... type astring the type of the event for which the listener was added.
nsIFeedContainer
it/components/feeds/public/nsifeedcontainer.idlscriptable this interface provides standard fields used by both feeds (nsifeed) and feed entries (nsifeedentry) 1.0 66 introduced gecko 1.8 inherits from: nsifeedelementbase last changed in gecko 1.8.1 (firefox 2 / thunderbird 2 / seamonkey 1.1) method overview void normalize(); attributes attribute type description authors nsiarray an array of nsifeedperson objects describing the authors of the feed or entry.
...consumers can avoid normalization by checking the feed type and accessing specific fields.
nsIFrameScriptLoader
parameters name type description aurl string url for the script to load.
... parameters name type description aurl string url for the script to remove.
nsIHapticFeedback
c feedback (that is, cause the device to vibrate, if it's supported) by calling performsimpleaction(): hapticfeedback.performsimpleaction(components.interfaces.nsihapticfeedback.longpress); method overview void performsimpleaction(in long islongpress); constants press length constants constant value description shortpress 0 specify as the action type to perform a short vibration.
... longpress 1 specify as the action type to perform a long vibration.
nsIJetpack
optional javascript values to send with the message; they must be either json-serializable types or handles.
...the first argument passed to it is the name of the message, and all arguments following it are either json-serializable types or handles.
nsILoadGroup
inherits from: nsirequest last changed in gecko 1.7 method overview void addrequest(in nsirequest arequest, in nsisupports acontext); void removerequest(in nsirequest arequest, in nsisupports acontext, in nsresult astatus); attributes attribute type description activecount unsigned long returns the count of "active" requests (that is requests without the load_background bit set).
...enumerator element type: nsirequest.
nsILocalFile
void reveal(); void setrelativedescriptor(in nsilocalfile fromfile, in acstring relativedesc); attributes attribute type description diskspaceavailable print64 the number of bytes available to non-superuser on the disk volume containing the nsilocalfile.
... return value a pointer to an ansi file type.
nsIMIMEInputStream
to create an instance, use: var mimeinputstream = components.classes["@mozilla.org/network/mime-input-stream;1"] .createinstance(components.interfaces.nsimimeinputstream); method overview void addheader(in string name, in string value); void setdata(in nsiinputstream stream); attributes attribute type description addcontentlength boolean when true a "content-length" header is automatically added to the stream.
... example var postdata = components.classes["@mozilla.org/network/mime-input-stream;1"] .createinstance(components.interfaces.nsimimeinputstream); postdata.addheader("content-type", "application/x-www-form-urlencoded"); postdata.addcontentlength = true; postdata.setdata(stringstream); ...
nsIMacDockSupport
method summary void activateapplication(in boolean aignoreotherapplications); attributes attribute type description badgetext astring text to display in a badge on the application's dock icon.
...two types of elements: menu (if you would like to have sub menu items, make sure to set a label on the "menu" element) menuitem (like in example above) elements can be hidden by adding the hidden attribute to the menu or menuitem and setting it to true .
nsIMemory
there are three specific types of notifications that can occur.
... these types will be passed as the adata parameter of the of the "memory-pressure" notification: "low-memory" this will be passed as the value of adata when a low-memory condition occurs (not necessarily an out-of-memory condition).
nsIMessageBroadcaster
parameters name type description messagename string the name of the message.
...parameters name type description aindex number the index of the subordinate message manager to retrieve.
nsIMsgDBHdr
tring names, in string addresses,in unsigned long numaddresses);new in thunderbird 3.1 [noscript] void getauthorcollationkey(out octetptr key, out unsigned long len); [noscript] void getsubjectcollationkey(out octetptr key, out unsigned long len); [noscript] void getrecipientscollationkey(out octetptr key, out unsigned long len); attributes attribute type description isread boolean readonly: indicates whether or not the message is read.
...this value is extracted from the content-type header.
nsIMsgFilter
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgfilter.idl attributes type attribute nsmsgruleactiontype type; priority // target priority..
...throws an exception if the action is not label attribute nsmsglabelvalue label; junkscore attribute long junkscore; strvalue attribute autf8string strvalue; customid // action id if type is custom attribute acstring customid; customaction // custom action associated with customid // (which must be set prior to reading this attribute) readonly attribute nsimsgfiltercustomaction customaction; methods addterm() void nsimsgfilter::addterm ( in nsmsgsearchattribvalue attrib, in nsmsgsearchopvalue op, in nsimsgsearchvalue value, in boolean ...
nsIMsgFilterList
imsgfilterlist::createfilter ( in astring name ) savetofile() void nsimsgfilterlist::savetofile ( in nsioutputstream stream ) parsecondition() void nsimsgfilterlist::parsecondition ( in nsimsgfilter afilter, in string condition ) savetodefaultfile() void nsimsgfilterlist::savetodefaultfile ( ) applyfilterstohdr() void nsimsgfilterlist::applyfilterstohdr ( in nsmsgfiltertypetype filtertype, in nsimsgdbhdr msghdr, in nsimsgfolder folder, in nsimsgdatabase db, in string headers, in unsigned long headersize, in nsimsgfilterhitnotify listener, in nsimsgwindow msgwindow, in nsilocalfile amessagefile ) writeinattr() void nsimsgfilterlist::writeintattr ( ...
...lterfileattribvalue nsimsgfilterlist::attribversion = 1 const nsmsgfilterfileattribvalue nsimsgfilterlist::attriblogging = 2 const nsmsgfilterfileattribvalue nsimsgfilterlist::attribname = 3 const nsmsgfilterfileattribvalue nsimsgfilterlist::attribenabled = 4 const nsmsgfilterfileattribvalue nsimsgfilterlist::attribdescription = 5 const nsmsgfilterfileattribvalue nsimsgfilterlist::attribtype = 6 const nsmsgfilterfileattribvalue nsimsgfilterlist::attribscriptfile = 7 const nsmsgfilterfileattribvalue nsimsgfilterlist::attribaction = 8 const nsmsgfilterfileattribvalue nsimsgfilterlist::attribactionvalue = 9 const nsmsgfilterfileattribvalue nsimsgfilterlist::attribcondition = 10 ...
nsIMsgIdentity
ng getcharattribute(in string name); void setcharattribute(in string name, in acstring value); boolean getboolattribute(in string name); void setboolattribute(in string name, in boolean value); long getintattribute(in string name); void setintattribute(in string name, in long value); astring tostring(); attributes attribute type description identityname astring fullname astring user's full name, i.e.
... receiptheadertype long readonly: requestdsn boolean readonly: default request for dsn option for this identity.
nsIMsgMessageService
simsgfolder srcfolder, in nsistreamlistener acopylistener, in boolean amovemessage, in nsiurllistener aurllistener, in nsimsgwindow amsgwindow, out nsiuri aurl); void displaymessage(in string amessageuri, in nsisupports adisplayconsumer, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener, in string acharsetoverride, out nsiuri aurl); void openattachment(in string acontenttype, in string afilename, in string aurl, in string amessageuri, in nsisupports adisplayconsumer, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener); void savemessagetodisk(in string amessageuri, in nsifilespec afile, in boolean ageneratedummyenvelope, in nsiurllistener aurllistener, out nsiuri aurl, in boolean canonicallineending, in nsimsgwindow amsgwindow); void geturlfo...
... void openattachment(in string acontenttype, in string afilename, in string aurl, in string amessageuri, in nsisupports adisplayconsumer, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener); parameters acontenttype the content type of the attachment afilename the name of the attachment.
nsIMsgRuleAction
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgfilter.idl [scriptable, uuid(190a2a18-d245-473a-a402-9f0814598c7f)] interface nsimsgruleaction : nsisupports { attribute nsmsgruleactiontype type; // target priority..
...throws an exception if the action is not label attribute nsmsglabelvalue label; // junkscore throws an exception if the action type is not junkscore attribute long junkscore; attribute autf8string strvalue; // action id if type is custom attribute acstring customid; // custom action associated with customid // (which must be set prior to reading this attribute) readonly attribute nsimsgfiltercustomaction customaction; }; ...
nsINavHistoryResultObserver
inavhistoryresultnode aoldnode, in nsinavhistoryresultnode anewnode, in unsigned long aindex); void nodetagschanged(in nsinavhistoryresultnode anode); void nodetitlechanged(in nsinavhistoryresultnode anode, in autf8string anewtitle); void nodeurichanged(in nsinavhistoryresultnode anode, in autf8string anewuri); void sortingchanged(in unsigned short sortingmode); attributes attribute type description result nsinavhistoryresult the nsinavhistoryresult this observer monitors.
...for many other types of views, this will not be applicable.
nsINavHistoryVisitResultNode
toolkit/components/places/public/nsinavhistoryservice.idlscriptable this interface describes a result from a result_type_visit query on the places service.
... 1.0 66 introduced gecko 1.9 inherits from: nsinavhistoryresultnode last changed in gecko 1.9 (firefox 3) attributes attribute type description sessionid long long the session id of the visit, used for session grouping when a tree view is sorted by date.
nsIObserver
a single nsiobserver implementation can observe multiple types of notification, and is responsible for dispatching its own behavior on the basis of the parameters for a given callback.
... function myobserver() { this.register(); } myobserver.prototype = { observe: function(subject, topic, data) { // do your stuff here.
nsIProcessScriptLoader
for example: let ppmm = services.ppmm.getchildat(1); ppmm.loadprocessscript('data:,dump("foo\n");', true); parameters name type description aurl string url for the script to load.
... parameters name type description aurl string url for the script to remove.
nsIPromptService
you need to wrap them in a temporary object, which can be either empty or have a value property set to the out parameter type.
...a delay can be useful not only to give the user more time to think before acting, but also as a countermeasure against malicious web sites that intentionally create a race condition whereby the user intends to click or type a key responding, for example, to the web site's prompt but the security dialog pops up unexpectedly and its button is unintentionally activated.
nsIProtocolHandler
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview boolean allowport(in long port, in string scheme); nsichannel newchannel(in nsiuri auri); nsiuri newuri(in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); attributes attribute type description defaultport long the default port is the port the protocol uses by default.
... uri_forbids_automatic_document_replacement 1<<5 "automatic" loads that would replace the document (such as a meta refresh, certain types of xlinks, and other non-user-triggered loads) are not allowed if the originating uri has this protocol flag.
nsIRadioInterfaceLayer
allback(in nsiriltelephonycallback callback); void registerdatacallcallback(in nsirildatacallback callback); void rejectcall(in unsigned long callindex); void sendsms(in domstring number, in domstring message, in long requestid, in unsigned long long processid); void setupdatacall(in long radiotech, in domstring apn, in domstring user, in domstring passwd, in long chappap, in domstring pdptype); void starttone(in domstring dtmfchar); void stoptone(); void unregistercallback(in nsiriltelephonycallback callback); void unregisterdatacallcallback(in nsirildatacallback callback); attributes attribute type description currentstate jsval read only.
...void setupdatacall( in long radiotech, in domstring apn, in domstring user, in domstring passwd, in long chappap, in domstring pdptype ); parameters radiotech missing description apn missing description user missing description passwd missing description chappap missing description pdptype missing description exceptions thrown missing exception missing description starttone() void starttone( in domstring dtmfchar ); parameters dtmfchar missing description exceptions thrown missing exception missing description stopto...
nsISHistory
tance(components.interfaces.nsishistory); method overview void addshistorylistener(in nsishistorylistener alistener); nsishentry getentryatindex(in long index, in boolean modifyindex); void purgehistory(in long numentries); void reloadcurrententry(); void removeshistorylistener(in nsishistorylistener alistener); attributes attribute type description count long the number of toplevel documents currently available in session history.
...the object returned by this step is of type nsisupports.
nsIScreenManager
nsiscreen screenforrect( in long left, in long top, in long width, in long height ); attributes attribute type description numberofscreens unsigned long the number of screens on the user's computer.
...this pointer's definition is specific to the platform's native widget implementation, and is typically of the same type as ns_native_window.
nsIScriptError
sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in string category); void initwithwindowid(in wstring message, in wstring sourcename, in wstring sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in string category, in unsigned long long innerwindowid); autf8string tostring(); attributes attribute type description category string a string indicating the category of error that occurred see categories for a list.
... categories the web console does not display "xpconnect javascript" "component javascript" "chrome javascript" "chrome registration" "xbl" "xbl prototype handler" "xbl content sink" "xbl javascript" "frameconstructor" categories the web console displays "hudconsole" "css parser" "css loader" "content javascript" "dom events" "dom:html" "dom window" "svg" "imagemap" "html" "canvas" "dom3 load" "dom" "malformed-xml" "dom worker javascript" "mixed content blocker" "csp" "invalid hsts headers" "insecure password field" see ...
nsISessionStartup
to use this service, use: var sessionstartup = components.classes["@mozilla.org/browser/sessionstartup;1"] .getservice(components.interfaces.nsisessionstartup); method overview boolean dorestore(); attributes attribute type description sessiontype unsigned long the type of session being restored; this will be one of the session type constants.
... constants session type constants constant value description no_session 0 there's no data available from the previous session.
nsISound
event_editor_max_len 7 more characters than the maximum allowed are typed into a text field.
...void playsystemsound( in astring soundalias ); parameters soundalias two different types of names are supported: you can specify the name of a system sound provided by the host operating system; for example, if you specify "systemexclamation", you can play the windows alert sound, but it's played only on windows.
nsIStringBundle
do not try to use any other types.
...do not try to use any other types.
nsISyncMessageSender
parameters name type description messagename string the name of the message.
...parameters name type description messagename string the name of the message.
nsIUpdatePatch
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsidomelement serialize(in nsidomdocument updates); attributes attribute type description finalurl astring the final url this patch was being downloaded from.
... type astring the type of patch represented by the object: "partial" a binary difference between two application versions.
nsIWebBrowser
method overview void addwebbrowserlistener(in nsiweakreference alistener, in nsiidref aiid); void removewebbrowserlistener(in nsiweakreference alistener, in nsiidref aiid); attributes attribute type description containerwindow nsiwebbrowserchrome the chrome object associated with the browser instance.
... methods addwebbrowserlistener() registers a listener of the type specified by the iid to receive callbacks.
nsIWebBrowserChrome
inherits from: nsisupports last changed in gecko 0.9.6 method overview void destroybrowserwindow(); void exitmodaleventloop(in nsresult astatus); boolean iswindowmodal(); void setstatus(in unsigned long statustype, in wstring status); void showasmodal(); void sizebrowserto(in long acx, in long acy); attributes attribute type description chromeflags unsigned long the chrome flags for this browser chrome.
...void setstatus( in unsigned long statustype, in wstring status ); parameters statustype indicates what is setting the text.
nsIWebContentHandlerRegistrar
last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) implemented by @mozilla.org/embeddor.implemented/web-content-handler-registrar;1 as a service: var nsiwchr = cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"] .getservice(ci.nsiwebcontenthandlerregistrar); method overview void registercontenthandler(in domstring mimetype, in domstring uri, in domstring title, in nsidomwindow contentwindow) void registerprotocolhandler(in domstring protocol,in domstring uri, in domstring title, in nsidomwindow contentwindow) methods registercontenthandler summary of registercontenthandler void registercontenthandler( in domstring mimetype,...
... in domstring uri, in domstring title, in nsidomwindow contentwindow ); parameters mimetype the desired mime type as a string uri the uri to the handler as a string.
nsIWebNavigation
note for valid load flag combinations look here nsdocshellloadtypes.h stop flags constant value description stop_network 1 this flag specifies that all network activity should be stopped.
... attributes attribute type description cangoback prbool indicates if the object can go back.
nsIWebProgress
last changed in gecko 1.8.0 inherits from: nsisupports method overview void addprogresslistener(in nsiwebprogresslistener alistener, in unsigned long anotifymask); void removeprogresslistener(in nsiwebprogresslistener alistener); attributes attribute type description domwindow nsidomwindow the dom window associated with this nsiwebprogress instance.
...anotifymask the types of notifications to receive.
nsIWebSocketChannel
.createinstance(components.interfaces.nsiwebsocketchannel); method overview void asyncopen(in nsiuri auri, in acstring aorigin, in nsiwebsocketlistener alistener, in nsisupports acontext); void close(in unsigned short acode, in autf8string areason); void sendbinarymsg(in acstring amsg); void sendmsg(in autf8string amsg); attributes attribute type description extensions acstring sec-websocket-extensions response header value.
... 1003 close_unsupported the connection is being terminated because the endpoint received data of a type it cannot accept (for example, a text-only endpoint received binary data).
nsIWindowWatcher
umerator getwindowenumerator(); nsidomwindow openwindow(in nsidomwindow aparent, in string aurl, in string aname, in string afeatures, in nsisupports aarguments); void registernotification(in nsiobserver aobserver); void setwindowcreator(in nsiwindowcreator creator); void unregisternotification(in nsiobserver aobserver); attributes attribute type description activewindow nsidomwindow the watcher serves as a global storage facility for the current active (front most non-floating-palette-type) window, storing and returning it on demand.
... note: supported nsisupportsprimitive objects will be reflected into window.arguments as the base type, however id, void and 64-bit primitive types are not currently supported and will reflect into window.arguments as null.
nsIWorkerMessageEvent
1.0 66 introduced gecko 1.9.1 inherits from: nsidomevent last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void initmessageevent(in domstring atypearg, in boolean acanbubblearg, in boolean acancelablearg, in domstring adataarg, in domstring aoriginarg, in nsisupports asourcearg); attributes attribute type description data domstring the event's data.
... void initmessageevent( in domstring atypearg, in boolean acanbubblearg, in boolean acancelablearg, in domstring adataarg, in domstring aoriginarg, in nsisupports asourcearg ); parameters atypearg the event type.
nsIXMLHttpRequest
true); req.send('your=data&and=more&stuff=here'); example 2 var {cu: utils, cc: classes, ci: instances} = components; cu.import('resource://gre/modules/services.jsm'); function xhr(url, cb) { let xhr = cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createinstance(ci.nsixmlhttprequest); let handler = ev => { evf(m => xhr.removeeventlistener(m, handler, !1)); switch (ev.type) { case 'load': if (xhr.status == 200) { cb(xhr.response); break; } default: services.prompt.alert(null, 'xhr error', 'error fetching package: ' + xhr.statustext + ' [' + ev.type + ':' + xhr.status + ']'); break; } }; let evf = f => ['load', 'error', 'ab...
...ort'].foreach(f); evf(m => xhr.addeventlistener(m, handler, false)); xhr.mozbackgroundrequest = true; xhr.open('get', url, true); xhr.channel.loadflags |= ci.nsirequest.load_anonymous | ci.nsirequest.load_bypass_cache | ci.nsirequest.inhibit_persistent_caching; xhr.responsetype = "arraybuffer"; //dont set it, so it returns string, you dont want arraybuffer.
nsIXSLTProcessor
content/xslt/public/nsixsltprocessor.idlscriptable xslt processor inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/document-transformer;1?type=xslt.
... to create an instance, use: var xsltprocessor = components.classes["@mozilla.org/document-transformer;1?type=xslt"] .createinstance(components.interfaces.nsixsltprocessor); method overview void clearparameters(); nsivariant getparameter(in domstring namespaceuri, in domstring localname); void importstylesheet(in nsidomnode style); void removeparameter(in domstring namespaceuri, in domstring localname); void reset(); void setparameter(in domstring namespaceuri, in domstring localname, in nsivariant value); nsidomdocument transformtodocument(in nsidomnode source); nsidomdocumentfragment transformtofragment(in nsidomnode source, in nsidomdocument output); methods clearparameters() removes all set parameters from this nsixsltprocessor.
nsIXULTemplateBuilder
t(in nsirdfresource anode, in nsiatom atag); void addrulefilter(in nsidomnode arule, in nsixultemplaterulefilter afilter); [noscript] void init(in nsicontent aelement); [noscript] void createcontents(in nsicontent aelement, in boolean aforcecreation); void addlistener(in nsixulbuilderlistener alistener); void removelistener(in nsixulbuilderlistener alistener); attributes attribute type description root nsidomelement readonly: the root node in the dom to which this builder is attached.
...other query processors may use other types for the datasource.
nsIXULTemplateResult
method overview astring getbindingfor(in nsiatom avar); nsisupports getbindingobjectfor(in nsiatom avar); void hasbeenremoved(); void rulematched(in nsisupports aquery, in nsidomnode arulenode); attributes attribute type description id astring id of the result.
... type astring the type of the object.
nsIXULWindow
assumechromeflagsarefrozen(); void center(in nsixulwindow arelative, in boolean ascreen, in boolean aalert); nsixulwindow createnewwindow(in print32 achromeflags, in nsiappshell aappshell); nsidocshelltreeitem getcontentshellbyid(in wstring id); void removechildwindow(in nsixulwindow achild); void showmodal(); attributes attribute type description chromeflags pruint32 chromeflags are from nsiwebbrowserchrome.
... nsidocshelltreeitem getcontentshellbyid( in wstring id ); parameters id the id of the content shell, which is the same as the "type" attribute on the containing frame element.
XPCOM Interface Reference
oragestatementcallbackmozistoragestatementparamsmozistoragestatementrowmozistoragestatementwrappermozistoragevacuumparticipantmozistoragevaluearraymozitxttohtmlconvmozithirdpartyutilmozivisitinfomozivisitinfocallbackmozivisitstatuscallbacknsiabcardnsiaboutmodulensiabstractworkernsiaccelerometerupdatensiaccessnodensiaccessibilityservicensiaccessiblensiaccessiblecaretmoveeventnsiaccessiblecoordinatetypensiaccessibledocumentnsiaccessibleeditabletextnsiaccessibleeventnsiaccessiblehyperlinknsiaccessiblehypertextnsiaccessibleimagensiaccessibleprovidernsiaccessiblerelationnsiaccessibleretrievalnsiaccessiblerolensiaccessiblescrolltypensiaccessibleselectablensiaccessiblestatechangeeventnsiaccessiblestatesnsiaccessibletablensiaccessibletablecellnsiaccessibletablechangeeventnsiaccessibletextnsiaccessible...
...tprequestuploadnsixpcexceptionnsixpcscriptablensixpconnectnsixsltexceptionnsixsltprocessornsixsltprocessorobsoletensixulappinfonsixulbrowserwindownsixulbuilderlistenernsixulruntimensixulsortservicensixultemplatebuildernsixultemplatequeryprocessornsixultemplateresultnsixulwindownsixmlrpcclientnsixmlrpcfaultnsizipentrynsizipreadernsizipreadercachensizipwriternsmsgfilterfileattribvaluensmsgfolderflagtypensmsgjunkstatusnsmsgkeynsmsglabelvaluensmsgpriorityvaluensmsgruleactiontypensmsgsearchattribnsmsgsearchopnsmsgsearchscopensmsgsearchtermnsmsgsearchtypevaluensmsgsearchvaluensmsgsearchwidgetvaluenspipromptservice see also interfaces grouped by function ...
XPCOM primitive
an xpcom primitive is an xpcom object that "boxes" a value of a primitive type.
...(however, if you are designing that kind of api today, you should probably use nsivariant instead.) idl data type interface component idl nsidptr nsisupportsid @mozilla.org/supports-id;1 [scriptable, uuid(d18290a0-4a1c-11d3-9890-006008962422)] interface nsisupportsid : nsisupportsprimitive { attribute nsidptr data; string tostring(); }; astring nsisupportsstring @mozilla.org/supports-string;1 [scriptable, uuid(d79dc970-4a1c-11d3-9890-006008962422)] interface nsisupportsstring : nsisupportsprimiti...
nsGetModuleProc
summary this function prototype provides the xpcom entry-point into a module.
... #include "nsxpcom.h" typedef nsresult (pr_callback *nsgetmoduleproc)( nsicomponentmanager *acompmgr, nsifile* alocation, nsimodule** aresult ); parameters acompmgr [in] the xpcom component manager.
Setting HTTP request headers
var headername = "x-hello"; var headervalue = "world"; function log(text) { // var consoleservice = components.classes["@mozilla.org/consoleservice;1"].getservice(components.interfaces.nsiconsoleservice); // consoleservice.logstringmessage(text); } function myhttplistener() { } myhttplistener.prototype = { observe: function(subject, topic, data) { if (topic == "http-on-modify-request") { log("----------------------------> (" + subject + ") mod request"); var httpchannel = subject.queryinterface(components.interfaces.nsihttpchannel); httpchannel.setrequestheader(headername, headervalue, false); return; } if (topic == "profile-aft...
...alse); return; } }, queryinterface: function (iid) { if (iid.equals(components.interfaces.nsiobserver) || iid.equals(components.interfaces.nsisupports)) return this; components.returncode = components.results.ns_error_no_interface; return null; }, }; var mymodule = { registerself: function (compmgr, filespec, location, type) { var compmgr = compmgr.queryinterface(components.interfaces.nsicomponentregistrar); compmgr.registerfactorylocation(this.mycid, this.myname, this.myprogid, filespec, location, type...
Performance
if the user shuts down the browser soon after you do this type of operation, you can delay shutdown (possibly for many tens of seconds for large numbers of transactions and slow disks), making it look like the browser is hung.
...type "explain" followed by your statement to see the plan.
Storage
in c++, the code would look something like this: bool hasmoredata; while (ns_succeeded(statement->executestep(&hasmoredata)) && hasmoredata) { print32 value; rv = statement->getint32(0, &value); ns_ensure_success(rv, rv); } you can obtain other types of data by using the various methods available on mozistoragevaluearray.
...the latter takes one of three constants to describe the type of transaction: mozistorageconnection.transaction_deferred mozistorageconnection.transaction_immediate mozistorageconnection.transaction_exclusive mozistorageconnection.begintransaction() is equivalent to calling mozistorageconnection.begintransactionas() and passing mozistorageconnection.transaction_deferred.
Weak reference
in fact, nsweakptr is defined like this typedef nscomptr<nsiweakreference> nsweakptr; well this sucks!
... else if ( aiid.equals(nscomtypeinfo<nsisupportsweakreference>::getiid()) ) *ainstancepr = ns_static_cast(nsisupportsweakreference*, this); // ...
Generating xpt on Windows
in order to generate an .xpt file from an .idl file in recent versions of the gecko \ xul runner sdk in windows, you need to use the typelib.py script.
... assuming you installed your xulrunner sdk at <mozsdkdir>, you then need to issue a command similar to c:\working-dir> <mozsdkdir>\sdk\bin\typelib.py <inputfile.idl> -o <outputfile.xpt> -i <mozsdkdir>\idl ...
Testing Mozilla code
there are different types of coverage metrics (see also the wikipedia entry), but when we speak of code coverage here, we usually mean line and branch coverage.
... this type of coverage is only concerned with hit counts for lines and branches.the valgrind test jobthe valgrind test job builds the browser and runs it under valgrind, which can detect various common memory-related errors.
Creating a gloda message query
query.attachmenttypes(mimetype1, mimetype2, ...): constrain to messages with attachments among the given mime types.
... attachmenttypes: a list of the attachment mime types found on this message.
DB Views (message lists)
view flags and types the view flags (external reference) are not exclusive.
... the view types (external reference) are.
Events
composition event name event type fired when...
... folders event name event type fired when...
nsIMsgCloudFileProvider
callback); void createnewaccount(in acstring aemailaddress, in acstring apassword, in acstring afirstname, in acstring alastname, in nsirequestobserver acallback); void createexistingaccount(in nsirequestobserver acallback); acstring providerurlforerror(in unsigned long aerror); attributes attribute type description type acstring readonly: the type is a unique string identifier which can be used by interface elements for styling.
... as such, the type should be an alphanumpheric string with no spaces.
Index
55 thunderbird binaries branch, trunk, comm-central, thunderbird described below are three types of generally available thunderbird packages - releases, early preview releases, and nightly builds (including trunk development builds) - and their downloaded locations.
...if you want to set a debug build as the default mail client, you need configure it manually: 115 using the multiple accounts api by alec flett alecf@flett.org 118 libmime content type handlers by richard h.
Mail event system
methods each event type has a two methods associated with it: notify*<event> - in the nsifolder interface, and nsimsgmailsession interface.
... where <event> is the type of event, such as boolpropertychanged or the generic event .
Adding items to the Folder Pane
item at open (rw, attribute) whether or not this container is open children (attribute) an array of child items also conforming to this spec getproperties (function) a call from getrowproperties or getcellproperties 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.
...es 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 (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: [], getproperties: function gne_kid_getprops() {}, // no-op command: function gne_kid_command() { // just going to alert,...
Building a Thunderbird extension 5: XUL
example xul overlay document create a new file called myhelloworld.xul within the content folder you created earlier with the following content: <?xml version="1.0"?> <overlay id="sample" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://myfirstext/content/overlay.js"/><!-- a reference to your javascript file --> <statusbar id="status-bar"> <statusbarpanel id="my-panel" label="date"/> </statusbar> </overlay> the <statusbar> widget named status-bar specifies the merge point within the application window that we want to attach to.
...in the example above we have defined a new <statusbarpanel> item (that can be referred to as my-panel) which will create a new instance of this widget type and add it at the end of the statusbar.
Styling the Folder Pane
servertype-server afolder.server.type returns the type of the server.
... specialfolder-foldertype afolder.flags & nsmsgfolderflags.<name> returns the folder type if it is a special folder (or "none" if it is a regular folder).
customDBHeaders Preference
user_pref( "mailnews.customdbheaders", "x-superfluous x-other"); adding a column the reply-to column tutorial does a good job of explaining how to add a column with an overlay, so i'll just show you my overlay file: <?xml version="1.0" ?> <overlay id="colsuperfluousoverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type='application/javascript' src='chrome://superfluous/content/superfluous.js'/> <tree id="threadtree"> <treecols id="threadcols"> <splitter class="tree-splitter" /> <treecol id="colsuperfluous" persist="hidden ordinal width" currentview="unthreaded" flex="1" label="superfluous" tooltiptext="click to sort by superfluous" /> </treecols> </tree> ...
...ome://messenger/content/messenger.xul chrome://superfluous/content/superfluous_overlay.xul 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>superfluous@yoursite.com</em:id> <em:version>0.1.1</em:version> <em:type>2</em:type> <!-- 2 is type 'extension' --> <em:targetapplication> <description> <!-- this next line identifies tbird as target --> <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id> <em:minversion>2*</em:minversion> <em:maxversion>3.0.0.*</em:maxversion> </description> </em:targetapplication> <em:name>superfluous</em:nam...
Using JS in Mozilla code
js standard library features feature standard can be used in code new proxy(target, handler) es2015 yes, but getprototypeof and setprototypeof handlers are not yet implemented.
... arraybuffer.transfer() proposed for es2016 no, nightly-only for now sharedarraybuffer, sharedint8array..., atomics proposed for es2016 no, nightly-only for now typedobject proposed for es2016 no, nightly-only for now simd proposed for es2016 no, nightly-only for now ...
Gecko Plugin API Reference - Plugins
plug-in basics how plug-ins are used plug-ins and helper applications how plug-ins work understanding the runtime model plug-in detection how gecko finds plug-ins checking plug-ins by mime type overview of plug-in structure understanding the plug-in api plug-ins and platform independence windowed and windowless plug-ins the default plug-in using html to display plug-ins plug-in display modes using the object element for plug-in display nesting rules for html elements using the appropriate attributes using the embed element for plug-in display using custom embed attributes plug-in references plug-in development overview writing plug-ins registering plug-ins ms windows unix mac os x drawi...
...ng a plug-in instance handling memory sending and receiving streams working with urls getting version and ui information displaying messages on the status line making plug-ins scriptable building plug-ins building, platforms, and compilers building carbonized plug-ins for mac os x type libraries installing plug-ins native installers xpi plug-ins installations plug-in installation and the windows registry initialization and destruction initialization instance creation instance destruction shutdown initialize and shutdown example drawing and event handling the npwindow structure drawing plug-ins printing the plug-in setting the window getting information windowed plug-ins mac os windows unix event handling fo...
Search - Firefox Developer Tools
searching for files to search for a particular file, press control + p (or command + p on a mac) and type the search term.
... the source pane will display a list of all matching files as you type.
Use watchpoints - Firefox Developer Tools
there are three types of watchpoints: get, set, and get or set.
... view a watchpoint when the watched property is accessed in the way specified by the watchpoint type (get or set), the debugger pauses, enabling you to see line of code responsible, and to inspect anything else you wish at that time.
Set event listener breakpoints - Firefox Developer Tools
now the logs will show where in your app jquery was called, rather than where in jquery the event was fired: filter by event type also added to firefox 71 is a new filter by event type...
...when you click in this input and type a search term, the list of event listener types will filter by that term allowing you to find the events you want to break on more easily.
Debugger-API - Firefox Developer Tools
here is a javascript program in the process of running a timer callback function: a running javascript program and its debugger shadows this diagram shows the various types of shadow objects that make up the debugger api (which all follow some general conventions): a debugger.object represents a debuggee object, offering a reflection-oriented api that protects the debugger from accidentally invoking getters, setters, proxy traps, and so on.
... all these types follow some general conventions, which you should look through before drilling down into any particular type’s specification.
Migrating from Firebug - Firefox Developer Tools
this feature can globally be enabled via the break on mutate button, or individually for each element and for different types of changes like attribute changes, content changes or element removal.
... managing breakpoints in firebug you can set different types of breakpoints, which are all listed within the breakpoints side panel.
Throttling - Firefox Developer Tools
the network monitor allows you to throttle your network speed to emulate various connection speeds so you can see how your app will behave under different connection types.
... the characteristics emulated are: download speed upload speed minimum latency the table below lists the numbers associated with each network type, but please do not rely on this feature for exact performance measurements; it's intended to give an approximate idea of the user experience in different conditions.
Network monitor toolbar - Firefox Developer Tools
a set of tool icons: pause (or resume) recording network log search the log request blocking an array of buttons to filter the network request list by type: by the content type of the response xhr requests websocket upgrades and messages (labeled ws) other requests a checkbox that allows you to disable caching.
... throttling menu, to simulate various connection types a menu of other actions: persist logs: by default, the network monitor is cleared each time you navigate to a new page or reload the current page.
Network request details - Firefox Developer Tools
}, { "name": "cache-control", "value": "private, must-revalidate, max-age=0" }, { "name": "content-disposition", "value": "inline; filename=api-result.js" }, { "name": "content-encoding", "value": "gzip" }, { "name": "content-length", "value": "673" }, { "name": "content-type", "value": "text/javascript; charset=utf-8" }, { "name": "date", "value": "tue, 11 jun 2019 13:01:39 gmt" }, { "name": "mediawiki-login-suppressed", "value": "true" }, { "name": "p3p", "value": "cp=\"this is not a p3p policy!
... "value": "ns=-1;special=badtitle;wmf-last-access=11-jun-2019;wmf-last-access-global=11-jun-2019;https=1" }, { "name": "x-cache", "value": "cp1075 pass, cp1075 pass" }, { "name": "x-cache-status", "value": "pass" }, { "name": "x-client-ip", "value": "204.210.158.136" }, { "name": "x-content-type-options", "value": "nosniff" }, { "name": "x-firefox-spdy", "value": "h2" }, { "name": "x-frame-options", "value": "sameorigin" }, { "name": "x-powered-by", "value": "hhvm/3.18.6-dev" }, { "name": "x-search-id", "value": "esvan0r5bnnwscyk2wq09i1im" }, { "name...
Responsive Design Mode - Firefox Developer Tools
in responsive design mode, you can instruct the browser to emulate, very approximately, the characteristics of various different types of networks.
... the characteristics emulated are: download speed upload speed minimum latency the table below lists the numbers associated with each network type, but please do not rely on this feature for exact performance measurements; it's intended to give an approximate idea of the user experience in different conditions.
IndexedDB - Firefox Developer Tools
when you select an origin inside the indexed db storage type in the storage tree of the storage inspector, a table lists the details of all the databases present for that origin.
... storage — the storage type specified for the database.
View Source - Firefox Developer Tools
tree builder errors relating to text (as opposed to tags, comments, or doctypes) aren't reported.
...because of this, doctypes that have an internal subset are not highlighted correctly, and entity references to custom entities are also not highlighted correctly.
Console messages - Firefox Developer Tools
for errors and warnings, when you turn off display of the category, a number appears next to the button text to indicate how many messages of that type are available.
... filtering by text to see only messages that contain a specific string, type in the text box labeled "filter output".
Rich output - Firefox Developer Tools
in particular, it: provides extra information for certain types enables detailed examination of the object's properties provides richer information for dom elements, and enables you to select them in the inspector type-specific rich output the web console provides rich output for many object types, including the following: object array date promise regexp window document element event examining object properties when an object is logged to the console it has a right-pointing triangle next to it, indicating that it can be expanded.
...bject { status: "done", description: "morning pages", datecreated: 1552404478137 } ​ 1: object { status: "in progress", description: "refactor styles", datecreated: 1552404493169 } ​ 2: object { status: "to do", description: "create feedback form", datecreated: 1552404512630 } ​ 3: object { status: "to do", description: "normalize table", datecreated: 1552404533790 } ​ length: 4 ​ <prototype>: array [] debugger eval code:1:9 undefined highlighting and inspecting dom nodes if you hover the mouse over any dom element in the console output, it's highlighted on the page: in the screenshot above you'll also see a blue "target" icon next to the node in the console output: click it to switch to the inspector with that node selected.
AbstractWorker - Web APIs
the abstractworker interface of the web workers api is an abstract interface that defines properties and methods that are common to all types of worker, including not only the basic worker, but also serviceworker and sharedworker.
... event handlers abstractworker.onerror an eventlistener which is invoked whenever an errorevent of type error bubbles through the worker.
AddressErrors - Web APIs
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.
... let supportedhandlers = [ { supportedmethods: "basic-card", data: { supportednetworks: ["visa", "mastercard", "amex", "discover"], supportedtypes: ["credit", "debit"] } } ]; let defaultpaymentdetails = { total: {label: 'donation', amount: {currency: 'usd', value: '65.00'}}, displayitems: [ { label: 'original donation amount', amount: {currency: 'usd', value: '65.00'} } ], shippingoptions: [ { id: 'standard', label: 'standard shipping', amount: {currency: 'usd', value: '0.00'}, ...
Animation() - Web APIs
timeline optional specifies the timeline with which to associate the animation, as an object of a type based on the animationtimeline interface.
... currently the only timeline type available is documenttimeline, but in the future there my be timelines associated with gestures or scrolling, for example.
AnimationEvent() - Web APIs
syntax animationevent = new animationevent(type, {animationname: apropertyname, elapsedtime : afloat, pseudoelement: apseudoelementname}); parameters the animationevent() constructor also inherits arguments from event().
... type a domstring representing the name of the type of the animationevent.
AnimationTimeline - Web APIs
this interface exists to define timeline features (inherited by documenttimeline and future timeline types) and is not itself directly used by developers.
... anywhere you see animationtimeline, you should use documenttimeline or any other timeline type instead.
ArrayBufferView - Web APIs
arraybufferview is a helper type representing any of the following javascript typedarray types: int8array, uint8array, uint8clampedarray, int16array, uint16array, int32array, uint32array, float32array, float64array or dataview.
... this is a helper type to simplify the specification; it isn't an interface, and there are no objects implementing it.
AudioConfiguration - Web APIs
properties the audioconfiguration dictionary is made up of four audio properties, including: contenttype: a valid audio mime type, for information on possible values and what they mean, see the web audio codec guide.
... examples //create media configuration to be tested const mediaconfig = { type : 'file', // 'record', 'transmission', or 'media-source' audio : { contenttype : "audio/ogg", // valid content type channels : 2, // audio channels used by the track bitrate : 132700, // number of bits used to encode 1s of audio samplerate : 5200 // number of audio samples making up that 1s.
AudioContext() - Web APIs
available properties are as follows: latencyhint optional the type of playback that the context will be used for, as a value from the audiocontextlatencycategory enum or a double-precision floating-point value indicating the preferred maximum latency of the context in seconds.
... non-standard exceptions in chrome if the value of the latencyhint property isn't valid, chrome throws a typeerror exception with the message "the provided value '...' is not a valid enum value of type audiocontextlatencycategory".
AudioContextOptions - Web APIs
properties latencyhint optional the type of playback that the context will be used for, as a value from the audiocontextlatencycategory enum or a double-precision floating-point value indicating the preferred maximum latency of the context in seconds.
... constants standard values for latencyhint the latencyhint property can be number specifying a preferred maximum latency in seconds or a string from the audiocontextlatencycategory enumerated string, which selects a standard value for a given type of audio usage: value description "balanced" the user agent should balance audio output latency and power consumption when selecting a latency value.
AudioParam.setValueCurveAtTime() - Web APIs
every value in the array must be a finite number; if any value is nan, infinity, or -infinity, a typeerror exception is thrown.
... typeerror one or more of the values in the values array is non-finite.
AudioTrackList: change event - Web APIs
bubbles no cancelable no interface event event handler property onchange examples using addeventlistener(): const videoelement = document.queryselector('video'); videoelement.audiotracks.addeventlistener('change', (event) => { console.log(`'${event.type}' event fired`); }); // changing the value of `enabled` will trigger the `change` event const toggletrackbutton = document.queryselector('.toggle-track'); toggletrackbutton.addeventlistener('click', () => { const track = videoelement.audiotracks[0]; track.enabled = !track.enabled; }); using the onchange event handler property: const videoelement = document.queryselector('video'); videoele...
...ment.audiotracks.onchange = (event) => { console.log(`'${event.type}' event fired`); }; // changing the value of `enabled` will trigger the `change` event const toggletrackbutton = document.queryselector('.toggle-track'); toggletrackbutton.addeventlistener('click', () => { const track = videoelement.audiotracks[0]; track.enabled = !track.enabled; }); specifications specification status html living standardthe definition of 'change' in that specification.
AuthenticatorResponse.clientDataJSON - Web APIs
properties after the clientdatajson object is converted from an arraybuffer to a javascript object, it will have the following properties: type a string which is either "webauthn.get" when an existing credential is retrieved or "webauthn.create" when a new credential is created.
... examples function arraybuffertostr(buf) { return string.fromcharcode.apply(null, new uint8array(buf)); } // pk is a publickeycredential that is the result of a create() or get() promise var clientdatastr = arraybuffertostr(pk.clientdatajson); var clientdataobj = json.parse(clientdatastr); console.log(clientdataobj.type); // "webauthn.create" or "webauthn.get" console.log(clientdataobj.challenge); // base64 encoded string containing the original challenge console.log(clientdataobj.origin); // the window.origin specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'clientdatajson' in that specificatio...
BaseAudioContext.createBiquadFilter() - Web APIs
the createbiquadfilter() method of the baseaudiocontext interface creates a biquadfilternode, which represents a second order filter configurable as several different common filter types.
... = audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(biquadfilter); biquadfilter.connect(convolver); convolver.connect(gainnode); gainnode.connect(audioctx.destination); // manipulate the biquad filter biquadfilter.type = "lowshelf"; biquadfilter.frequency.setvalueattime(1000, audioctx.currenttime); biquadfilter.gain.setvalueattime(25, audioctx.currenttime); specifications specification status comment web audio apithe definition of 'createbiquadfilter()' in that specification.
BaseAudioContext.decodeAudioData() - Web APIs
older callback syntax in this example, the getdata() function uses xhr to load an audio track, setting the responsetype of the request to arraybuffer so that it returns an array buffer as its response that we then store in the audiodata variable .
...// then we put the buffer into the source function getdata() { source = audioctx.createbuffersource(); var request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { source.buffer = buffer; source.connect(audioctx.destination); source.loop = true; }, function(e){ console.log("error with decoding audio data" + e.err); }); } request.send(); } // wire up buttons to stop a...
BasicCardRequest.supportedNetworks - Web APIs
legal values are defined in the w3c's document card network identifiers approved for use with payment request api, and are currently: amex cartebancaire diners discover jcb mastercard mir unionpay visa example the following example shows a sample definition of the first parameter of the paymentrequest() constructor, the data property of which contains supportednetworks and supportedtypes properties.
... var supportedinstruments = [{ supportedmethods: 'basic-card', data: { supportednetworks: ['visa', 'mastercard', 'amex', 'jcb', 'diners', 'discover', 'mir', 'unionpay'], supportedtypes: ['credit', 'debit'] } }]; var details = { ...
BasicCardRequest - Web APIs
basiccardrequest.supportedtypes optional secure context this obsolete property was used to provide an optional array of domstrings representing the card types that the retailer supports (e.g.
...if the property is missing, it implies that all the card types are supported.
BatteryManager - Web APIs
methods inherited from eventtarget: eventtarget.addeventlistener() registers an event handler of a specific event type on the eventtarget.
... void seteventhandler(domstring type, eventhandler handler) eventhandler geteventhandler(domstring type) specifications specification status comment battery status api candidate recommendation initial definition ...
Using the Beacon API - Web APIs
the data argument is optional and its type may be an arraybufferview, blob, domstring, or formdata.
... window.onload = window.onunload = function analytics(event) { if (!navigator.sendbeacon) return; var url = "https://example.com/analytics"; // create the data to send var data = "state=" + event.type + "&location=" + location.href; // send the beacon var status = navigator.sendbeacon(url, data); // log the data and result console.log("sendbeacon: url = ", url, "; data = ", data, "; status = ", status); }; the following example creates a submit handler and when that event is fired, the handler calls sendbeacon().
Beacon API - Web APIs
the data argument is optional and its type may be an arraybufferview, blob, domstring, or formdata.
...the data argument is optional and its type may be an arraybufferview, blob, domstring, or formdata.
Blob() - Web APIs
WebAPIBlobBlob
options optional an optional object of type blobpropertybag which may specify any of the following properties: type optional the mime type of the data that will be stored into the blob.
... example var afileparts = ['<a id="a"><b id="b">hey!</b></a>']; // an array consisting of a single domstring var omyblob = new blob(afileparts, {type : 'text/html'}); // the blob specification specification status comment file apithe definition of 'blob()' in that specification.
Blob.size - Web APIs
WebAPIBlobsize
example this example uses an <input> element of type file to ask the user for a group of files, then iterates over those files outputting their names and lengths in bytes.
... // fileinput is a htmlinputelement: <input type="file" multiple id="myfileinput"> var fileinput = document.getelementbyid("myfileinput"); // files is a filelist object (simliar to nodelist) var files = fileinput.files; for (var i = 0; i < files.length; i++) { console.log(files[i].name + " has a size of " + files[i].size + " bytes"); } specifications specification status comment file apithe definition of 'blob.size' in that specification.
Blob.slice() - Web APIs
WebAPIBlobslice
syntax var newblob = blob.slice(start, end, contenttype); parameters start optional an index into the blob indicating the first byte to include in the new blob.
... contenttype optional the content type to assign to the new blob; this will be the value of its type property.
BroadcastChannel.onmessage - Web APIs
the broadcastchannel.onmessage event handler is a property that specifies the function to execute when a message event, of type messageevent, is received by this broadcastchannel.
...an event handler always has one single parameter, containing the event, here of type messageevent.
BroadcastChannel - Web APIs
broadcastchannel.onmessageerror an eventhandler called when a messageevent of type messageerror is fired—that is, when it receives a message that cannot be deserialized.
... broadcastchannel.postmessage() sends the message, of any type of object, to each broadcastchannel object listening to the same channel.
BufferSource - Web APIs
buffersource is a typedef used to represent objects that are either themselves an arraybuffer, or which are a typedarray providing an arraybufferview.
... this is a helper type to simplify the specification.
CSSImageValue - Web APIs
the cssimagevalue interface of the css typed object model api represents values for properties that take an image, for example background-image, list-style-image, or border-image-source.
...nst button = document.queryselector( 'button' ); // retrieve all computed styles with computedstylemap() const allcomputedstyles = button.computedstylemap(); // return the cssimagevalue example console.log( allcomputedstyles.get('background-image') ); console.log( allcomputedstyles.get('background-image').tostring() ); specifications specification status comment css typed om level 1the definition of 'cssimagevalue' in that specification.
CSSKeywordValue - Web APIs
the csskeywordvalue interface of the the css typed object model api creates an object to represent css keywords and other identifiers.
...iv id="myelement">check the developer tools to see the log in the console and to inspect the style attribute on this div.</div> let myelement = document.getelementbyid('myelement').attributestylemap; myelement.set('display', new csskeywordvalue('initial')); console.log( myelement.get('display').value); // 'initial' specifications specification status comment css typed om level 1the definition of 'csskeywordvalue' in that specification.
CSSMathProduct - Web APIs
the cssmathproduct interface of the css typed object model api represents the result obtained by calling add(), sub(), or tosum() on cssnumericvalue.
... specifications specification status comment css typed om level 1the definition of 'cssmathproduct' in that specification.
CSSNumericValue.add() - Web APIs
return value a cssmathsum exceptions typeerror indicates that an invalid type was passed to the method.
... examples let mathsum = css.px("23").add(css.percent("4")).add(css.cm("3")).add(css.in("9")); // prints "calc(23px + 4% + 3cm + 9in)" console.log(mathsum.tostring()); specifications specification status comment css typed om level 1the definition of 'add' in that specification.
CSSNumericValue.div() - Web APIs
exceptions typeerror indicates that an invalid type was passed to the method.
... examples let mathproduct = css.px("24").div(css.percent("4")); // prints "calc(24px / 4%)" mathproduct.tostring(); specifications specification status comment css typed om level 1the definition of 'div' in that specification.
CSSNumericValue.mul() - Web APIs
return value a cssmathproduct exceptions typeerror indicates that an invalid type was passed to the method.
... examples let mathsum = css.px("23").mul(css.percent("4")).mul(css.cm("3")).mul(css.in("9")); // prints "calc(23px * 4% * 3cm * 9in)" console.log(mathsum.tostring()); specifications specification status comment css typed om level 1the definition of 'mul' in that specification.
CSSNumericValue.sub() - Web APIs
return value a cssmathsum exceptions typeerror indicates that an invalid type was passed to the method.
... examples let mathsum = css.px("23").sum(css.percent("4")).sum(css.cm("3")).sum(css.in("9")); // prints "calc(23px - 4% - 3cm - 9in)" console.log(mathsum.tostring()); and/or include a list of links to useful code samples that live elsewhere: specifications specification status comment css typed om level 1the definition of 'sub' in that specification.
CSSNumericValue.sum() - Web APIs
syntax var cssmathsum = cssnumericvalue.sub(number); parameters number either a number or a cssmathsum return value a cssmathsum exceptions typeerror indicates that an invalid type was passed to the method.
... examples let mathsum = css.px("23").sum(css.percent("4")).sum(css.cm("3")).sum(css.in("9")); // prints "calc(23px - 4% - 3cm - 9in)" console.log(mathsum.tostring()); and/or include a list of links to useful code samples that live elsewhere: specifications specification status comment css typed om level 1the definition of 'sub' in that specification.
CSSNumericValue.toSum() - Web APIs
exceptions syntaxerror undefined typeerror indicates that an invalid type was passed to the method.
... examples let v = css.px("23").add(css.percent("4")).add(css.cm("3")).add(css.in("9")); v.tostring() // => "calc(23px + 4% + 3cm + 9in)" v.tosum("px", "percent").tostring() // => "calc(1000.39px + 4%)" specifications specification status comment css typed om level 1the definition of 'tosum' in that specification.
CSSPrimitiveValue.getFloatValue() - Web APIs
syntax var floatvalue = cssprimitivevalue.getfloatvalue(unit); parameters unittype an unsigned short representing the code for the unit type, in which the value should be returned.
... exceptions type description domexception an invalid_access_err is raised if the css value doesn't contain a float value or if the float value can't be converted into the specified unit.
CSSPrimitiveValue.setFloatValue() - Web APIs
syntax cssprimitivevalue.setfloatvalue(unittype, floatvalue); parameters unittype an unsigned short representing the code for the unit type, in which the value should be returned.
... exceptions type description domexception an invalid_access_err is raised if the css value doesn't contain a float value or if the string value can't be converted into the specified unit.
CSSPrimitiveValue.setStringValue() - Web APIs
syntax cssprimitivevalue.setstringvalue(stringtype, stringvalue); parameters stringtype an unsigned short representing the type of the value.
... exceptions type description domexception an invalid_access_err is raised if the css value doesn't contain a string value or if the string value can't be converted into the specified unit.
CSSStyleSheet.insertRule() - Web APIs
what the inserted rule must contain depends on its type: for rule-sets, both a selector and a style declaration.
...s a backslash, then isescaped // gets flipped (xor-ed by 1), and if it is not a backslash // then isescaped gets xored by itself, zeroing it isescaped ^= newcharcode===92?1:isescaped; // 92 = "\\".charcodeat(0) } // else, there is no unescaped bracket return originalinsertrule.call(this, selectorandrule, "", arguments[2]); }; } })(cssstylesheet.prototype); specifications specification status comment css object model (cssom)the definition of 'cssstylesheet.insertrule' in that specification.
CSSStyleValue - Web APIs
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.
... specifications specification status comment css typed om level 1the definition of 'cssstylevalue' in that specification.
CSSUnitValue.unit - Web APIs
WebAPICSSUnitValueunit
the cssunitvalue.unit read-only property of the cssunitvalue interface returns a usvstring indicating the type of unit.
... let pos = new csspositionvalue( new cssunitvalue( 5, "px" ), new cssunitvalue( 10, "em" )); console.log( pos.x.unit ); // "px" console.log( pos.y.unit ); // "em" specifications specification status comment css typed om level 1the definition of 'cssunitvalue.unit' in that specification.
CSSUnparsedValue.entries() - Web APIs
the cssunparsedvalue.entries() method 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).
... specifications specification status comment css typed om level 1the definition of 'entries()' in that specification.
CSSVariableReferenceValue - Web APIs
the cssvariablereferencevalue interface of the css typed object model api allows you to create a custom name for a built-in css value.
... specifications specification status comment css typed om level 1the definition of 'cssvariablereferencevalue' in that specification.
CSS Object Model (CSSOM) - Web APIs
css typed object model cssimagevalue csskeywordvalue cssmathinvert cssmathmax cssmathmin cssmathnegate cssmathproduct cssmathsum cssmathvalue cssmatrixcomponent cssnumericarray cssnumericvalue cssperspective csspositionvalue cssrotate cssscale cssskew cssskewx cssskewy cssstylevalue csstransformcomponent csstransformvalue csstransl...
... managing screen orientation specifications specification status comment css typed om level 1 working draft css painting api level 1 working draft extended the css interface with the paintworklet static property.
CSS Painting API - Web APIs
static get inputproperties() { return ['--boxcolor']; } static get inputarguments() { return ['*','<length>']; } static get contextoptions() { return {alpha: true}; } paint(ctx, size, props, args) { const x = 0; const y = size.height * 0.3; const blockwidth = size.width * 0.33; const blockheight = size.height * 0.85; const thecolor = props.get( '--boxcolor' ); const stroketype = args[0].tostring(); const strokewidth = parseint(args[1]); console.log(thecolor); if ( strokewidth ) { ctx.linewidth = strokewidth; } else { ctx.linewidth = 1.0; } if ( stroketype === 'stroke' ) { ctx.fillstyle = 'transparent'; ctx.strokestyle = thecolor; } else if ( stroketype === 'filled' ) { ctx.fillstyle = thecolor; ctx.strokestyle = thecolor; } else {...
...i> <li>item 16</li> <li>item 17</li> <li>item 18</li> <li>item 19</li> <li>item 20</li> </ul> css.paintworklet.addmodule('https://mdn.github.io/houdini-examples/csspaint/intro/worklets/hilite.js'); then we can use the <image> with the css paint() function: li { --boxcolor: hsla(55, 90%, 60%, 1.0); background-image: paint(hollowhighlights, stroke, 2px); } li:nth-of-type(3n) { --boxcolor: hsla(155, 90%, 60%, 1.0); background-image: paint(hollowhighlights, filled, 3px); } li:nth-of-type(3n+1) { --boxcolor: hsla(255, 90%, 60%, 1.0); background-image: paint(hollowhighlights, stroke, 1px); } we've included a custom property in the selector block defining a boxcolor.
CSS Properties and Values API - Web APIs
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.
... examples the following uses css.registerproperty in javascript to type a css custom properties, --my-color, as a color, give it a default value, and not allow it to inherit its value: window.css.registerproperty({ name: '--my-color', syntax: '<color>', inherits: false, initialvalue: '#c0ffee', }); the same registration can take place in css using the following @property: @property --my-color { syntax: '<color>'; inherits: false; initial-value: #c0ffee; } specifications specifica...
Cache.add() - Web APIs
WebAPICacheadd
the add() method is functionally equivalent to the following: fetch(url).then(function(response) { if (!response.ok) { throw new typeerror('bad response status'); } return cache.put(url, response); }) for more complex operations, you'll need to use cache.put() directly.
... exceptions exception happens when typeerror the url scheme is not http or https.
Cache.put() - Web APIs
WebAPICacheput
fetch(url).then(function(response) { if (!response.ok) { throw new typeerror('bad response status'); } return cache.put(url, response); }) note: put() will overwrite any key/value pair previously stored in the cache that matches the request.
... note: the promise will reject with a typeerror if the url scheme is not http or https.
CanvasRenderingContext2D - Web APIs
canvasrenderingcontext2d.linecap type of endings on the end of lines.
... canvasrenderingcontext2d.linejoin defines the type of corners where two lines meet.
Manipulating video using canvas - Web APIs
<!doctype html> <html> <head> <style> body { background: black; color:#cccccc; } #c2 { background-image: url(media/foo.png); background-repeat: no-repeat; } div { float: left; border :1px solid #444444; padding:10px; margin: 10px; background:#3b3b3b; } </style> </head> <body> <div> ...
... <video id="video" src="media/video.mp4" controls="true" crossorigin="anonymous"/> </div> <div> <canvas id="c1" width="160" height="96"></canvas> <canvas id="c2" width="160" height="96"></canvas> </div> <script type="text/javascript" src="processor.js"></script> </body> </html> the key bits to take away from this are: this document establishes two canvas elements, with the ids c1 and c2.
Basic animations - Web APIs
<canvas id="canvas" width="800" height="200"></canvas> mouse following animation <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>document</title> <script> var cn; //= document.getelementbyid('cw'); var c; var u = 10; const m = { ...
...t> <style> #cw { position: fixed; z-index: -1; } body { margin: 0; padding: 0; background-color: rgba(0,0,0,0.05); } </style> </head> <body> <canvas id="cw"></canvas> </body> </html> output snake game <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>nokia 1100:snake..member berries</title> </head> <body> <div class="keypress hide"> <div class="up" onclick="emit(38)">&#8593;</div> <div class="right" onclick="emit(39)">&#8594;<...
Using images - Web APIs
getting images to draw the canvas api is able to use any of the following data types as an image source: htmlimageelement these are images created using the image() constructor, as well as any <img> element.
... these sources are collectively referred to by the type canvasimagesource.
ChildNode.before() - Web APIs
WebAPIChildNodebefore
following code: // from: https://github.com/jserz/js_piece/blob/master/dom/childnode/before()/before().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('before')) { return; } object.defineproperty(item, 'before', { configurable: true, enumerable: true, writable: true, value: function before() { var argarr = array.prototype.slice.call(arguments), docfrag = document.createdocumentfragment(); argarr.foreach(function (argitem) { var isnode = argitem instanceof node; docfrag.appendchild(isnode ?
... argitem : document.createtextnode(string(argitem))); }); this.parentnode.insertbefore(docfrag, this); } }); }); })([element.prototype, characterdata.prototype, documenttype.prototype]); specification specification status comment domthe definition of 'childnode.before()' in that specification.
ChildNode.replaceWith() - Web APIs
10+ and higher with the following code: function replacewithpolyfill() { 'use-strict'; // for safari, and ie > 10 var parent = this.parentnode, i = arguments.length, currentnode; if (!parent) return; if (!i) // if there are no arguments parent.removechild(this); while (i--) { // i-- decrements i and returns the value of i before the decrement currentnode = arguments[i]; if (typeof currentnode !== 'object'){ currentnode = this.ownerdocument.createtextnode(currentnode); } else if (currentnode.parentnode){ currentnode.parentnode.removechild(currentnode); } // the value of "i" below is after the decrement if (!i) // if currentnode is the first argument (currentnode === arguments[0]) parent.replacechild(currentnode, this); else // if curr...
...entnode isn't the first parent.insertbefore(currentnode, this.nextsibling); } } if (!element.prototype.replacewith) element.prototype.replacewith = replacewithpolyfill; if (!characterdata.prototype.replacewith) characterdata.prototype.replacewith = replacewithpolyfill; if (!documenttype.prototype.replacewith) documenttype.prototype.replacewith = replacewithpolyfill; specification specification status comment domthe definition of 'childnode.replacewith()' in that specification.
Clipboard.read() - Web APIs
WebAPIClipboardread
if (result.state == "granted" || result.state == "prompt") { navigator.clipboard.read().then(data => { for (let i=0; i<data.items.length; i++) { if (data.items[i].type != "image/png") { alert("clipboard contains non-image data.
... unable to access it."); } else { const blob = data.items[i].gettype("image/png"); imgelem.src = url.createobjecturl(blob); } } }); } }); note: at this time, while firefox does implement read(), it does not recognize the "clipboard-read" permission, so attempting to use the permissions api to manage access to the api will not work.
Clipboard.write() - Web APIs
WebAPIClipboardwrite
the key of the object passed to the clipboarditem constructor indicates the content type, the value indicates the content.
... example of copying canvas contents to the clipboard function copycanvascontentstoclipboard(canvas, ondone, onerror) { canvas.toblob(function (blob) { let data = [new clipboarditem({ [blob.type]: blob })]; navigator.clipboard.write(data).then(function () { ondone(); }, function (err) { onerror(err); }) }); } note: you can only pass in one clipboard item at a time.
ClipboardItem() - Web APIs
syntax var clipboarditem = new clipboarditem(clipboarditemdata); parameters clipboarditemdata an object with the mime type as the key and blob as the value.
... async function writeclipimg() { try { const imgurl = '/myimage.png'; const data = await fetch(imgurl); const blob = await data.blob(); await navigator.clipboard.write([ new clipboarditem({ [blob.type]: blob }) ]); console.log('fetched image copied.'); } catch(err) { console.error(err.name, err.message); } } specifications specification status comment clipboard api and eventsthe definition of 'clipboarditem' in that specification.
CloseEvent.initCloseEvent() - Web APIs
syntax event.initmouseevent(type, canbubble, cancelable, wasclean, reasoncode, reason); parameters type the string to set the event's type to.
... possible types for mouse events include: click, mousedown, mouseup, mouseover, mousemove, mouseout.
Console.table() - Web APIs
WebAPIConsoletable
collections of primitive types the data argument may be an array or an object.
... // an array of strings console.table(["apples", "oranges", "bananas"]); // an object whose properties are strings function person(firstname, lastname) { this.firstname = firstname; this.lastname = lastname; } var me = new person("john", "smith"); console.table(me); collections of compound types if the elements in the array, or properties in the object, are themselves arrays or objects, then their elements or properties are enumerated in the row, one per column: // an array of arrays var people = [["john", "smith"], ["jane", "doe"], ["emily", "jones"]] console.table(people); // an array of objects function person(firstname, lastname) { this.firstname = firstname; this.lastname = lastname; } var john = new person("john", "smith"); var jane = new person("jane", "doe");...
ConstrainBoolean - Web APIs
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 sake of documentation clarity, the intermediate type (present only because of quirks in webidl syntax) is ignored here.
Constraint validation API - Web APIs
invalid event this event type is fired at a form control element if the element does not satisfy its constraints.
... examples take the following form: <form> <label for="name">enter username (upper and lowercase letters): </label> <input type="text" name="name" id="name" required pattern="[a-za-z]+"> <button>submit</button> </form> the basic html form validation features will cause this to produce a default error message if you try to submit the form with either no valid filled in, or a value that does not match the pattern.
ContentIndexEvent() - Web APIs
the contentindexevent() constructor creates a new contentindexevent object whose type and other options are configured as specified.
... syntax var contentindexevent = new contentindexevent(type, contentindexeventinit); parameters type a domstring indicating the event which occurred.
CredentialsContainer.get() - Web APIs
this method collects credentials by calling the "collectfromcredentialstore" method for each credential type allowed by the options argument.
... syntax var promise = credentialscontainer.get([options]) parameters options optional an object of type credentialrequestoptions that contains options for the request.
CustomElementRegistry.define() - Web APIs
there are two types of custom elements you can create: autonomous custom element: standalone elements; they don't inherit from built-in html elements.
... typeerror the referenced constructor is not a constructor.
DOMMatrix - Web APIs
WebAPIDOMMatrix
otherwise, a typeerror exception is thrown.
...otherwise, a typeerror exception is thrown.
DOMMatrixReadOnly - Web APIs
otherwise, a typeerror exception is thrown.
...otherwise, a typeerror exception is thrown.
DOMObject - Web APIs
WebAPIDOMObject
the obsolete domobject interface was used in earlier versions of the dom specification as the base class for any object data type.
... the specifications now simply use the javascript object type.
Binary strings - Web APIs
WebAPIDOMStringBinary
javascript typed arrays provide a mechanism for accessing raw binary data much more efficiently.
... the stringview non native constructor is one level above typed arrays and provides a c-like interface for strings.
DataTransfer.mozGetDataAt() - Web APIs
syntax nsivariant datatransfer.mozgetdataat([type], index); arguments type a string representing the type of the drag data to retrieve from the drag data object.
... function drop_handler(event) { var dt = event.datatransfer; var count = dt.mozitemcount; output("items: " + count + "\n"); for (var i = 0; i < count; i++) { output(" item " + i + ":\n"); var types = dt.moztypesat(i); for (var t = 0; t < types.length; t++) { output(" " + types[t] + ": "); try { var data = dt.mozgetdataat(types[t], i); output("(" + (typeof data) + ") : <" + data + " >\n"); } catch (ex) { output("<>\n"); dump(ex); } } } } specifications this method is not defined in any web standard.
DataTransfer.mozSetDataAt() - Web APIs
the data should be either a string, a boolean or number type (which will be converted into a string) or an nsisupports.
... syntax void datatransfer.mozsetdataat([type], data, index); arguments type a string representing the type of the drag data to add to the drag data object.
DataTransferItem.kind - Web APIs
function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = event.datatransfer.items; for (var i = 0; i < data.length; i += 1) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/html'))) { // drag data item is html console.log("...
... drop: html"); } else if ((data[i].kind == 'file') && (data[i].type.match('^image/'))) { // drag data item is an image file var f = data[i].getasfile(); console.log("...
DataTransferItemList.DataTransferItem() - Web APIs
paragraph ...</p>", "text/html"); datalist.add("http://www.example.org","text/uri-list"); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = ev.datatransfer.items; // loop through the dropped items and log their data for (var i = 0; i < data.length; i++) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/html'))) { // drag data item is html data[i].getasstring(function (s){ console.log("...
... drop: html = " + s); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/uri-list'))) { // drag data item is uri data[i].getasstring(function (s){ console.log("...
DataTransferItemList.clear() - Web APIs
paragraph ...</p>", "text/html"); datalist.add("http://www.example.org","text/uri-list"); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = event.datatransfer.items; // loop through the dropped items and log their data for (var i = 0; i < data.length; i++) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/html'))) { // drag data item is html data[i].getasstring(function (s){ console.log("...
... drop: html = " + s); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/uri-list'))) { // drag data item is uri data[i].getasstring(function (s){ console.log("...
DataTransferItemList.length - Web APIs
paragraph ...</p>", "text/html"); datalist.add("http://www.example.org","text/uri-list"); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = ev.datatransfer.items; // loop through the dropped items and log their data for (var i = 0; i < data.length; i++) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/html'))) { // drag data item is html data[i].getasstring(function (s){ console.log("...
... drop: html = " + s); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/uri-list'))) { // drag data item is uri data[i].getasstring(function (s){ console.log("...
DataTransferItemList.remove() - Web APIs
paragraph ...</p>", "text/html"); datalist.add("http://www.example.org","text/uri-list"); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = event.datatransfer.items; // loop through the dropped items and log their data for (var i = 0; i < data.length; i++) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/html'))) { // drag data item is html data[i].getasstring(function (s){ console.log("...
... drop: html = " + s); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/uri-list'))) { // drag data item is uri data[i].getasstring(function (s){ console.log("...
DeprecationReportBody - Web APIs
examples in our deprecation_report.html example, we create a simple reporting observer to observe usage of deprecated features on our web page: let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { reportbtn.onclick = () => displayreports(reports); }, options); we then tell it to start observing reports using reportingobserver.observe(); this tells the observer to start collecting reports in its report queue, and runs the callback function specified inside the constructor: observer.
...ch takes the observer callback's reports parameter as its parameter: function displayreports(reports) { const outputelem = document.queryselector('.output'); const list = document.createelement('ul'); outputelem.appendchild(list); for(let i = 0; i < reports.length; i++) { let listitem = document.createelement('li'); let textnode = document.createtextnode('report ' + (i + 1) + ', type: ' + reports[i].type); listitem.appendchild(textnode); let innerlist = document.createelement('ul'); listitem.appendchild(innerlist); list.appendchild(listitem); for (let key in reports[i].body) { let innerlistitem = document.createelement('li'); let keyvalue = reports[i].body[key]; innerlistitem.textcontent = key + ': ' + keyvalue; innerlist.appendchi...
DirectoryEntrySync - Web APIs
[ todo: explain why ] type_mismatch_err the path supplied exists, but it is not a directory.
...[ todo: explain why ] type_mismatch_err the path supplied exists, but it is not a directory.
DisplayMediaStreamConstraints - Web APIs
the displaymediastreamconstraints dictionary is used to specify whether or not to include video and/or audio tracks in the mediastream to be returned by getdisplaymedia(), as well as what type of processing must be applied to the tracks.
...a value of false is not permitted, and results in a typeerror being thrown.
Document.createElement() - Web APIs
syntax let element = document.createelement(tagname[, options]); parameters tagname a string that specifies the type of element to be created.
... html <!doctype html> <html> <head> <title>||working with elements||</title> </head> <body> <div id="div1">the text above has been created dynamically.</div> </body> </html> javascript document.body.onload = addelement; function addelement () { // create a new div element const newdiv = document.createelement("div"); // and give it some content const newcontent = document.createtextnode("hi ther...
Document.createElementNS() - Web APIs
qualifiedname a string that specifies the type of element to be created.
...although this is not an extremely useful xul document, it does demonstrate the use of elements from two different namespaces within a single document: <?xml version="1.0"?> <page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml" title="||working with elements||" onload="init()"> <script type="application/javascript"><![cdata[ let container; let newdiv; let txtnode; function init(){ container = document.getelementbyid("containerbox"); newdiv = document.createelementns("http://www.w3.org/1999/xhtml", "div"); txtnode = document.createtextnode("this is text that was constructed dynamically with createelementns and createtextnode then inserted into the document using appendc...
Document.createNodeIterator() - Web APIs
it is a convenient way of filtering for certain types of node.
... nodefilter.show_document_type 512 shows documenttype nodes.
Document.createTreeWalker() - Web APIs
it is a convenient way of filtering for certain types of node.
... nodefilter.show_document_type 512 shows documenttype nodes.
Document.forms - Web APIs
WebAPIDocumentforms
examples getting form information <!doctype html> <html lang="en"> <head> <title>document.forms example</title> </head> <body> <form id="robby"> <input type="button" onclick="alert(document.forms[0].id);" value="robby's form" /> </form> <form id="dave"> <input type="button" onclick="alert(document.forms[1].id);" value="dave's form" /> </form> <form id="paul"> <input type="button" onclick="alert(document.forms[2].id);" value="pau...
...l's form" /> </form> </body> </html> getting an element from within a form var selectform = document.forms[index]; var selectformelement = document.forms[index].elements[index]; named form access <!doctype html> <html lang="en"> <head> <title>document.forms example</title> </head> <body> <form name="login"> <input name="email" type="email"> <input name="password" type="password"> <button type="submit">log in</button> </form> <script> var loginform = document.forms.login; // or document.forms['login'] loginform.elements.email.placeholder = 'test@example.com'; loginform.elements.password.placeholder = 'password'; </script> </body> </html> specifications specification status comment html living standardthe definition of 'document.forms' in th...
Document.getElementsByClassName() - Web APIs
and 'test' classes: document.getelementsbyclassname('red test') get all elements that have a class of 'test', inside of an element that has the id of 'main': document.getelementbyid('main').getelementsbyclassname('test') get the first element with a class of 'test', or undefined if there is no matching element: document.getelementsbyclassname('test')[0] we can also use methods of array.prototype on any htmlcollection by passing the htmlcollection as the method's this value.
... here we'll find all div elements that have a class of 'test': var testelements = document.getelementsbyclassname('test'); var testdivs = array.prototype.filter.call(testelements, function(testelement){ return testelement.nodename === 'div'; }); get the first element whose class is 'test' this is the most commonly used method of operation.
Document.getElementsByTagNameNS() - Web APIs
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>getelementsbytagnamens example</title> <script type="text/javascript"> function getallparaelems() { var allparas = document.getelementsbytagnamens("http://www.w3.org/1999/xhtml", "p"); var num = allparas.length; alert("there are " + num + " &lt;p&gt; elements in this document"); } function div1paraelems() { var div1 = document.getelementbyid("div1") var div1paras = div1.getelementsbytagnamens("http://www.w3.org/1999/xhtml", "p"); ...
...ad of the xpath in the function below (as explorer supports xpath with a different api), such as this wrapper class.) function getelementsbytagnamenswrapper (ns, elname, doc, context) { if (!doc) { doc = document; } if (!context) { context = doc; } var result = doc.evaluate('//*[local-name()="'+elname+'" and namespace-uri() = "'+ns+'"]', context, null, xpathresult.ordered_node_snapshot_type, null); var a = []; for(var i = 0; i < result.snapshotlength; i++) { a[i] = result.snapshotitem(i); } return a; } specifications specification status comment domthe definition of 'document.getelementsbytagnamens' in that specification.
Document.head - Web APIs
WebAPIDocumenthead
example <!doctype html> <head id="my-document-head"> <title>example: using document.head</title> </head> <script> var thehead = document.head; console.log(thehead.id); // "my-document-head"; console.log( thehead === document.queryselector("head") ); // true </script> notes document.head is read-only.
... trying to assign a value to this property will fail silently or, in strict mode, throws a typeerror .
Example - Web APIs
<html> <head> <title>my document</title> <script type="text/javascript"> function change() { // document.getelementsbytagname("h1") returns a nodelist of the h1 // elements in the document, and the first is number 0: var header = document.getelementsbytagname("h1").item(0); // the firstchild of the header is a text node: header.firstchild.data = "a dynamic document"; // now the header is "a dynamic document".
...); // create a new element to be the second paragraph var newelement = document.createelement("p"); // put the text in the paragraph newelement.appendchild(newtext); // and put the paragraph on the end of the document by appending it to // the body (which is the parent of para) para.parentnode.appendchild(newelement); } </script> </head> <body> <input type="button" value="change this document." onclick="change()"> <h1>header</h1> <p>paragraph</p> </body> </head> ...
Using the W3C DOM Level 1 Core - Web APIs
the w3c's dom level 1 core is an api for manipulating the dom trees of html and xml documents (among other tree-like types of documents).
...the following script would do the job: html content <body> <input type="button" value="change this document." onclick="change()"> <h2>header</h2> <p>paragraph</p> </body> javascript content function change() { // document.getelementsbytagname("h2") returns a nodelist of the <h2> // elements in the document, and the first is number 0: var header = document.getelementsbytagname("h2").item(0); // the firstchild of the header is a text node: he...
DragEvent() - Web APIs
syntax event = new dragevent(type, drageventinit); arguments type is a domstring representing the name of the event (see dragevent event types).
...the type is datatransfer.
DragEvent - Web APIs
WebAPIDragEvent
event types drag this event is fired when an element or text selection is being dragged.
... example an example of each property, constructor, event type and global event handlers is included in their respective reference page.
Element: DOMActivate event - Web APIs
bbles yes cancelable yes interface mouseevent examples <svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseprofile="tiny" xmlns:ev="http://www.w3.org/2001/xml-events" width="6cm" height="5cm" viewbox="0 0 600 500"> <desc>example: invoke an ecmascript function from a domactivate event</desc> <!-- ecmascript to change the radius --> <script type="application/ecmascript"><![cdata[ function change(evt) { var circle = evt.target; var currentradius = circle.getfloattrait("r"); if (currentradius == 100) circle.setfloattrait("r", currentradius * 2); else circle.setfloattrait("r", currentradius * 0.5); } ]]></script> <!-- act on each domactivate event --> <circle cx="300" cy="225" r="100" f...
...ill="red"> <handler type="application/ecmascript" ev:event="domactivate"> change(evt); </handler> </circle> <text x="300" y="480" font-family="verdana" font-size="35" text-anchor="middle"> activate the circle to change its size </text> </svg> specifications specification status ui eventsthe definition of 'domactivate' in that specification.
Element.attributes - Web APIs
<!doctype html> <html> <head> <title>attributes example</title> <script type="text/javascript"> function listattributes() { var paragraph = document.getelementbyid("paragraph"); var result = document.getelementbyid("result"); // first, let's verify that the paragraph has some attributes if (paragraph.hasattributes()) { var attrs = paragraph.attributes; var outpu...
...t = ""; for(var i = attrs.length - 1; i >= 0; i--) { output += attrs[i].name + "->" + attrs[i].value; } result.value = output; } else { result.value = "no attributes to show"; } } </script> </head> <body> <p id="paragraph" style="color: green;">sample paragraph</p> <form action=""> <p> <input type="button" value="show first attribute name and value" onclick="listattributes();"> <input id="result" type="text" value=""> </p> </form> </body> </html> specifications specification status comment domthe definition of 'element.attributes' in that specification.
Element: blur event - Web APIs
bubbles no cancelable no interface focusevent event handler property onblur sync / async sync composed yes examples simple example html <form id="form"> <input type="text" placeholder="text input"> <input type="password" placeholder="password"> </form> javascript const password = document.queryselector('input[type="password"]'); password.addeventlistener('focus', (event) => { event.target.style.background = 'pink'; }); password.addeventlistener('blur', (event) => { event.target.style.background = ''; }); result event delegation there are two w...
... html <form id="form"> <input type="text" placeholder="text input"> <input type="password" placeholder="password"> </form> javascript const form = document.getelementbyid('form'); form.addeventlistener('focus', (event) => { event.target.style.background = 'pink'; }, true); form.addeventlistener('blur', (event) => { event.target.style.background = ''; }, true); result specifications specification status comment ui events working draft added info that this event is composed.
Element.closest() - Web APIs
WebAPIElementclosest
"); // returns the closest ancestor which is a div and has a parent article, here it is the div-01 var r4 = el.closest(":not(div)"); // returns the closest ancestor which is not a div, here it is the outmost article polyfill for browsers that do not support element.closest(), but carry support for element.matches() (or a prefixed equivalent, meaning ie9+), a polyfill exists: if (!element.prototype.matches) { element.prototype.matches = element.prototype.msmatchesselector || element.prototype.webkitmatchesselector; } if (!element.prototype.closest) { element.prototype.closest = function(s) { var el = this; do { if (element.prototype.matches.call(el, s)) return el; el = el.parentelement || el.parentnode; } while (el !== null && el.nodetype === 1); re...
... if (window.element && !element.prototype.closest) { element.prototype.closest = function(s) { var matches = (this.document || this.ownerdocument).queryselectorall(s), i, el = this; do { i = matches.length; while (--i >= 0 && matches.item(i) !== el) {}; } while ((i < 0) && (el = el.parentelement)); return el; }; } specifications specification status comment domthe definition of 'element.closest()' in that specification.
Element: error event - Web APIs
examples live example html <div class="controls"> <button id="img-error" type="button">generate image error</button> <img class="bad-img" /> </div> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="30"></textarea> </div> css body { display: grid; grid-template-areas: "control log"; } .controls { grid-area: control; display: flex; align-items: center; justify-content: center; } .event-log ...
...{ grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } button { height: 2rem; margin: .5rem; } img { width: 0; height: 0; } js const log = document.queryselector('.event-log-contents'); const badimg = document.queryselector('.bad-img'); badimg.addeventlistener('error', (event) => { log.textcontent = log.textcontent + `${event.type}: loading image\n`; console.log(event) }); const imgerror = document.queryselector('#img-error'); imgerror.addeventlistener('click', () => { badimg.setattribute('src', 'i-dont-exist'); }); result specifications specification status ui events working draft ...
Element: focus event - Web APIs
bubbles no cancelable no interface focusevent event handler property onfocus sync / async sync composed yes examples simple example html <form id="form"> <input type="text" placeholder="text input"> <input type="password" placeholder="password"> </form> javascript const password = document.queryselector('input[type="password"]'); password.addeventlistener('focus', (event) => { event.target.style.background = 'pink'; }); password.addeventlistener('blur', (event) => { event.target.style.background = ''; }); result event delegation there are two w...
... html <form id="form"> <input type="text" placeholder="text input"> <input type="password" placeholder="password"> </form> javascript const form = document.getelementbyid('form'); form.addeventlistener('focus', (event) => { event.target.style.background = 'pink'; }, true); form.addeventlistener('blur', (event) => { event.target.style.background = ''; }, true); result specifications specification status comment ui events working draft added info that this event is composed.
Element.getAttributeNS() - Web APIs
<svg xmlns="http://www.w3.org/2000/svg" xmlns:test="http://www.example.com/2014/test" width="40" height="40"> <circle id="target" cx="12" cy="12" r="10" stroke="#444" stroke-width="2" fill="none" test:foo="hello namespaced attribute!"/> <script type="text/javascript"> var ns = 'http://www.example.com/2014/test'; var circle = document.getelementbyid( 'target' ); console.log( 'attribute test:foo: "' + circle.getattributens( ns, 'foo' ) + '"' ); </script> </svg> in an html5 document the attribute has to be accessed with test:foo since namespaces are not supported.
... <!doctype html> <html> <body> <svg xmlns="http://www.w3.org/2000/svg" xmlns:test="http://www.example.com/2014/test" width="40" height="40"> <circle id="target" cx="12" cy="12" r="10" stroke="#444" stroke-width="2" fill="none" test:foo="foo value"/> </svg> <script type="text/javascript"> var ns = 'http://www.example.com/2014/test'; var circle = document.getelementbyid( 'target' ); console.log('attribute value: ' + circle.getattribute('test:foo')); </script> </body> </html> notes namespaces are only supported in xml documents.
Element.getElementsByClassName() - Web APIs
filtering the results using array methods we can also use methods of array.prototype on any htmlcollection by passing the htmlcollection as the method's this value.
... here we'll find all <div> elements that have a class of test: var testelements = document.getelementsbyclassname('test'); var testdivs = array.prototype.filter.call(testelements, function(testelement) { return testelement.nodename === 'div'; }); specifications specification status comment domthe definition of 'element.getelementsbyclassname()' in that specification.
Element.innerHTML - Web APIs
WebAPIElementinnerHTML
doing so causes the user agent to follow these steps: the specified value is parsed as html or xml (based on the document type), resulting in a documentfragment object representing the new set of dom nodes for the new elements.
... we add a second method that logs information about mouseevent based events (such as mousedown, click, and mouseenter): function logevent(event) { var msg = "event <strong>" + event.type + "</strong> at <em>" + event.clientx + ", " + event.clienty + "</em>"; log(msg); } then we use this as the event handler for a number of mouse events on the box that contains our log: var boxelem = document.queryselector(".box"); boxelem.addeventlistener("mousedown", logevent); boxelem.addeventlistener("mouseup", logevent); boxelem.addeventlistener("click", logevent); boxelem.ad...
Element.localName - Web APIs
WebAPIElementlocalName
example (must be served with xml content type, such as text/xml or application/xhtml+xml.) <html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg"> <head> <script type="application/javascript"><![cdata[ function test() { var text = document.getelementbyid('text'); var circle = document.getelementbyid('circle'); text.value = "<svg:circle> has:\n" + "localname = '" + circle.localname + "'\n" + "namespaceuri = ...
...for example, in the qualified name ecomm:partners, partners is the local name and ecomm is the prefix: <ecomm:business id="soda_shop" type="brick_n_mortar" xmlns:ecomm="http://example.com/ecomm"> <ecomm:partners> <ecomm:partner id="1001">tony's syrup warehouse </ecomm:partner> </ecomm:partner> </ecomm:business> note: in gecko 1.9.2 and earlier, the property returns the upper-cased version of the local name for html elements in html doms (as opposed to xhtml elements in xml doms).
Element.msZoomTo() - Web APIs
WebAPIElementmsZoomTo
syntax element.mszoomto(arguments); parameters args[in] type: mszoomtooptions contentx[in]: the x-coordinate of the content that is the target of the scroll/zoom.
... animate[in]: the type of animation to use.
ElementTraversal - Web APIs
it proved useless, as very few types of node were able to implement all its methods and properties.
... it has been split into two interfaces, containing the useful methods and properties for each kind of nodes: childnode parentnode as it was a pure interface, with no object of this type, this change has no effect on the web.
Comparison of Event Targets - Web APIs
examples <!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>comparison of event targets</title> <style> table { border-collapse: collapse; height: 150px; width: 100%; } td { border: 1px solid #ccc; font-weight: bold; padding: 5px; ...
... event type event.target event.relatedtarget mouseover the eventtarget which the pointing device entered the eventtarget which the pointing device exited mouseout the eventtarget which the pointing device exited the eventtarget which the pointing device entered todo: also needs descriptions for dragenter and dragexit events.
Event.preventDefault() - Web APIs
<code>preventdefault()</code> won't let you check this!<br>"; event.preventdefault(); }, false); html <p>please click on the checkbox control.</p> <form> <label for="id-checkbox">checkbox:</label> <input type="checkbox" id="id-checkbox"/> </form> <div id="output-box"></div> result stopping keystrokes from reaching an edit field the following example demonstrates how invalid text input can be stopped from reaching the input field with preventdefault().
... html here's the form: <div class="container"> <p>please enter your name using lowercase letters only.</p> <form> <input type="text" id="my-textbox"> </form> </div> css we use a little bit of css for the warning box we'll draw when the user presses an invalid key: .warning { border: 2px solid #f39389; border-radius: 2px; padding: 10px; position: absolute; background-color: #fbd8d4; color: #3b3c40; } javascript and here's the javascript code that does the job.
Event - Web APIs
WebAPIEvent
there are many types of events, some of which use other interfaces based on the main event interface.
... event.type read only the name of the event.
EventSource - Web APIs
to listen to named events, you'll require a listener for each type of event sent.
...meid * */ sse.addeventlistener("notice", function(e) { console.log(e.data) }) /* similarly, this will listen for events * with the field `event: update` */ sse.addeventlistener("update", function(e) { console.log(e.data) }) /* the event "message" is a special case, as it * will capture events without an event field * as well as events that have the specific type * `event: message` it will not trigger on any * other event type.
ExtendableMessageEvent() - Web APIs
syntax var extendablemessageevent = new extendablemessageevent(type, init); parameters type a domstring that defines the type of the message event being created.
... init optional an initialisation object, which should contain the following parameters: data: the event's data — this can be any data type.
ExtendableMessageEvent.data - Web APIs
it can be any data type.
... syntax var mydata = extendablemessageevent.data; value any data type.
Fetch basic concepts - Web APIs
when a request or response object is created, it has an associated headers object whose guard is set as summarized below: new object's type creating constructor guard setting of associated headers object request request() request request() with mode of no-cors request-no-cors response response() response error() or redirect() methods immutable a header's guard affects the set(), delete(), and append() methods which change the header's contents.
... a typeerror is thrown if you try to modify a headers object whose guard is immutable.
File.File() - Web APIs
WebAPIFileFile
available options are as follows: type: a domstring representing the mime type of the content that will be put into the file.
... example var file = new file(["foo"], "foo.txt", { type: "text/plain", }); specifications specification status comment file api working draft initial definition ...
File.getAsBinary() - Web APIs
WebAPIFilegetAsBinary
example // fileinput is an htmlinputelement: <input type="file" id="myfileinput" multiple> var fileinput = document.getelementbyid("myfileinput"); // files is a filelist object (similar to nodelist) var files = fileinput.files; // object for allowed media types var accept = { binary : ["image/png", "image/jpeg"], text : ["text/plain", "text/css", "application/xml", "text/html"] }; var file; for (var i = 0; i < files.length; i++) { file = fi...
...les[i]; // if file type could be detected if (file !== null) { if (accept.binary.indexof(file.type) > -1) { // file is a binary, which we accept var data = file.getasbinary(); } else if (accept.text.indexof(file.type) > -1) { // file is of type text, which we accept var data = file.getastext(); // modify data with string methods } } } specification not part of any specification.
File.getAsText() - Web APIs
WebAPIFilegetAsText
example // fileinput is a htmlinputelement: <input type="file" id="myfileinput" multiple> var fileinput = document.getelementbyid("myfileinput"); // files is a filelist object (similar to nodelist) var files = fileinput.files; // object for allowed media types var accept = { binary : ["image/png", "image/jpeg"], text : ["text/plain", "text/css", "application/xml", "text/html"] }; var file; for (var i = 0; i < files.length; i++) { file = fi...
...les[i]; // if file type could be detected if (file !== null) { if (accept.text.indexof(file.mediatype) > -1) { // file is of type text, which we accept // make sure it's encoded as utf-8 var data = file.getastext("utf-8"); // modify data with string methods } else if (accept.binary.indexof(file.mediatype) > -1) { // binary } } } specification not part of any specification.
FileException - Web APIs
var fileentry = fs.root.getfile('log.txt', {create: true, exclusive:true}0; } catch (e) { onerrror(e); } the sample code was borrowed from html5rocks attribute attribute type description code unsigned short the most appropriate error code for the condition.
... type_mismatch_err 11 the user has attempted to look up a file or directory, but the entry found is of the wrong type.
FileReader: abort event - Web APIs
bubbles no cancelable no interface progressevent event handler property filereader.onabort examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: ...
... black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "select log" "preview log"; } .file-select { grid-area: select; } .preview { grid-area: preview; } .event-log { grid-area: log; } .event-log>label { display: block; } .event-log-contents { resize: none; } js const fileinput = document.queryselector('input[type="file"]'); const preview = document.queryselector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function addlisteners...
FileReader: load event - Web APIs
bubbles no cancelable no interface progressevent event handler property filereader.onload examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; bord...
... black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "select log" "preview log"; } .file-select { grid-area: select; } .preview { grid-area: preview; } .event-log { grid-area: log; } .event-log>label { display: block; } .event-log-contents { resize: none; } js const fileinput = document.queryselector('input[type="file"]'); const preview = document.queryselector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function addlisteners...
FileReader: loadend event - Web APIs
bubbles no cancelable no interface progressevent event handler property filereader.onloadend examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; h...
... black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "select log" "preview log"; } .file-select { grid-area: select; } .preview { grid-area: preview; } .event-log { grid-area: log; } .event-log>label { display: block; } .event-log-contents { resize: none; } js const fileinput = document.queryselector('input[type="file"]'); const preview = document.queryselector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function addlisteners...
FileReader: loadstart event - Web APIs
bubbles no cancelable no interface progressevent event handler property filereader.onloadstart examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem...
... black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "select log" "preview log"; } .file-select { grid-area: select; } .preview { grid-area: preview; } .event-log { grid-area: log; } .event-log>label { display: block; } .event-log-contents { resize: none; } js const fileinput = document.queryselector('input[type="file"]'); const preview = document.queryselector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function addlisteners...
FileReader: progress event - Web APIs
bubbles no cancelable no interface progressevent event handler property filereader.onprogress examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5...
... black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "select log" "preview log"; } .file-select { grid-area: select; } .preview { grid-area: preview; } .event-log { grid-area: log; } .event-log>label { display: block; } .event-log-contents { resize: none; } js const fileinput = document.queryselector('input[type="file"]'); const preview = document.queryselector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function addlisteners...
FileReader.readAsDataURL() - Web APIs
example html <input type="file" onchange="previewfile()"><br> <img src="" height="200" alt="image preview..."> javascript function previewfile() { const preview = document.queryselector('img'); const file = document.queryselector('input[type=file]').files[0]; const reader = new filereader(); reader.addeventlistener("load", function () { // convert image file to base64 string preview.src = reader.result...
...; }, false); if (file) { reader.readasdataurl(file); } } live result example reading multiple files html <input id="browse" type="file" onchange="previewfiles()" multiple> <div id="preview"></div> javascript function previewfiles() { var preview = document.queryselector('#preview'); var files = document.queryselector('input[type=file]').files; function readandpreview(file) { // make sure `file.name` matches our extensions criteria if ( /\.(jpe?g|png|gif)$/i.test(file.name) ) { var reader = new filereader(); reader.addeventlistener("load", function () { var image = new image(); image.height = 100; image.title = file.name; image.src = this.result; preview.appendchild( image ); }, false); reade...
FileReader.result - Web APIs
WebAPIFileReaderresult
the result types are described below.
... var fileinput = document.queryselector('input[type="file"]'); function read(callback) { var file = fileinput.files.item(0); var reader = new filereader(); reader.onload = function() { callback(reader.result); } reader.readastext(file); } specifications specification status comment file apithe definition of 'result' in that specification.
FileSystemEntry.toURL() - Web APIs
syntax filesystementry.tourl([mimetype]); parameters mimetype optional an optional string specifying the mime type to use when interpreting the file.
... this can be used to help deal with files whose types aren't recognized automatically by the user agent.
FileSystemEntrySync - Web APIs
ion); filesystementrysync moveto (in directoryentrysync parent, optional domstring newname) raises (fileexception); filesystementrysync copyto(in directoryentrysync parent, optional domstring newname) raises (fileexception); domstring tourl(); void remove() raises (fileexception); directoryentrysync getparent(); attributes attribute type description filesystem readonly filesystemsync the file system where the entry resides.
... you can supply the mimetype to simulate the optional mime type header associated with http downloads.
FileSystemFlags.create - Web APIs
option values file/directory condition result create exclusive false n/a[1] path exists and matches the desired type (depending on whether the function called is getfile() or getdirectory() the successcallback is called with a filesystemfileentry if getfile() was called or a filesystemdirectoryentry if getdirectory() was called.
... false n/a[1] path exists but doesn't match the desired type the errorcallback is called with an appropriate error code (if the callback was provided).
FileSystemFlags.exclusive - Web APIs
option values file/directory condition result create exclusive false n/a[1] path exists and matches the desired type (depending on whether the function called is getfile() or getdirectory() the successcallback is called with a filesystemfileentry if getfile() was called or a filesystemdirectoryentry if getdirectory() was called.
... false n/a[1] path exists but doesn't match the desired type the errorcallback is called with an appropriate error code (if the callback was provided).
FileHandle API - Web APIs
var idbreq = indexeddb.open("myfilestoragedatabase"); idbreq.onsuccess = function(){ var db = this.result; var buildhandle = db.mozcreatefilehandle("test.txt", "plain/text"); buildhandle.onsuccess = function(){ var myfilehandle = this.result; console.log('handle', myfilehandle); }; }; mozcreatefilehandle() takes two arguments: a name and an optional type.
...however, they are important for the filehandle object as it can generate file objects which inherit their own name and type from those values.
Introduction to the File and Directory Entries API - Web APIs
big concepts before you start using the file and directory entries api, you need to understand a few concepts: the file and directory entries api is a virtual representation of a file system the file and directory entries api can use different storage types browsers impose storage quota the file and directory entries api has asynchronous and synchronous versions when using the asynchronous api, always use the error callbacks the file and directory entries api interacts with other apis the file and directory entries api is case-sensitive the file and directory entries api is a virtual representation of a file system the api doesn't give you ...
... the file and directory entries api can use different storage types an application can request temporary or persistent storage.
FocusEvent() - Web APIs
syntax var focusevent = new focusevent(typearg[, focuseventinit]); properties the focusevent() constructor also inherits arguments from uievent() and from event().
... typearg is a domstring representing the name of the event.
GamepadButton - Web APIs
the gamepadbutton interface defines an individual button of a gamepad or other controller, allowing access to the current state of different types of buttons available on the control device.
... on github.) note the code fork — in chrome navigator.getgamepads needs a webkit prefix and the button values are stored as an array of double values, whereas in firefox navigator.getgamepads doesn't need a prefix, and the button values are stored as an array of gamepadbutton objects; it is the gamepadbutton.value or gamepadbutton.pressed properties of these we need to access, depending on what type of buttons they are.
GlobalEventHandlers.onreset - Web APIs
the reset event fires when the user clicks a reset button in a form (<input type="reset">).
... html <form id="form"> <label>test field: <input type="text"></label> <br><br> <button type="reset">reset form</button> </form> <p id="log"></p> javascript function logreset(event) { log.textcontent = `form reset!
HTMLAnchorElement.relList - Web APIs
it is a live domtokenlist containing the set of link types indicating the relationship between the resource represented by the <a> element and the current document.
... syntax var relstr = anchorelt.rellist; example var anchors = document.getelementsbytagname("a"); var length = anchors.length; for (var i = 0; i < length; i++) { var list = anchors[i].rellist; var listlength = list.length; console.log("new anchor node found with", listlength, "link types in rellist."); for (var j = 0; j < listlength; j++) { console.log(list[j]); } } specifications specification status comment html living standardthe definition of 'rellist' in that specification.
HTMLAreaElement - Web APIs
htmlareaelement.type is a domstring that reflects the type html attribute, indicating the mime type of the linked resource.
... the following properties have been added: rel, rellist, media, hreflang, type, host, hostname, pathname, port, protocol, search, and hash.
HTMLCanvasElement - Web APIs
htmlcanvaselement.todataurl() returns a data-url containing a representation of the image in the format specified by the type parameter (defaults to png).
...if type is not specified, the image type is image/png.
HTMLDialogElement: cancel event - Web APIs
bubbles no cancelable yes interface event event handler oncancel examples live example html <dialog class="example-dialog"> <button class="close" type="reset">close</button> </dialog> <button class="open-dialog">open dialog</button> <div class="result"></div> css button, div { margin: .5rem; } js const result = document.queryselector('.result'); const dialog = document.queryselector('.example-dialog'); dialog.addeventlistener('cancel', (event) => { result.textcontent = 'dialog was canceled'; }); const opendialog = document.que...
...ryselector('.open-dialog'); opendialog.addeventlistener('click', () => { if (typeof dialog.showmodal === 'function') { dialog.showmodal(); result.textcontent = ''; } else { result.textcontent = 'the dialog api is not supported by this browser'; } }); const closebutton = document.queryselector('.close'); closebutton.addeventlistener('click', () => { dialog.close(); }); result specifications specification status html living standardthe definition of 'cancel' in that specification.
HTMLElement: input event - Web APIs
for <input> elements with type=checkbox or type=radio, the input event should fire whenever a user toggles the control, per the html5 specification.
...check compatibility, or use the change event instead for elements of these types.
HTMLFormElement.requestSubmit() - Web APIs
this may be either an <input> or <button> element whose type attribute is submit.
... exceptions typeerror the specified submitter is not a submit button.
HTMLInputElement.multiple - Web APIs
firefox currently only supports multiple for <input type="file">.
... example // fileinput is a <input type=file multiple> let fileinput = document.getelementbyid('myfileinput'); if (fileinput.multiple == true) { for (let i = 0; i < fileinput.files.length; i++) { // loop fileinput.files } // only one file available } else { let file = fileinput.files.item(0); } ...
HTMLInputElement.webkitEntries - Web APIs
the read-only webkitentries property of the htmlinputelement interface contains an array of file system entries (as objects based on filesystementry) representing files and/or directories selected by the user using an <input> element of type file, but only if that selection was made using drag-and-drop: selecting a file in the dialog will leave the property empty (bug 1326031).
... html <input id="files" type="file" multiple> javascript document.getelementbyid("files").addeventlistener("change", function(event) { event.target.webkitentries.foreach(function(entry) { /* do stuff with the entry */ }); }); each time a change event occurs, this code iterates over the selected files, obtaining their filesystementry-based objects and acting on them.
HTMLKeygenElement - Web APIs
keytype is a domstring that reflects the keytype html attribute, containing the type of key used.
... type read only is a domstring that must be the value keygen.
HTMLLinkElement - Web APIs
htmllinkelement.as is a domstring representing the type of content being loaded by the html link.
... htmllinkelement.type is a domstring representing the mime type of the linked resource.
HTMLMedia​Element​.textTracks - Web APIs
instead, they're sent to the track list object of the htmlmediaelement that corresponds to the type of track that was added to the element the returned list is live; that is, as tracks are added to and removed from the media element, the list's contents change dynamically.
... examples we start with a <video> that has several <track> children <video controls poster="/images/sample.gif"> <source src="sample.mp4" type="video/mp4"> <source src="sample.ogv" type="video/ogv"> <track kind="captions" src="samplecaptions.vtt" srclang="en"> <track kind="descriptions" src="sampledescriptions.vtt" srclang="en"> <track kind="chapters" src="samplechapters.vtt" srclang="en"> <track kind="subtitles" src="samplesubtitles_de.vtt" srclang="de"> <track kind="subtitles" src="samplesubtitles_en.vtt" srclang="en"> <...
HTMLElement.focus() - Web APIs
examples focus on a text field javascript focusmethod = function getfocus() { document.getelementbyid("mytextfield").focus(); } html <input type="text" id="mytextfield" value="text field."> <p></p> <button type="button" onclick="focusmethod()">click me to focus on the text field!</button> result focus on a button javascript focusmethod = function getfocus() { document.getelementbyid("mybutton").focus(); } html <button type="button" id="mybutton">click me!</button> <p></p> <button type="button" onclick="focusmethod()"...
...>click me to focus on the button!</button> result focus with focusoption javascript focusscrollmethod = function getfocus() { document.getelementbyid("mybutton").focus({preventscroll:false}); } focusnoscrollmethod = function getfocuswithoutscrolling() { document.getelementbyid("mybutton").focus({preventscroll:true}); } html <button type="button" onclick="focusscrollmethod()">click me to focus on the button!</button> <button type="button" onclick="focusnoscrollmethod()">click me to focus on the button without scrolling!</button> <div id="container" style="height: 1000px; width: 1000px;"> <button type="button" id="mybutton" style="margin-top: 500px;">click me!</button> </div> result specification specification status comment ...
HTMLSourceElement - Web APIs
htmlsourceelement.media is a domstring reflecting the media html attribute, containing the intended type of the media resource.
... htmlsourceelement.type is a domstring reflecting the type html attribute, containing the type of the media resource.
HTMLTableElement - Web APIs
htmltableelement.frame is a domstring containing the type of the external borders of the table.
... htmltableelement.rules is a domstring containing the type of the internal borders of the table.
HTMLTextAreaElement - Web APIs
same as reading value.length type read only string: returns the string textarea.
...ping: javascript function autogrow (ofield) { if (ofield.scrollheight > ofield.clientheight) { ofield.style.height = ofield.scrollheight + "px"; } } css textarea.noscrollbars { overflow: hidden; width: 300px; height: 100px; } html <form> <fieldset> <legend>your comments</legend> <p><textarea class="noscrollbars" onkeyup="autogrow(this);"></textarea></p> <p><input type="submit" value="send" /></p> </fieldset> </form> insert html tags example insert some html tags or smiles or any custom text in a textarea.
HTMLUListElement - Web APIs
htmlulistelement.type is a domstring value reflecting the type and defining the kind of marker to be used to display.
... recommendation the compact and type properties have been obsoleted.
Using microtasks in JavaScript with queueMicrotask() - Web APIs
consider code such as this: customelement.prototype.getdata = url => { if (this.cache[url]) { this.data = this.cache[url]; this.dispatchevent(new event("load")); } else { fetch(url).then(result => result.arraybuffer()).then(data => { this.cache[url] = data; this.data = data; this.dispatchevent(new event("load")); }); } }; the problem introduced here is that by using a task in one branch of the if...else sta...
... we can ensure consistent ordering of these operations by using a microtask in the if clause to balance the two clauses: customelement.prototype.getdata = url => { if (this.cache[url]) { queuemicrotask(() => { this.data = this.cache[url]; this.dispatchevent(new event("load")); }); } else { fetch(url).then(result => result.arraybuffer()).then(data => { this.cache[url] = data; this.data = data; this.dispatchevent(new event("load")); }); } }; this balances the clauses by having both situat...
Headers() - Web APIs
WebAPIHeadersHeaders
example creating an empty headers object is simple: var myheaders = new headers(); // currently empty you could add a header to this using headers.append: myheaders.append('content-type', 'image/jpeg'); myheaders.get('content-type'); // returns 'image/jpeg' or you can add the headers you want as the headers object is created.
... in the following snippet we create a new headers object, adding some headers by passing the constructor an init object as an argument: var httpheaders = { 'content-type' : 'image/jpeg', 'accept-charset' : 'utf-8', 'x-my-custom-header' : 'zeke are cool' }; var myheaders = new headers(httpheaders); you can now create another headers object, passing it the first headers object as its init object: var secondheadersobj = new headers(myheaders); secondheadersobj.get('content-type'); // would return 'image/jpeg' — it inherits it from the first headers object specifications specification status comment fetchthe definition of 'headers()' in that specification.
Headers.delete() - Web APIs
WebAPIHeadersdelete
this method throws a typeerror for the following reasons: the value of the name parameter is not the name of an http header.
... example creating an empty headers object is simple: var myheaders = new headers(); // currently empty you could add a header to this using headers.append: myheaders.append('content-type', 'image/jpeg'); myheaders.get('content-type'); // returns 'image/jpeg' you can then delete it again: myheaders.delete('content-type'); myheaders.get('content-type'); // returns null, as it has been deleted specifications specification status comment fetchthe definition of 'delete()' in that specification.
Headers.get() - Web APIs
WebAPIHeadersget
if the given name is not the name of an http header, this method throws a typeerror.
... example creating an empty headers object is simple: var myheaders = new headers(); // currently empty myheaders.get('not-set'); // returns null you could add a header to this using headers.append, then retrieve it using get(): myheaders.append('content-type', 'image/jpeg'); myheaders.get('content-type'); // returns "image/jpeg" if the header has multiple values associated with it, the byte string will contain all the values, in the order they were added to the headers object: myheaders.append('accept-encoding', 'deflate'); myheaders.append('accept-encoding', 'gzip'); myheaders.get('accept-encoding'); // returns "deflate,gzip" note: headers.get...
Headers.getAll() - Web APIs
WebAPIHeadersgetAll
if the given name is not the name of an http header, this method throws a typeerror.
... example creating an empty headers object is simple: var myheaders = new headers(); // currently empty you could add a header to this using headers.append, then retrieve it using getall(): myheaders.append('content-type', 'image/jpeg'); myheaders.getall('content-type'); // returns [ "image/jpeg" ] if the header has multiple values associated with it, the array will contain all the values, in the order they were added to the headers object: myheaders.append('accept-encoding', 'deflate'); myheaders.append('accept-encoding', 'gzip'); myheaders.getall('accept-encoding'); // returns [ "deflate", "gzip" ] note: use headers.get to return only the first value added to the headers object.
Headers.has() - Web APIs
WebAPIHeadershas
if the given name is not a valid http header name, this method throws a typeerror.
... example creating an empty headers object is simple: var myheaders = new headers(); // currently empty you could add a header to this using headers.append, then test for the existence of it using has(): myheaders.append('content-type', 'image/jpeg'); myheaders.has('content-type'); // returns true myheaders.has('accept-encoding'); // returns false specifications specification status comment fetchthe definition of 'has()' in that specification.
Headers.set() - Web APIs
WebAPIHeadersset
if the given name is not the name of an http header, this method throws a typeerror.
... example creating an empty headers object is simple: var myheaders = new headers(); // currently empty you could add a header to this using headers.append, then set a new value for this header using set(): myheaders.append('content-type', 'image/jpeg'); myheaders.set('content-type', 'text/html'); if the specified header does not already exist, set() will create it and set its value to the specified value.
IDBCursor.advance() - Web APIs
WebAPIIDBCursoradvance
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive.
... typeerror the value passed into the count parameter was zero or a negative number.
IDBCursor.key - Web APIs
WebAPIIDBCursorkey
the cursor's key can be any data type.
... syntax var key = cursor.key; value a value of any type.
IDBCursor.primaryKey - Web APIs
the cursor's primary key can be any data type.
... syntax var value = cursor.primarykey; value a value of any data type.
IDBCursor - Web APIs
WebAPIIDBCursor
the cursor's key can be any data type.
...the cursor's primary key can be any data type.
IDBFactory.open() - Web APIs
WebAPIIDBFactoryopen
note: you can find out more information on the different available storage types, and how firefox handles client-side data storage, at browser storage limits and eviction criteria.
... exceptions this method may raise a domexception of the following types: exception description typeerror the value of version is zero or a negative number or not a number.
IDBIndex.openCursor() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive.
... typeerror the value for the direction parameter is invalid.
IDBIndex.openKeyCursor() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive.
... typeerror the value for the direction parameter is invalid.
IDBObjectStore.createIndex() - Web APIs
bear in mind that indexeddb indexes can contain any javascript data type; indexeddb uses the structured clone algorithm to serialize stored objects, which allows for storage of simple and complex objects.
... exceptions this method may raise a domexception of one of the following types: exception description constrainterror occurs if an index with the same name already exists in the database.
IDBObjectStore.getAllKeys() - Web APIs
if it is lower than 0 or greater than 232-1 a typeerror exception will be thrown.
... exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive.
InputEvent() - Web APIs
syntax event = new inputevent(typearg, inputeventinit); values typearg is a domstring representing the name of the event.
... inputeventinitoptional is a inputeventinit dictionary, having the following fields: inputtype: (optional) a string specifying the type of change for editible content such as, for example, inserting, deleting, or formatting text.
InputEvent - Web APIs
inputevent.inputtyperead only returns the type of change for editable content such as, for example, inserting, deleting, or formatting text.
... see the property page for a complete list of input types.
KeyboardEvent.isComposing - Web APIs
syntax var bool = event.iscomposing; example var kbdevent = new keyboardevent("synthetickey", false); console.log(kbdevent.iscomposing); // return false specifications specification status comment ui eventsthe definition of 'keyboardevent.prototype.iscomposing' in that specification.
... working draft document object model (dom) level 3 events specificationthe definition of 'keyboardevent.prototype.iscomposing' in that specification.
KeyframeEffect.KeyframeEffect() - Web APIs
syntax var keyframes = new keyframeeffect(element, keyframeset, keyframeoptions); var keyframes = new keyframeeffect(sourcekeyframes); parameters the first type of constructor (see above) creates a completely new keyframeeffect object instance.
... the second type of constructor (see above) creates a clone of an existing keyframeeffect object instance.
LargestContentfulPaint - Web APIs
// catch errors since some browsers throw when using the new `type` option.
...(note: `rendertime` may not be available on // image elements loaded cross-origin without the `timing-allow-origin` header.) lcp = lastentry.rendertime || lastentry.loadtime; }); po.observe({type: 'largest-contentful-paint', buffered: true}); // send data to the server.
LayoutShift - Web APIs
// catch errors since some browsers throw when using the new `type` option.
... if (!entry.hadrecentinput) { cumulativelayoutshiftscore += entry.value; } } }); observer.observe({type: 'layout-shift', buffered: true}); document.addeventlistener('visibilitychange', () => { if (document.visibilitystate === 'hidden') { // force any pending records to be dispatched.
Location: assign() - Web APIs
WebAPILocationassign
if the assignment can't happen because of a security violation, a domexception of the security_error type is thrown.
... if the provided url is not valid, a domexception of the syntax_error type is thrown.
Location: replace() - Web APIs
WebAPILocationreplace
if the assignment can't happen because of a security violation, a domexception of the security_error type is thrown.
... if the provided url is not valid, a domexception of the syntax_error type is thrown.
MSSiteModeEvent - Web APIs
type gets the name of an event.
... example interface mssitemodeevent extends event { buttonid: number; actionurl: string; } declare var mssitemodeevent: { prototype: mssitemodeevent; new(): mssitemodeevent; } see also microsoft api extensions ...
MediaCapabilities - Web APIs
methods mediacapabilities.encodinginfo() when passed a valid media configuration, it returns a promise with information as to whether the media type is supported, and whether encoding such media would be smooth and power efficient.
... mediacapabilities.decodinginfo() when passed a valid media configuration, it returns a promise with information as to whether the media type is supported, and whether decoding such media would be smooth and power efficient.
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.
... example // mediaconfiguration to be tested const mediaconfig = { type : 'file', audio : { contenttype : "audio/ogg", channels : 2, bitrate : 132700, samplerate : 5200 }, }; // check support and performance navigator.mediacapabilities.decodinginfo(mediaconfig).then(result => { // result contains the media capabilities information console.log('this configuration is ' + (result.supported ?
MediaImage - Web APIs
type the mime type hint for the user agant.
... note that it is just a hint so that user agent may ignore images of types it does not support; user agent still may use mime type sniffing after downloading the image to determine its type.
MediaKeyMessageEvent() - Web APIs
syntax var mediakeymessageevent = new mediakeymessageevent(typearg, options) parameters typearg a domstring containing one of may be one of license-request, license-renewal, license-renewal, or individualization-request.
... options options are as follows: messagetype: a developer-defined message type that allows applications to differentiate messages without parsing them.
audioCapabilities - Web APIs
the mediakeysystemconfiguration.audiocapabilities read-only property returns an array of supported audio type and capability pairs.
... syntax var audiocapabilities[ {contenttype: 'contenttype', robustness:'robustness'}] = mediasystemconfiguration.audiocapabilities; specifications specification status comment encrypted media extensionsthe definition of 'audiocapabilities' in that specification.
videoCapabilities - Web APIs
the mediakeysystemconfiguration.videocapabilities read-only property returns an array of supported video type and capability pairs.
... syntax var videocapabilities[{contenttype: 'contenttype', robustness:'robustness'}] = mediasystemconfiguration.videocapabilities; specifications specification status comment encrypted media extensionsthe definition of 'videocapabilities' in that specification.
MediaRecorder: dataavailable event - Web APIs
var chunks = []; mediarecorder.addeventlistener('stop', (event) => { console.log("data available after mediarecorder.stop() called."); var audio = document.createelement('audio'); audio.controls = true; var blob = new blob(chunks, { 'type' : 'audio/ogg; codecs=opus' }); var audiourl = window.url.createobjecturl(blob); audio.src = audiourl; console.log("recorder stopped"); }); mediarecorder.addeventlistener('dataavailable', (event) => { chunks.push(event.data); }); ...
... var chunks = []; mediarecorder.onstop = function(e) { console.log("data available after mediarecorder.stop() called."); var audio = document.createelement('audio'); audio.controls = true; var blob = new blob(chunks, { 'type' : 'audio/ogg; codecs=opus' }); var audiourl = window.url.createobjecturl(blob); audio.src = audiourl; console.log("recorder stopped"); } mediarecorder.ondataavailable = function(e) { chunks.push(e.data); } ...
MediaRecorder.onerror - Web APIs
the error object is of type mediarecordererrorevent, and its error property contains a domexception object that describes the error that occurred.
... notsupportederror an attempt was made to instantiate a mediarecorder using a mime type that isn't supported on the user's device; one or more of the requested container, codecs, or profiles as well as other information may be invalid.
MediaSession.setPositionState() - Web APIs
this can be particularly useful if your code implements a player for type of media not directly supported by the browser.
... exceptions typeerror this error can occur in an array of circumstances: the specified mediapositionstate object's duration is missing, negative, or null.
MediaSessionActionDetails.action - Web APIs
the action property is the only required property mediasessionactiondetails dictionary, specifying the type of media session action which the action handler callback is being executed for.
... syntax let mediasessionactiondetails = { action: actiontype }; let actiontype = mediasessionactiondetails.action; value a domstring specifying which of the action types the callback is being invoked for: nexttrack advances playback to the next track.
MediaStreamEvent() - Web APIs
syntax var event = new mediastreamevent(type, mediastreameventinit); values type is a domstring containing the name of the event, like addstream or removestream.
... mediastreameventinit is a mediastreameventinit dictionary, having the following fields: "stream" of type mediastream representing the stream being concerned by the event.
MediaStreamEvent - Web APIs
two events of this type can be thrown: addstream and removestream.
...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.
MediaStreamTrack - Web APIs
the mediastreamtrack interface represents a single media track within a stream; typically, these are audio or video tracks, but other track types may exist as well.
... mediastreamtrack.contenthint a string that may be used by the web application to provide a hint as to what type of content the track contains to guide how it should be treated by api consumers.
MediaStreamTrackAudioSourceNode - Web APIs
the mediastreamtrackaudiosourcenode interface is a type of audionode which represents a source of audio data taken from a specific mediastreamtrack obtained through the webrtc or media capture and streams apis.
...ta = function(e) { video.play(); video.muted = true; }; // create a mediastreamaudiosourcenode // feed the htmlmediaelement into it var audioctx = new audiocontext(); var source = audioctx.createmediastreamsource(stream); // create a biquadfilter var biquadfilter = audioctx.createbiquadfilter(); biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = range.value; // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination, so we can play the // music and adjust the volume using the mouse cursor source.connect(biquadfilter); biquadfilter.connect(audioctx.destination); // ...
MediaStreamTrackEvent() - Web APIs
syntax var trackevent = new mediastreamtrackevent(type, {track: amediastreamtrack}); parameters the mediastreamtrackevent() constructor also inherits arguments from event().
... type a domstring representing the name of the type of the mediastreamtrackevent.
MediaTrackConstraints - Web APIs
the specifics vary somewhat depending on the type of the constrainable property.
... displaysurface a constraindomstring which specifies the types of display surface that may be selected by the user.
Transcoding assets for Media Source Extensions - Web APIs
to check if the browser supports a particular container, you can pass a string of the mime type to the mediasource.istypesupported method: mediasource.istypesupported('audio/mp3'); // false mediasource.istypesupported('video/mp4'); // true mediasource.istypesupported('video/mp4; codecs="avc1.4d4028, mp4a.40.2"'); // true the string is the mime type of the container, optionally followed by a list of codecs.
... while the mime type is fairly simple to figure out, we can get the codec string using the mp4info utility.
MerchantValidationEvent() - Web APIs
syntax merchantvalidationevent = new merchantvalidationevent(type, options); parameters type a domstring which must be merchantvalidation, the only type of event which uses the merchantvalidationevent interface.
... exceptions typeerror the string specified as validationurl could not be parsed as a url.
MessageEvent.MessageEvent() - Web APIs
syntax var messageevent = new messageevent(type, init); parameters type the type of messageevent that will be created.
...this can be of any data type, and will default to null if not specified.
MessagePort - Web APIs
event handlers inherits event handlers from its parent, eventtarget onmessage an eventlistener called when messageevent of type message is fired on the port—that is, when the port receives a message.
... onmessageerror an eventlistener called when a messageevent of type messageerror is fired—that is, when it receives a message that cannot be deserialized.
MouseEvent.button - Web APIs
WebAPIMouseEventbutton
note: do not confuse this property with the mouseevent.buttons property, which indicates which buttons are pressed for all mouse events types.
... example html <button id="button" oncontextmenu="event.preventdefault();">click here with your mouse...</button> <p id="log"></p> javascript let button = document.queryselector('#button'); let log = document.queryselector('#log'); button.addeventlistener('mouseup', logmousebutton); function logmousebutton(e) { if (typeof e === 'object') { switch (e.button) { case 0: log.textcontent = 'left button clicked.'; break; case 1: log.textcontent = 'middle button clicked.'; break; case 2: log.textcontent = 'right button clicked.'; break; default: log.textcontent = `unknown button code: ${e.button}`; } } } result specifications ...
MouseEvent.pageX - Web APIs
WebAPIMouseEventpageX
even though numeric types both are represented by number in javascript, they may be handled differently internally in the browser's code, resulting in potential behavior differences.
... see browser compatibility to learn which browsers have been updated to use the revised data type.
MutationObserver.MutationObserver() - Web APIs
the callback function function callback(mutationlist, observer) { mutationlist.foreach( (mutation) => { switch(mutation.type) { case 'childlist': /* one or more children have been added to and/or removed from the tree.
... the kind of change that took place (either a change to the list of children, or a change to an attribute) is detected by looking at the mutation.type property.
MutationObserver.observe() - Web APIs
exceptions typeerror thrown in any of the following circumstances: the options are configured such that nothing will actually be monitored.
... usage notes reusing mutationobservers you can call observe() multiple times on the same mutationobserver to watch for changes to different parts of the dom tree and/or different types of changes.
MutationObserverInit.attributeFilter - Web APIs
function callback(mutationlist) { mutationlist.foreach(function(mutation) { switch(mutation.type) { case "attributes": switch(mutation.attributename) { case "status": userstatuschanged(mutation.target.username, mutation.target.status); break; case "username": usernamechanged(mutation.oldvalue, mutation.target.username); break; } break; } }); } var userlistelement = document.queryselector(...
...for any items representing an attribute change (which can be detected by the value of mutationrecord.type being "attributes"), we use the attribute's name, obtained using mutationrecord.attributename, to identify the type of change that occurred and then dispatch to the appropriate handler function.
MutationObserverInit.attributeOldValue - Web APIs
function callback(mutationlist) { mutationlist.foreach(function(mutation) { switch(mutation.type) { case "attributes": notifyuser("attribute name " + mutation.attributename + " changed to " + mutation.target[mutation.attributename] + " (was " + mutation.oldvalue + ")"); break; } }); } var targetnode = document.queryselector("#target"); var observer = new mutationobserver(callback); observer.observe(targetnode, { attributes: true, attr...
...for any items representing an attribute change (which can be detected by the value of mutationrecord.type being "attributes"), a function called notifyuser() is used to tell the user the name of the attribute that changed as well as the attribute's new value (mutation.target[mutation.attributename]) and its old value (mutation.oldvalue).
MutationObserverInit.attributes - Web APIs
function callback(mutationlist) { mutationlist.foreach(function(mutation) { switch(mutation.type) { case "attributes": notifyuser("attribute name " + mutation.attributename + " changed to " + mutation.target[mutation.attributename] + " (was " + mutation.oldvalue + ")"); break; } }); } var targetnode = document.queryselector("#target"); var observer = new mutationobserver(callback); observer.observe(targetnode, { attributes: true, attr...
...for any items representing an attribute change (which can be detected by the value of mutationrecord.type being "attributes"), a function called notifyuser() is used to tell the user the name of the attribute that changed as well as the attribute's new value (mutation.target[mutation.attributename]) and its old value (mutation.oldvalue).
MutationObserverInit - Web APIs
as such, it's primarily used as the type of the options parameter on the mutationobserver.observe() method.
...otherwise, a typeerror exception will be thrown.
NDEFReader.scan() - Web APIs
WebAPINDEFReaderscan
recordtype -- the match pattern for matching each ndefrecord.recordtype.
... mediatype -- the match pattern for matching each ndefrecord.mediatype.
NDEFRecord.toRecords() - Web APIs
the torecords() method of the ndefrecord interface of web nfc api parses record payload ndefrecord.data besed on ndefrecord.recordtype and returns the result.
... exceptions notsupported the user agent does not know how to parse this combination of ndefrecord.data and ndefrecord.recordtype.
NDEFRecord - Web APIs
attributes ndefrecord.recordtype read only represents the ndef record type.
... ndefrecord.mediatype read only represents the mime type of the ndef record payload.
Navigator.requestMediaKeySystemAccess() - Web APIs
notsupportederror either the specified keysystem isn't supported by the platform or the browser, or none of the configurations specified by supportedconfigurations can be satisfied (if, for example, none of the codecs specified in contenttype are available).
... typeerror either keysystem is an empty string or the supportedconfigurations array is empty.
Navigator - Web APIs
WebAPINavigator
navigatorplugins.mimetypes read only returns an mimetypearray listing the mime types supported by the browser.
... navigator.registercontenthandler() obsolete since gecko 59 allows web sites to register themselves as a possible handler for a given mime type.
NavigatorPlugins.plugins - Web APIs
applications that must check for the presence of a browser plugin should query navigator.plugins or navigator.mimetypes by exact name instead of enumerating the navigator.plugins array and comparing every plugin's name.
... function getflashversion() { var flash = navigator.plugins.nameditem('shockwave flash'); if (typeof flash != 'object') { // flash is not present return undefined; } if(flash.version){ return flash.version; } else { //no version property (e.g.
NetworkInformation.downlinkMax - Web APIs
function logconnectiontype() { var connectiontype = 'not supported'; var downlinkmax = 'not supported'; if ('connection' in navigator) { connectiontype = navigator.connection.effectivetype; if ('downlinkmax' in navigator.connection) { downlinkmax = navigator.connection.downlinkmax; } } console.log('current connection type: ' + connectiontype + ' (downlink max: ' + downlinkmax + ')'); } l...
...ogconnectiontype(); navigator.connection.addeventlistener('change', logconnectiontype); specifications specification status comment network information apithe definition of 'downlinkmax' in that specification.
NetworkInformation.onchange - Web APIs
} examples // get the connection type.
... var type = navigator.connection.type; function changehandler(e) { // handle change of connection type here.
Node.isEqualNode() - Web APIs
WebAPINodeisEqualNode
two nodes are equal when they have the same type, defining characteristics (for elements, this would be their id, number of children, and so forth), its attributes match, and so on.
... the specific set of data points that must match varies depending on the types of the nodes.
Node.nodeName - Web APIs
WebAPINodenodeName
values for the different types of nodes are: interface nodename value attr the value of attr.name cdatasection "#cdata-section" comment "#comment" document "#document" documentfragment "#document-fragment" documenttype the value of documenttype.name element the value of element.tagname entity the entity name entityreference the name of entity reference notation the notation name processinginstruction the value of processinginstruction.target text "#text" example given the following markup: <div...
... id="d1">hello world</div> <input type="text" id="t"> and the following script: var div1 = document.getelementbyid("d1"); var text_field = document.getelementbyid("t"); text_field.value = div1.nodename; in xhtml (or any other xml format), text_field's value would read "div".
Node.removeChild() - Web APIs
WebAPINoderemoveChild
if the child doesn't exist on the dom of the page, the method throws the following exception: uncaught typeerror: failed to execute 'removechild' on 'node': parameter 1 is not of type 'node'.
...throwawaynode = d.removechild(d_nested); to remove a specified element without having to specify its parent node: let node = document.getelementbyid("nested"); if (node.parentnode) { node.parentnode.removechild(node); } to remove all children from an element: let element = document.getelementbyid("top"); while (element.firstchild) { element.removechild(element.firstchild); } causing a typeerror <!--sample html code--> <div id="top"> </div> <script type="text/javascript"> let top = document.getelementbyid("top"); let nested = document.getelementbyid("nested"); // throws uncaught typeerror let garbage = top.removechild(nested); </script> causing a notfounderror <!--sample html code--> <div id="top"> <div id="nested"></div> </div> <script type="text/javascript"> let...
Node.textContent - Web APIs
WebAPINodetextContent
syntax let text = somenode.textcontent someothernode.textcontent = string value a string or null description the value of textcontent depends on the situation: if the node is a document or a doctype, textcontent returns null.
... for other node types, textcontent returns the concatenation of the textcontent of every child node, excluding comments and processing instructions.
NodeIterator - Web APIs
nodeiterator.whattoshow read only returns an unsigned long being a bitmask made of constants describing the types of node that must to be presented.
... nodefilter.show_document_type 512 shows documenttype nodes.
NotificationEvent.NotificationEvent() - Web APIs
syntax var mynotificationevent = new notificationevent(type, notificationeventinit); parameters type tbd notificationeventinit optional a dictionary object containing a notification object to be used as the notification the event is dispatched on.
... example var n = new notification('hello'); var init = { notification: n }; var mynotificationevent = new notificationevent(type, init); specifications specification status comment notifications apithe definition of 'notificationevent() constructor' in that specification.
OES_element_index_uint - Web APIs
the oes_element_index_uint extension is part of the webgl api and adds support for gl.unsigned_int types to webglrenderingcontext.drawelements().
... extended methods this extension extends webglrenderingcontext.drawelements(): the type parameter now accepts gl.unsigned_int.
OES_texture_half_float - Web APIs
constants ext.half_float_oes half floating-point type (16-bit).
... extended methods this extension extends webglrenderingcontext.teximage2d() and webglrenderingcontext.texsubimage2d(): the type parameter now accepts ext.half_float_oes.
OVR_multiview2 - Web APIs
most vr headsets have two views, but there are prototypes of headset with ultra-wide fov using 4 views which is currently the maximum number of views supported by multiview.
... framebuffer_incomplete_view_targets_ovr if baseviewindex is not the same for all framebuffer attachment points where the value of framebuffer_attachment_object_type is not none, the framebuffer is considered incomplete.
OfflineAudioContext.startRendering() - Web APIs
the complete event (of type offlineaudiocompletionevent) is raised when the rendering is finished, containing the resulting audiobuffer in its renderedbuffer property.
... online and offline audio context var audioctx = new audiocontext(); var offlinectx = new offlineaudiocontext(2,44100*40,44100); source = offlinectx.createbuffersource(); // use xhr to load an audio track, and // decodeaudiodata to decode it and offlineaudiocontext to render it function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; source.connect(offlinectx.destination); source.start(); //source.loop = true; offlinectx.startrendering().then(function(renderedbuffer) { console.log('rendering c...
OfflineAudioContext - Web APIs
event handlers offlineaudiocontext.oncomplete is an eventhandler called when processing is terminated, that is when the complete event (of type offlineaudiocompletionevent) is raised, after the event-based version of offlineaudiocontext.startrendering() is used.
... online and offline audio context var audioctx = new audiocontext(); var offlinectx = new offlineaudiocontext(2,44100*40,44100); source = offlinectx.createbuffersource(); // use xhr to load an audio track, and // decodeaudiodata to decode it and offlineaudiocontext to render it function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; source.connect(offlinectx.destination); source.start(); //source.loop = true; offlinectx.startrendering().then(function(renderedbuffer) { console.log('rendering c...
OffscreenCanvas.getContext() - Web APIs
syntax offscreen.getcontext(contexttype, contextattributes); parameters contexttype is a domstring containing the context identifier defining the drawing context associated to the canvas.
... if the contexttype doesn't match a possible drawing context, null is returned.
Page Visibility API - Web APIs
the example, which pauses the video when you switch to another tab and plays again when you return to its tab, was created with the following code: // set the name of the hidden property and the change event for visibility var hidden, visibilitychange; if (typeof document.hidden !== "undefined") { // opera 12.10 and firefox 18 and later support hidden = "hidden"; visibilitychange = "visibilitychange"; } else if (typeof document.mshidden !== "undefined") { hidden = "mshidden"; visibilitychange = "msvisibilitychange"; } else if (typeof document.webkithidden !== "undefined") { hidden = "webkithidden"; visibilitychange = "webkitvisibilitychange"...
...; } var videoelement = document.getelementbyid("videoelement"); // if the page is hidden, pause the video; // if the page is shown, play the video function handlevisibilitychange() { if (document[hidden]) { videoelement.pause(); } else { videoelement.play(); } } // warn if the browser doesn't support addeventlistener or the page visibility api if (typeof document.addeventlistener === "undefined" || hidden === undefined) { console.log("this demo requires a browser, such as google chrome or firefox, that supports the page visibility api."); } else { // handle page visibility change document.addeventlistener(visibilitychange, handlevisibilitychange, false); // when the video pauses, set the title.
ParentNode.append() - Web APIs
WebAPIParentNodeappend
llowing code: // source: https://github.com/jserz/js_piece/blob/master/dom/parentnode/append()/append().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('append')) { return; } object.defineproperty(item, 'append', { configurable: true, enumerable: true, writable: true, value: function append() { var argarr = array.prototype.slice.call(arguments), docfrag = document.createdocumentfragment(); argarr.foreach(function (argitem) { var isnode = argitem instanceof node; docfrag.appendchild(isnode ?
... argitem : document.createtextnode(string(argitem))); }); this.appendchild(docfrag); } }); }); })([element.prototype, document.prototype, documentfragment.prototype]); specification specification status comment domthe definition of 'parentnode.append()' in that specification.
ParentNode.childElementCount - Web APIs
syntax var count = node.childelementcount; count the return value, which is an unsigned long (simply an integer) type.
... ;(function(constructor) { if (constructor && constructor.prototype && constructor.prototype.childelementcount == null) { object.defineproperty(constructor.prototype, 'childelementcount', { get: function() { var i = 0, count = 0, node, nodes = this.childnodes; while (node = nodes[i++]) { if (node.nodetype === 1) count++; } return count; } }); } })(window.node || window.element); specification...
ParentNode.children - Web APIs
example const foo = document.getelementbyid('foo'); for (let i = 0; i < foo.children.length; i++) { console.log(foo.children[i].tagname); } polyfill // overwrites native 'children' prototype.
...;(function(constructor) { if (constructor && constructor.prototype && constructor.prototype.children == null) { object.defineproperty(constructor.prototype, 'children', { get: function() { let i = 0, node, nodes = this.childnodes, children = []; while (node = nodes[i++]) { if (node.nodetype === 1) { children.push(node); } } return children; } }); } })(window.node || window.element); specification specification status comment domthe definition of 'parentnode.children' in that specification.
ParentNode.firstElementChild - Web APIs
syntax var element = node.firstelementchild; example <ul id="foo"> <li>first (1)</li> <li>second (2)</li> <li>third (3)</li> </ul> <script> var foo = document.getelementbyid('foo'); // yields: first (1) console.log(foo.firstelementchild.textcontent); </script> polyfill for ie8, ie9 and safari // overwrites native 'firstelementchild' prototype.
...;(function(constructor) { if (constructor && constructor.prototype && constructor.prototype.firstelementchild == null) { object.defineproperty(constructor.prototype, 'firstelementchild', { get: function() { var node, nodes = this.childnodes, i = 0; while (node = nodes[i++]) { if (node.nodetype === 1) { return node; } } return null; } }); } })(window.node || window.element); specification specification status comment domthe definition of 'parentnode.firstelementchild' in that specification.
ParentNode.lastElementChild - Web APIs
// overwrites native 'lastelementchild' prototype.
...;(function(constructor) { if(constructor && constructor.prototype && constructor.prototype.lastelementchild == null) { object.defineproperty(constructor.prototype, 'lastelementchild', { get: function() { var node, nodes = this.childnodes, i = nodes.length - 1; while(node = nodes[i--]) { if(node.nodetype === 1) { return node; } } return null; } }); } })(window.node || window.element); specification specification status comment domthe definition of 'parentnode.lastelementchild' in that specification.
ParentNode.prepend() - Web APIs
ailable: // source: https://github.com/jserz/js_piece/blob/master/dom/parentnode/prepend()/prepend().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('prepend')) { return; } object.defineproperty(item, 'prepend', { configurable: true, enumerable: true, writable: true, value: function prepend() { var argarr = array.prototype.slice.call(arguments), docfrag = document.createdocumentfragment(); argarr.foreach(function (argitem) { var isnode = argitem instanceof node; docfrag.appendchild(isnode ?
... argitem : document.createtextnode(string(argitem))); }); this.insertbefore(docfrag, this.firstchild); } }); }); })([element.prototype, document.prototype, documentfragment.prototype]); specification specification status comment domthe definition of 'parentnode.prepend()' in that specification.
PaymentMethodChangeEvent - Web APIs
syntax paymentmethodchangeevent = new paymentmethodchangeevent(type, options); parameters type a domstring which must contain the string paymentmethodchange, the name of the only type of event which uses the paymentmethodchangeevent interface.
... the type of the methoddetails property depends on the payment method.
Using the Payment Request API - Web APIs
(buildsupportedpaymentmethoddata(), buildshoppingcartdetails()); the functions invoked inside the constructor simply return the required object parameters: function buildsupportedpaymentmethoddata() { // example supported payment methods: return [{ supportedmethods: 'basic-card', data: { supportednetworks: ['visa', 'mastercard'], supportedtypes: ['debit', 'credit'] } }]; } function buildshoppingcartdetails() { // hardcoded for demo purposes: return { id: 'order-123', displayitems: [ { label: 'example item', amount: {currency: 'usd', value: '1.00'} } ], total: { label: 'total', amount: {currency: 'usd', value: '1.00'} } }; } starting the payment process once the ...
... showing additional user interface after successful payments if the merchant desires to collect additional information not part of the api (e.g., additional delivery instructions), the merchant can show a page with additional <input type="text"> fields after the checkout.
performance.clearResourceTimings() - Web APIs
the clearresourcetimings() method removes all performance entries with an entrytype of "resource" from the browser's performance data buffer and sets the size of the performance data buffer to zero.
... example function load_resource() { var image = new image(); image.src = "https://developer.mozilla.org/static/img/opengraph-logo.png"; } function clear_performance_timings() { if (performance === undefined) { log("browser does not support web performance"); return; } // create a resource timing performance entry by loading an image load_resource(); var supported = typeof performance.clearresourcetimings == "function"; if (supported) { console.log("run: performance.clearresourcetimings()"); performance.clearresourcetimings(); } else { console.log("performance.clearresourcetimings() not supported"); return; } // getentries should now return zero var p = performance.getentriesbytype("resource"); if (p.length == 0) console.log("...
performance.getEntries() - Web APIs
if you are only interested in performance entries of certain types or that have certain names, see getentriesbytype() and getentriesbyname().
...gin"); do_work(50000); performance.mark("end"); performance.mark("begin"); do_work(100000); performance.mark("end"); do_work(200000); performance.mark("end"); // use getentries() to iterate through the each entry let p = performance.getentries(); for (var i=0; i < p.length; i++) { console.log("entry[" + i + "]"); check_performanceentry(p[i]); } // use getentriesbytype() to get all "mark" entries p = performance.getentriesbytype("mark"); for (let i=0; i < p.length; i++) { console.log ("mark only entry[" + i + "]: name = " + p[i].name + "; starttime = " + p[i].starttime + "; duration = " + p[i].duration); } // use getentriesbyname() to get all "mark" entries named "begin" p = performance.getentriesbyname("begin", "mark"); for ...
performance.mark() - Web APIs
WebAPIPerformancemark
the application defined timestamp can be retrieved by one of the performance interface's getentries*() methods (getentries(), getentriesbyname() or getentriesbytype()).
...const allentries = performance.getentriesbytype("mark"); console.log(allentries.length); // 6 // get all of the "monkey" performancemark entries.
performance.setResourceTimingBufferSize() - Web APIs
the setresourcetimingbuffersize() method sets the browser's resource timing buffer size to the specified number of "resource" performance entry type objects.
... example function setresourcetimingbuffersize(maxsize) { if (performance === undefined) { log("browser does not support web performance"); return; } var supported = typeof performance.setresourcetimingbuffersize == "function"; if (supported) { log("...
PerformanceEntry.toJSON() - Web APIs
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 each method var s...
...upported = typeof obj[methods[i]] == "function"; if (supported) { var js = obj[methods[i]](); log("..." + methods[i] + "() = " + json.stringify(js)); } else { log("..." + methods[i] + " = not supported"); } } } specifications specification status comment performance timeline level 2the definition of 'tojson' in that specification.
PerformanceFrameTiming - Web APIs
an application can register a performanceobserver for "frame" performance entry types and the observer can retrieve data about the duration of each frame event.
..." /><text x="111" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performanceframetiming</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 (for "frame" performance entry types) by qualifying and constraining the properties as follows: performanceentry.entrytype returns "frame".
PerformanceNavigationTiming.domComplete - Web APIs
function print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomp...
...lete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'domcomplete' in that specification.
PerformanceNavigationTiming.domContentLoadedEventEnd - Web APIs
function print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomp...
...lete); console.log("dom interactive = " + p.dominteractive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'domcontentloadedeventend' in that specification.
PerformanceNavigationTiming.domContentLoadedEventStart - Web APIs
function print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomp...
...lete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'domcontentloadedeventstart' in that specification.
PerformanceNavigationTiming.domInteractive - Web APIs
function print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomp...
...lete); console.log("dom interactive = " + p.dominteractive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'dominteractive' in that specification.
PerformanceNavigationTiming.loadEventEnd - Web APIs
function print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomp...
...lete); console.log("dom interactive = " + p.dominteractive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'loadeventend' in that specification.
PerformanceNavigationTiming.loadEventStart - Web APIs
function print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomp...
...lete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'loadeventstart' in that specification.
PerformanceNavigationTiming.redirectCount - Web APIs
function print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomp...
...lete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'redirectcount' in that specification.
PerformanceNavigationTiming.unloadEventEnd - Web APIs
function print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomp...
...lete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'unloadeventend' in that specification.
PerformanceNavigationTiming.unloadEventStart - Web APIs
function print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomp...
...lete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'unloadeventstart' in that specification.
PerformanceObserver() - Web APIs
the observer callback is invoked when performance entry events are recorded for the entry types that have been registered, via the observe() method.
... example var observer = new performanceobserver(function(list, obj) { var entries = list.getentries(); for (var i=0; i < entries.length; i++) { // process "mark" and "frame" events } }); observer.observe({entrytypes: ["mark", "frame"]}); function perf_observer(list, observer) { // process the "measure" event } var observer2 = new performanceobserver(perf_observer); observer2.observe({entrytypes: ["measure"]}); specifications specification status comment performance timeline level 2the definition of 'performanceobserver()' in that specification.
PeformanceObserver.disconnect() - Web APIs
syntax performanceobserver.disconnect(); example var observer = new performanceobserver(function(list, obj) { var entries = list.getentries(); for (var i=0; i < entries.length; i++) { // process "mark" and "frame" events } }); observer.observe({entrytypes: ["mark", "frame"]}); function perf_observer(list, observer) { // process the "measure" event // ...
... // disable additional performance events observer.disconnect(); } var observer2 = new performanceobserver(perf_observer); observer2.observe({entrytypes: ["measure"]}); specifications specification status comment performance timeline level 2the definition of 'disconnect()' in that specification.
PerformanceResourceTiming.connectEnd - Web APIs
example in the following example, the value of the *start and *end properties of all "resource" type events are logged.
... function print_performanceentries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var v...
PerformanceResourceTiming.connectStart - Web APIs
example in the following example, the value of the *start and *end properties of all "resource" type events are logged.
... function print_performanceentries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (support...
PerformanceResourceTiming.decodedBodySize - Web APIs
example the following example, the value of the size properties of all "resource" type events are logged.
...e = not supported"); if ("encodedbodysize" in perfentry) console.log("encodedbodysize = " + perfentry.encodedbodysize); else console.log("encodedbodysize = not supported"); if ("transfersize" in perfentry) console.log("transfersize = " + perfentry.transfersize); else console.log("transfersize = not supported"); } function check_performanceentries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { log_sizes(p[i]); } } specifications specification status comment resource timing level 2the definition of 'decodedbodysize' in that specification.
PerformanceResourceTiming.domainLookupEnd - Web APIs
example in the following example, the value of the *start and *end properties of all "resource" type events are logged.
... function print_performanceentries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var v...
PerformanceResourceTiming.domainLookupStart - Web APIs
example in the following example, the value of the *start and *end properties of all "resource" type events are logged.
... function print_performanceentries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (support...
PerformanceResourceTiming.encodedBodySize - Web APIs
example the following example, the value of the size properties of all "resource" type events are logged.
...e = not supported"); if ("encodedbodysize" in perfentry) console.log("encodedbodysize = " + perfentry.encodedbodysize); else console.log("encodedbodysize = not supported"); if ("transfersize" in perfentry) console.log("transfersize = " + perfentry.transfersize); else console.log("transfersize = not supported"); } function check_performanceentries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { log_sizes(p[i]); } } specifications specification status comment resource timing level 2the definition of 'encodedbodysize' in that specification.
PerformanceResourceTiming.fetchStart - Web APIs
example in the following example, the value of the *start and *end properties of all "resource" type events are logged.
... function print_performanceentries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (support...
PerformanceResourceTiming.redirectEnd - Web APIs
example in the following example, the value of the *start and *end properties of all "resource" type events are logged.
... function print_performanceentries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (support...
PerformanceResourceTiming.redirectStart - Web APIs
example in the following example, the value of the *start and *end properties of all "resource" type events are logged.
... function print_performanceentries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (support...
PerformanceResourceTiming.requestStart - Web APIs
syntax resource.requeststart; return value a domhighrestimestamp representing the time immediately before the browser starts requesting the resource from the server example in the following example, the value of the *start and *end properties of all "resource" type events are logged.
... function print_performanceentries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (support...
PerformanceResourceTiming.responseEnd - Web APIs
example in the following example, the value of the *start and *end properties of all "resource" type events are logged.
... function print_performanceentries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (support...
PerformanceResourceTiming.responseStart - Web APIs
example in the following example, the value of the *start and *end properties of all "resource" type events are logged.
... function print_performanceentries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (support...
PerformanceResourceTiming.secureConnectionStart - Web APIs
example in the following example, the value of the *start and *end properties of all "resource" type events are logged.
... function print_performanceentries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (support...
PerformanceResourceTiming.transferSize - Web APIs
example the following example, the value of size properties of all "resource" type events are logged.
...e = not supported"); if ("encodedbodysize" in perfentry) console.log("encodedbodysize = " + perfentry.encodedbodysize); else console.log("encodedbodysize = not supported"); if ("transfersize" in perfentry) console.log("transfersize = " + perfentry.transfersize); else console.log("transfersize = not supported"); } function check_performanceentries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { log_sizes(p[i]); } } specifications specification status comment resource timing level 2the definition of 'transfersize' in that specification.
PerformanceResourceTiming.workerStart - Web APIs
example in the following example, the value of the *start and *end properties of all "resource" type events are logged.
... function print_performanceentries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart", "workerstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry...
Plugin - Web APIs
WebAPIPlugin
methods plugin.item returns the mime type of a supported content type, given the index number into a list of supported types.
... plugin.nameditem returns the mime type of a supported item.
PointerEvent.isPrimary - Web APIs
in a multi-pointer scenario (such as a touch screen that supports more than one touch point), this property is used to identify a master pointer among the set of active pointers for each pointer type.
... when two or more pointer device types are being used concurrently, multiple pointers (one for each pointertype) are considered primary.
ProgressEvent() - Web APIs
syntax progressevent = new progressevent(type, {lengthcomputable: abooleanvalue, loaded: anumber, total: anumber}); arguments the progressevent() constructor also inherits arguments from event().
... type is a domstring representing the name of the type of the progressevent.
PublicKeyCredentialCreationOptions.extensions - Web APIs
also chrome doesn't plan to support any other extension in future extension identifier type description authnsel array of buffersource authenticator selection.
...ey = { extensions:{ uvi: true, loc: false, uvm: false, exts: true }, challenge: new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // mybuffer will contain the result of any of the processing of the extensions var mybuffer = newcredentialinfo.getclientextensionresults(); // send attestation response and client extensions // to the server to proceed with the registration // of the credenti...
PublicKeyCredentialRequestOptions.allowCredentials - Web APIs
syntax allowcredentials = publickeycredentialrequestoptions.allowcredentials value an array whose elements are objects with the following properties: type a string describing type of public-key credential to be created.
... examples var options = { allowcredentials: [ { transports: ["usb"], type: "public-key", id: new uint8array(26) // actually provided by the server }, { transports: ["internal"], type: "public-key", id: new uint8array(26) // actually provided by the server } ], challenge: new uint8array([/* bytes sent from the server */]) }; navigator.credentials.get({ "publickey": options }) .then(function (credentialinfoassertion) { // ...
RTCAnswerOptions - Web APIs
the createoffer() method's options parameter is of this type.
...however, this is likely to change in the future, so the type has been defined in preparation for that eventuality.
RTCDTMFToneChangeEvent.RTCDTMFToneChangeEvent() - Web APIs
syntax var event = new rtcdtmftonechangeevent(type, options); parameters type a domstring containing the name of the event.
... options a dictionary of type rtcdtmftonechangeeventinit, which may contain one or more of the following fields: tone a domstring containing a single dtmf tone character which has just begun to play, or an empty string ("") to indicate that the previous tone has stopped playing.
RTCDataChannel.readyState - Web APIs
the read-only rtcdatachannel property readystate returns an enum of type rtcdatachannelstate which indicates the state of the data channel's underlying data connection.
...this is the default state of a new rtcdatachannel created by the webrtc layer when the remote peer created the channel and delivered to the site or app in a datachannel event of type rtcdatachannelevent.
RTCErrorEvent - Web APIs
properties in addition to the standard properties available on the event interface, rtcerrorevent also includes the following: error read only an rtcerror object specifying the error which occurred; this object includes the type of error that occurred, information about where the error occurred (such as which line number in the sdp or what sctp cause code was at issue).
... description there are other data types used for error events in webrtc, as needed for errors with special information sharing requirements.
RTCIceCandidate.RTCIceCandidate() - Web APIs
the following fields are initialized to null if they are not included in the rtcicecandidate.candidate property: foundation, component, priority , ip, protocol, port, type, tcptype, relatedaddress, and relatedport.
... exceptions typeerror the specified rtcicecandidateinit has values of null in both the sdpmid and sdpmlineindex properties.
RTCIceCandidate.relatedPort - Web APIs
example in this example, the candidate's type is checked, and then debugging output is presented, based on the candidate type, including the candidate's type, address (ip and port), and related address (relatedaddress and relatedport).
... var ip = candidate.ip; var port = candidate.port; var relip = candidate.relatedaddress; var relport = candidate.relatedport; if (relip && relport) { console.log("candidate type '" + type + "' -- contact address: " + ip + " " + port + ", related address: " + relip + " " + relport); } else { console.log("host candidate address is " + ip + " " + port); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidate.relatedport' in that specification.
RTCIceCandidatePairStats.selected - Web APIs
in any other browser, you can determine the selected candidate pair by looking for a stats object of type transport, which is an rtctransportstats object.
... function getcurrentcandidatepair(statsresults) { statsresults.foreach(report => { if (report.type === "transport") { currentpair = statsresults.get(report.selectedcandidatepairid); } }); if (!currentpair) { statsresults.foreach(report => { if (report.type === "candidate-pair" && report.selected) { currentpair = report; } }); } return currentpair; } specifications not part of any specification.
RTCIceCandidateStats.priority - Web APIs
the priority of a candidate is calculated using the following variables as inputs: the preferability of the candidate type (local, server reflexive, peer reflexive, or relayed) the preferability of the candidate's specific ip address (for multihomed agents) the candidate's component id (1 for rtp, 2 for rtcp) the candidate's priority is computed using the formula (ptype is the priority of the candidate's type and plocal is the priority of the ip address): priority = 224×ptype + 28×plocal + (256 - componentid)p...
...riority\quad =\quad { 2 }^{ 24 }\times { p }_{ type }\quad +\quad { 2 }^{ 8 }\times { p }_{ local }\quad +\quad (256\quad -\quad componentid) this is equivalent to mapping the priorities of teh candidate type, the local ip, and the component id into various bit ranges within the 32-bit priority value.
RTCIceCandidateStats.protocol - Web APIs
syntax protocol = rtcicecandidatestats.protocol; value the value is one of the members of the rtciceprotocol enumerated string type: tcp the candidate, if selected, would use tcp as the transport protocol for its data.
... the tcptype property provides additional information about the kind of tcp candidate represented by the object.
RTCIceComponent - Web APIs
the webrtc api's rtcicecomponent enumerated type contains domstring values that each identify a specific ice component; these are "rtp" and "rtcp".
... usage notes the rtcicecomponent type is used by the component property of rtcicecandidate and rtcicetransport objects.
RTCIceTransport.gatheringState - Web APIs
the read-only rtcicetransport property gatheringstate returns a domstring from the enumerated type rtcicegathererstate that indicates what gathering state the ice agent is currently in: "new", "gathering", or "complete".
... syntax gatherstate = rtcicetransport.gatheringstate; value a string from the rtcicegathererstate enumerated type whose value indicates the current state of the ice agent's candidate gathering process: "new" the rtcicetransport is newly created and has not yet started to gather ice candidates.
RTCOfferAnswerOptions - Web APIs
it's used as the base type for the options parameter when calling createoffer() or createanswer() on an rtcpeerconnection.
... each of createoffer() and createanswer() use rtcofferansweroptions as the base type for their options parameter's dictionary.
RTCPeerConnection.addTransceiver() - Web APIs
each entry is of type rtcrtpencodingparameters.
... exceptions typeerror a string was specified as trackorkind which is not valid.
RTCPeerConnection.createOffer() - Web APIs
in this case, a websocket connection is used to send a json message with a type field with the value "video-offer" to the other peer.
... mypeerconnection.createoffer().then(function(offer) { return mypeerconnection.setlocaldescription(offer); }) .then(function() { sendtoserver({ name: myusername, target: targetusername, type: "video-offer", sdp: mypeerconnection.localdescription }); }) .catch(function(reason) { // an error occurred, so handle the failure to connect }); in this code, the offer is created, and once successful, the local end of the rtcpeerconnection is configured to match by passing the offer (which is represented using an object conforming to rtcsessiondescriptioninit) into setlocaldescription(...
RTCPeerConnection.currentLocalDescription - Web APIs
example this example looks at the currentlocaldescription and displays an alert containing the rtcsessiondescription object's type and sdp fields.
... var pc = new rtcpeerconnection(); … var sd = pc.currentlocaldescription; if (sd) { alert("local session: type='" + sd.type + "'; sdp description='" + sd.sdp + "'"); } else { alert("no local session yet."); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.currentlocaldescription' in that specification.
RTCPeerConnection.currentRemoteDescription - Web APIs
example this example looks at the currentremotedescription and displays an alert containing the rtcsessiondescription object's type and sdp fields.
... var pc = new rtcpeerconnection(); … var sd = pc.currentremotedescription; if (sd) { alert("local session: type='" + sd.type + "'; sdp description='" + sd.sdp + "'"); } else { alert("no local session yet."); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.currentremotedescription' in that specification.
RTCPeerConnection.getStats() - Web APIs
window.setinterval(function() { mypeerconnection.getstats(null).then(stats => { let statsoutput = ""; stats.foreach(report => { statsoutput += `<h2>report: ${report.type}</h3>\n<strong>id:</strong> ${report.id}<br>\n` + `<strong>timestamp:</strong> ${report.timestamp}<br>\n`; // now the statistics for this report; we intentially drop the ones we // sorted to the top above object.keys(report).foreach(statname => { if (statname !== "id" && statname !== "timestamp" && statname !== "type") { statsoutput += `<...
...a section is created for each report with a header and all of the statistics below, with the type, id, and timestamp handled specially to place them at the top of the list.
RTCPeerConnection.getStreamById() - Web APIs
example var stream = pc.getstreambyid(mytrackid); if (stream) { console.log("found stream: " + stream.id); } polyfill running the following code before any other code will create rtcpeerconnection.prototype.getstreambyid() if it's not natively available.
... // from: https://bugs.chromium.org/p/chromium/issues/detail?id=698163&desc=5#c10 rtcpeerconnection.prototype.getstreambyid = function(id) { try { var localstreams = this.getlocalstreams(); var remotestreams = this.getremotestreams(); var i; for (i = 0; i < localstreams.length; i++) { if (localstreams[i].id == id) return localstreams[i]; } for (i = 0; i < remotestreams.length; i++) { if (remotestreams[i].id == id) return remotestreams[i]; } } catch(e) {} return null; } ...
RTCPeerConnection.localDescription - Web APIs
example this example looks at the localdescription and displays an alert containing the rtcsessiondescription object's type and sdp fields.
... var pc = new rtcpeerconnection(); … var sd = pc.localdescription; if (sd) { alert("local session: type='" + sd.type + "'; sdp description='" + sd.sdp + "'"); } else { alert("no local session yet."); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.localdescription' in that specification.
RTCPeerConnection: negotiationneeded event - Web APIs
pc.addeventlistener("negotiationneeded", ev => { pc.createoffer() .then(offer => return pc.setlocaldescription(offer)) .then(() => sendsignalingmessage({ type: "video-offer", sdp: pc.localdescription })) .catch(err => { /* handle error */ ); }, false); after creating the offer, the local end is configured by calling rtcpeerconnection.setlocaldescription(); then a signaling message is created and sent to the remote peer through the signaling server, to share that offer with the other peer.
... you can also set an event handler for the negotiationneeded event by assigning the event handler function to the rtcpeerconnection.onnegotiationneeded property: pc.onnegotiationneeded = ev => { pc.createoffer() .then(offer => return pc.setlocaldescription(offer)) .then(() => sendsignalingmessage({ type: "video-offer", sdp: pc.localdescription })) .catch(err => { /* handle error */ ); }; for a more detailed example, see starting negotiation in signaling and video calling.
RTCPeerConnection.onaddstream - Web APIs
the rtcpeerconnection.onaddstream event handler is a property containing the code to execute when the addstream event, of type mediastreamevent, is received by this rtcpeerconnection.
...these events, of type mediastreamevent, are sent when streams are added to the connection by the remote peer.
RTCPeerConnection.onidentityresult - Web APIs
the rtcpeerconnection.onidentityresult event handler is a property containing the code to execute when the identityresult event, of type rtcidentityevent, is received by this rtcpeerconnection.
...an event handler always has one single parameter, containing the event, here of type rtcidentityevent.
RTCPeerConnection.onidpassertionerror - Web APIs
the rtcpeerconnection.onidpassertionerror event handler is a property containing the code to execute whent the idpassertionerror event, of type rtcidentityerrorevent, is received by this rtcpeerconnection.
...an event handler always has one single parameter, containing the event, here of type rtcidentityerrorevent.
RTCPeerConnection.onidpvalidationerror - Web APIs
the rtcpeerconnection.onidpvalidationerror event handler is a property containing the code to execute whent the idpvalidationerror event, of type rtcidentityerrorevent, is received by this rtcpeerconnection.
...an event handler always has one single parameter, containing the event, here of type rtcidentityerrorevent.
RTCPeerConnection.onpeeridentity - Web APIs
the rtcpeerconnection.onpeeridentity event handler is a property containing the code to execute whent the peeridentity event, of type event, is received by this rtcpeerconnection.
...an event handler always has one single parameter, containing the event, here of type event.
RTCPeerConnection.onremovestream - Web APIs
the rtcpeerconnection.onremovestream event handler is a property containing the code to execute when the removestream event, of type mediastreamevent, is received by this rtcpeerconnection.
...an event handler always has one single parameter, containing the event, here of type mediastreamevent.
RTCPeerConnection.onsignalingstatechange - Web APIs
the function receives as input the event object of type event; this event is sent when the peer connection's signalingstate changes, which may happen either because of a call to setlocaldescription() or to setremotedescription().
...alingstatechange", mysignalingstatechangehandler); or, using an anonymous (inline) handler: myrtcpeerconnection.addeventlistener("signalingstatechange", event => { /* handle the event here */ }); example this snippet shows a handler for signalingstatechange that looks for the "have-local-pranswer" signaling state—indicating that a remote offer has been received and a local description of type "pranswer" has been applied in response.
RTCPeerConnection.remoteDescription - Web APIs
example this example looks at the remotedescription and displays an alert containing the rtcsessiondescription object's type and sdp fields.
... var pc = new rtcpeerconnection(); … var sd = pc.remotedescription; if (sd) { alert("remote session: type='" + sd.type + "'; sdp description='" + sd.sdp + "'"); } else { alert("no remote session yet."); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.remotedescription' in that specification.
RTCPeerConnectionIceErrorEvent - Web APIs
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.
RTCPeerConnectionIceEvent() - Web APIs
syntax var event = new rtcpeerconnectioniceevent(type, options); parameters type is a domstring containing the name of the event, like "icecandidate".
... options a dictionary of type rtcpeerconnectioninit, which may contain one or more of the following fields: "candidate" (optional, default is null): a rtcicecandidate representing the ice candidate being concerned by the event.
RTCPeerConnectionIceEvent - Web APIs
only one event is of this type: icecandidate.
...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.
RTCRtpCodecCapability - Web APIs
mimetype a domstring indicating the codec's mime media type and subtype.
...an array of objects of this type is returned in the codecs property of the rtcrtpcapabilities object returned in response to a call to either of the static functions rtcrtpsender.getcapabilities() or rtcrtpreceiver.getcapabilities().
RTCRtpEncodingParameters - Web APIs
codecpayloadtype when describing a codec for an rtcrtpsender, codecpayloadtype is a single 8-bit byte (or octet) specifying the codec to use for sending the stream; the value matches one from the owning rtcrtpparameters object's codecs parameter.
...the value is taken from the enumerated string type rtcdtxstatus.
RTCRtpReceiver.getCapabilities() static function - Web APIs
syntax let rtpcapabilities = rtcrtpreceiver.getcapabilities(kind); parameters kind a domstring indicating the type of media for which you wish to get the device's capability to receive.
... function canreceiveh264() { let capabilities = rtcrtpreceiver.getcapabilities("video"); capabilities.codecs.foreach((codec) => { if (codec.mimetype === "video/h264") { return true; } }); return false; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpreceiver.getcapabilities()' in that specification.
RTCRtpSendParameters.encodings - Web APIs
codecpayloadtype when describing a codec for an rtcrtpsender, codecpayloadtype is a single 8-bit byte (or octet) specifying the codec to use for sending the stream; the value matches one from the owning rtcrtpparameters object's codecs parameter.
...the value is taken from the enumerated string type rtcdtxstatus.
RTCRtpSendParameters - Web APIs
degradationpreference specifies the preferred way the webrtc layer should handle optimizing bandwidth against quality in constrained-bandwidth situations; the value comes from the rtcdegradationpreference enumerated string type, and the default is balanced.
... priority a string from the rtcprioritytype enumerated type which indicates the encoding's priority.
RTCRtpSender.getCapabilities() static function - Web APIs
syntax let rtpcapabilities = rtcrtpsender.getcapabilities(kind); parameters kind a domstring indicating the type of media for which you wish to get the sender's capability to receive.
... function cansendh264() { let capabilities = rtcrtpsender.getcapabilities("video"); capabilities.codecs.foreach((codec) => { if (codec.mimetype === "video/h264") { return true; } }); return false; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpsender.getcapabilities()' in that specification.
RTCRtpSender.setParameters() - Web APIs
the available options are: degradationpreference specifies the preferred way the webrtc layer should handle optimizing bandwidth against quality in constrained-bandwidth situations; the value comes from the rtcdegradationpreference enumerated string type, and the default is balanced.
... priority a string from the rtcprioritytype enumerated type which indicates the encoding's priority.
RTCRtpStreamStats.kind - Web APIs
this property was previously called mediatype.
...it will also match the statistics object's rtccodecstats.codec property's media type.
RTCRtpTransceiver.currentDirection - Web APIs
syntax var direction = rtcrtptransceiver.currentdirection value a domstring whose value is one of the strings which are a member of the rtcrtptransceiverdirection enumerated type.
... the rtcrtptransceiverdirection type is an enumeration of string values.
RTCRtpTransceiver.direction - Web APIs
syntax var direction = rtcrtptransceiver.direction value a domstring whose value is one of the strings which are a member of the rtcrtptransceiverdirection enumerated type, indicating the transceiver's preferred direction.
... the rtcrtptransceiverdirection type is an enumeration of string values.
RTCSessionDescription.toJSON() - Web APIs
both properties, type and sdp, are contained in the generated json.
... syntax var jsonvalue = sd.tojson(); the result value is a json object containing the following values: "type", containing the value of the rtcsessiondescription.type property and can be one of the following values: "offer", "answer", "pranswer" or null.
RTCStats - Web APIs
WebAPIRTCStats
type a domstring indicating the type of statistics the object contains, taken from the enum type rtcstatstype.
... the statistics type hierarchy the various dictionaries that are used to define the contents of the objects that contain each of the various types of statistics for webrtc are structured in such a way that they build upon the core rtcstats dictionary, each layer adding more relevant information.
Range.comparePoint() - Web APIs
if the reference node is a node of type text, comment, or cdatasection, then offset is the number of characters from the start of reference node.
... for other node types, offset is the number of child nodes between the start of the reference node.
Range.endOffset - Web APIs
WebAPIRangeendOffset
if the endcontainer is a node of type text, comment, or cdatasection, then the offset is the number of characters from the start of the endcontainer to the boundary point of the range.
... for other node types, the endoffset is the number of child nodes between the start of the endcontainer and the boundary point of the range.
Range.setStart() - Web APIs
WebAPIRangesetStart
if the startnode is a node of type text, comment, or cdatasection, then startoffset is the number of characters from the start of startnode.
... for other node types, startoffset is the number of child nodes between the start of the startnode.
Range.startOffset - Web APIs
WebAPIRangestartOffset
if the startcontainer is a node of type text, comment, or cdatasection, then the offset is the number of characters from the start of the startcontainer to the boundary point of the range.
... for other node types, the startoffset is the number of child nodes between the start of the startcontainer and the boundary point of the range.
ReadableStream.getReader() - Web APIs
syntax var reader = readablestream.getreader({mode}); parameters {mode} optional an object containing a property mode, which takes as its value a domstring specifying the type of reader to create.
... typeerror the stream you are trying to create a reader for is not a readablestream.
ReadableStreamBYOBReader.releaseLock() - Web APIs
this will result in a typeerror being thrown.
... exceptions typeerror the source object is not a readablestreambyobreader, or a read request is pending.
ReadableStreamDefaultReader.releaseLock() - Web APIs
this will result in a typeerror being thrown.
... exceptions typeerror the source object is not a readablestreamdefaultreader, or a read request is pending.
Request - Web APIs
WebAPIRequest
this is a string indicating the type of content being requested.
...ng snippet, we create a new request using the request() constructor with some initial data and body content for an api request which need a body payload: const request = new request('https://example.com', {method: 'post', body: '{"foo": "bar"}'}); const url = request.url; const method = request.method; const credentials = request.credentials; const bodyused = request.bodyused; note: the body type can only be a blob, buffersource, formdata, urlsearchparams, usvstring or readablestream type, so for adding a json object to the payload you need to stringify that object.
RequestDestination - Web APIs
the requestdestination enumerated type contains the permitted values for a request's destination.
... these string values indicate potential types of content that a request may try to retrieve.
Response - Web APIs
WebAPIResponse
response.type read only the type of the response (e.g., basic, cors).
... you'll notice that since we are requesting an image, we need to run body.blob (response implements body) to give the response its correct mime type.
SVGAltGlyphElement - Web APIs
it's data type is 'string'.
...it's data type is 'string'.
SVGAnimatedAngle - Web APIs
svg animated angle interface the svganimatedangle interface is used for attributes of basic type <angle> which can be animated.
... interface overview also implement none methods none properties readonly svgangle baseval readonly svgangle animval normative document svg 1.1 (2nd edition) properties name type description baseval svgangle the base value of the given attribute before applying any animations.
SVGAnimatedBoolean - Web APIs
svg animated boolean interface the svganimatedboolean interface is used for attributes of type boolean which can be animated.
... interface overview also implement none methods none properties readonly boolean baseval readonly boolean animval normative document svg 1.1 (2nd edition) properties name type description baseval boolean the base value of the given attribute before applying any animations.
SVGAnimatedInteger - Web APIs
svg animated integer interface the svganimatedinteger interface is used for attributes of basic type <integer> which can be animated.
... interface overview also implement none methods none properties readonly long baseval readonly long animval normative document svg 1.1 (2nd edition) properties name type description baseval long the base value of the given attribute before applying any animations.
SVGAnimatedLength - Web APIs
svg animated length interface the svganimatedlength interface is used for attributes of basic type <length> which can be animated.
... interface overview also implement none methods none properties readonly svglength baseval readonly svglength animval normative document svg 1.1 (2nd edition) properties name type description baseval svglength the base value of the given attribute before applying any animations.
SVGAnimatedLengthList - Web APIs
svg animated length list interface the svganimatedlengthlist interface is used for attributes of type svglengthlist which can be animated.
... interface overview also implement none methods none properties readonly svglengthlist baseval readonly svglengthlist animval normative document svg 1.1 (2nd edition) properties name type description baseval svglengthlist the base value of the given attribute before applying any animations.
SVGAnimatedNumber - Web APIs
svg animated number interface the svganimatednumber interface is used for attributes of basic type <number> which can be animated.
... interface overview also implement none methods none properties float baseval readonly float animval normative document svg 1.1 (2nd edition) properties name type description baseval float the base value of the given attribute before applying any animations.
SVGAnimatedPathData - Web APIs
name type description animatednormalizedpathseglist svgpathseglist provides access to the current animated contents of the 'd' attribute in a form where all path data commands are expressed in terms of the following subset of svgpathseg types: svg_pathseg_moveto_abs (m), svg_pathseg_lineto_abs (l), svg_pathseg_curveto_cubic_abs (...
... normalizedpathseglist svgpathseglist provides access to the base (i.e., static) contents of the 'd' attribute in a form where all path data commands are expressed in terms of the following subset of svgpathseg types: svg_pathseg_moveto_abs (m), svg_pathseg_lineto_abs (l), svg_pathseg_curveto_cubic_abs (c) and svg_pathseg_closepath (z).
SVGClipPathElement - Web APIs
takes one of the constants defined in svgunittypes.
... candidate recommendation removed the inheritance from svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, svgtransformable, and svgunittypes scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgclippathelement' in that specification.
SVGDocument - Web APIs
svg document interface when an "svg" element is embedded inline as a component of a document from another namespace, such as when an "svg" element is embedded inline within an xhtml document, then an svgdocument object will not exist; instead, the root object in the document object hierarchy will be a document object of a different type, such as an htmldocument object.
... properties domstring domain domstring referrer svgsvgelement rootelement domstring title domstring url normative document svg 1.1 (2nd edition) properties name type description domain domstring the domain name of the server that served the document, or a null string if the server cannot be identified by a domain name.
SVGEvent - Web APIs
WebAPISVGEvent
properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
SVGFEBlendElement - Web APIs
#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="396" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfeblendelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_feblend_mode_unknown 0 the type is not one of predefined types.
... it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
SVGFEConvolveMatrixElement - Web APIs
f8" stroke="#d4dde4" stroke-width="2px" /><text x="351" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfeconvolvematrixelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_edgemode_unknown 0 the type is not one of predefined types.
... it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
SVGFEDisplacementMapElement - Web APIs
f8" stroke="#d4dde4" 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">svgfedisplacementmapelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_channel_unknown 0 the type is not one of predefined types.
... it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
SVGFEGaussianBlurElement - Web APIs
f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="361" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfegaussianblurelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_edgemode_unknown 0 the type is not one of predefined types.
... it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
SVGFEMorphologyElement - Web APIs
oke="#d4dde4" 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">svgfemorphologyelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_morphology_operator_unknown 0 the type is not one of predefined types.
... it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
SVGMaskElement - Web APIs
takes one of the constants defined in svgunittypes.
...takes one of the constants defined in svgunittypes.
SVGPatternElement - Web APIs
takes one of the constants defined in svgunittypes.
...takes one of the constants defined in svgunittypes.
SVGRenderingIntent - Web APIs
constants name value description rendering_intent_unknown 0 the type is not one of predefined types.
... it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
SVGStylable - Web APIs
interface overview also implement none methods cssvalue getpresentationattribute(in domstring name) properties readonly svganimatedstring classname readonly cssstyledeclaration style normative document svg 1.1 (2nd edition) properties name type description classname svganimatedstring corresponds to attribute class on the given element.
... methods name & arguments return description getpresentationattribute(in domstring name) cssvalue returns the base (i.e., static) value of a given presentation attribute as an object of type cssvalue.
SVGZoomAndPan - Web APIs
fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="66" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgzoomandpan</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_zoomandpan_unknown 0 the type is not one of predefined types.
... it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
Screen.orientation - Web APIs
note that older, prefixed versions returned a domstring equivalent to screenorientation.type.
... example var orientation = (screen.orientation || {}).type || screen.mozorientation || screen.msorientation; if (orientation === "landscape-primary") { console.log("that looks good."); } else if (orientation === "landscape-secondary") { console.log("mmmh...
Screen - Web APIs
WebAPIScreen
methods screen.lockorientation lock the screen orientation (only works in fullscreen or for installed apps) screen.unlockorientation unlock the screen orientation (only works in fullscreen or for installed apps) methods inherited from eventtarget: eventtarget.addeventlistener() registers an event handler of a specific event type on the eventtarget.
... void seteventhandler(domstring type, eventhandler handler) eventhandler geteventhandler(domstring type) example if (screen.pixeldepth < 8) { // use low-color version of page } else { // use regular, colorful page } specification specification status comment css object model (cssom) view modulethe definition of 'screen' in that specification.
ScreenOrientation - Web APIs
properties screenorientation.typeread only returns the document's current orientation type, one of "portrait-primary", "portrait-secondary", "landscape-primary", or "landscape-secondary".
... 38chrome android full support 38firefox android full support 43opera android full support 25safari ios no support nosamsung internet android full support 3.0typechrome full support 38edge full support 79firefox full support 43ie no support noopera full support 25safari no support nowebview ...
ServiceWorkerGlobalScope: notificationclick event - Web APIs
handler onnotificationclick examples you can use the notificationclick event in an addeventlistener method: self.addeventlistener('notificationclick', function(event) { console.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (var i = 0; i < clientlist.length; i++) { var client = clientlist[i]; if (client.url == '/' && 'focus' in client) return client.focus(); } if (clients.openwindow) return clients.openwindow('/'); })); }); or use the onnotificationclick event handler property: self.onnotificationclick = function(event) { con...
...sole.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (var i = 0; i < clientlist.length; i++) { var client = clientlist[i]; if (client.url == '/' && 'focus' in client) return client.focus(); } if (clients.openwindow) return clients.openwindow('/'); })); }; specifications specification status notifications apithe definition of 'onnotificationclick' in that specification.
ServiceWorkerMessageEvent.ServiceWorkerMessageEvent() - Web APIs
syntax var myswme = new serviceworkermessageevent(type, init); parameters type a domstring that defines the type of the message event being created.
... init optional an initialisation object, which should contain the following parameters: data: the event's data — this can be any type.
ServiceWorkerMessageEvent.data - Web APIs
it can be any data type.
... syntax var mydata = serviceworkermessageeventinstance.data; value any data type.
Using Service Workers - Web APIs
const imgload = (url) => { return new promise((resolve, reject) => { var request = new xmlhttprequest(); request.open('get', url); request.responsetype = 'blob'; request.onload = () => { if (request.status == 200) { resolve(request.response); } else { reject(error('image didn\'t load successfully; error code:' + request.statustext)); } }; request.onerror = () => { reject(error('there was a network error.')); }; request.send(); }); } we return a new promise using the promise() cons...
...here we are just telling the browser what the content type of our synthetic response is: new response('<p>hello from your friendly neighbourhood service worker!</p>', { headers: { 'content-type': 'text/html' } }); if a match wasn’t found in the cache, you could tell the browser to simply fetch the default network request for that resource, to get the new resource from the network if it is available: fetch(event.request); if a match ...
SpeechSynthesis.getVoices() - Web APIs
example javascript function populatevoicelist() { if(typeof speechsynthesis === 'undefined') { return; } var voices = speechsynthesis.getvoices(); for(var i = 0; i < voices.length; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' (' + voices[i].lang + ')'; if(voices[i].default) { option.textcontent += ' -- default'; } option.setattribute('data-lang', voices[i].lang); ...
... option.setattribute('data-name', voices[i].name); document.getelementbyid("voiceselect").appendchild(option); } } populatevoicelist(); if (typeof speechsynthesis !== 'undefined' && speechsynthesis.onvoiceschanged !== undefined) { speechsynthesis.onvoiceschanged = populatevoicelist; } html <select id="voiceselect"></select> specifications specification status comment web speech apithe definition of 'getvoices()' in that specification.
StaticRange.StaticRange() - Web APIs
exceptions invalidnodetypeerror a domexception fired if either or both of the startcontainer and/or endcontainer are a type of node which you can't include in a range.
... those node types are node.document_type_node (representing the documenttype node derived from the dtd identified using the doctype preamble in the html, for example) and the attr node describing an attribute of an element on the dom..
StorageEvent - Web APIs
x="116" y="1" width="120" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="176" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">storageevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} method overview void initstorageevent( in domstring type, in boolean canbubble, in boolean cancelable, in domstring key, in domstring oldvalue, in domstring newvalue, in usvstring url, in storage storagearea ); attributes attribute type description key domstring represents the key changed.
... syntax storageevent.initstorageevent(type[, canbubble[, cancelable[, key[, oldvalue[, newvalue[, url[, storagearea]]]]]]]) parameters typearg the name of the event.
Storage API - Web APIs
the diagram below shows a site storage pool with three storage units within, showing how storage units can have different data types stored within and may have different quotas (maximum storage limits).
...the "persistent-storage" feature's permission-related flags, algorithms, and types are all set to the standard defaults for a permission, except that the permission state must be the same across the entire origin, and that if the permission state isn't "granted" (meaning that for whatever reason, access to the persistent storage feature was denied), the origin's site storage unit's box mode is always "best-effort".
StylePropertyMap - Web APIs
the stylepropertymap interface of the the css typed object model api provides a representation of a css declaration block that is an alternative to cssstyledeclaration.
... specifications specification status comment css typed om level 1the definition of 'stylepropertymap' in that specification.
StylePropertyMapReadOnly.entries() - Web APIs
the stylepropertymapreadonly.entries() method 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).
... example // tbd specifications specification status comment css typed om level 1the definition of 'entries()' in that specification.
SubmitEvent.submitter - Web APIs
while this is often an <input> element whose type or a <button> whose type is submit, it could be some other element which has initiated a submission process.
... let form = document.queryselector("form"); form.addeventlistener("submit", (event) => { let submitter = event.submitter; let handler = submitter.id; if (handler) { processorder(form, handler); } else { showalertmessage("an unknown or unaccepted payment type was selected.
SubtleCrypto.generateKey() - Web APIs
syntax const result = crypto.subtle.generatekey(algorithm, extractable, keyusages); parameters algorithm is a dictionary object defining the type of key to generate and providing extra algorithm-specific parameters.
... exceptions the promise is rejected when the following exception is encountered: syntaxerror raised when the result is a cryptokey of type secret or private but keyusages is empty.
TouchEvent - Web APIs
initial value: 1.0 touch event types there are several types of event that can be fired to indicate that touch-related changes have occurred.
... you can determine which of these has happened by looking at the event's touchevent.type property.
Touch events - Web APIs
it is only intended as a guide.) function ontouch(evt) { evt.preventdefault(); if (evt.touches.length > 1 || (evt.type == "touchend" && evt.touches.length > 0)) return; var newevt = document.createevent("mouseevents"); var type = null; var touch = null; switch (evt.type) { case "touchstart": type = "mousedown"; touch = evt.changedtouches[0]; break; case "touchmove": type = "mousemove"; touch = evt.changedtouches[0]; break; case "touchend": type =...
... "mouseup"; touch = evt.changedtouches[0]; break; } newevt.initmouseevent(type, true, true, evt.originaltarget.ownerdocument.defaultview, 0, touch.screenx, touch.screeny, touch.clientx, touch.clienty, evt.ctrlkey, evt.altkey, evt.shiftkey, evt.metakey, 0, null); evt.originaltarget.dispatchevent(newevt); } calling preventdefault() only on a second touch one technique for preventing things like pinchzoom on a page is to call preventdefault() on the second touch in a series.
TrackEvent() - Web APIs
syntax trackevent = new trackevent(type, eventinfo); parameters type the type of track event which is described by the object: "addtrack" or "removetrack".
... eventinfo optional an optional dictionary providing additional information configuring the new event; it can contain the following fields in any combination: track optional the track to which the event refers; this is null by default, but should be set to a videotrack, audiotrack, or texttrack as appropriate given the type of track.
Transferable - Web APIs
this is an abstract interface and there is no object of this type.
... the arraybuffer, messageport, imagebitmap and offscreencanvas types implement this interface.
TransformStream - Web APIs
async transform(chunk, controller) { chunk = await chunk switch (typeof chunk) { case 'object': // just say the stream is done i guess if (chunk === null) controller.terminate() else if (arraybuffer.isview(chunk)) controller.enqueue(new uint8array(chunk.buffer, chunk.byteoffset, chunk.bytelength)) else if (array.isarray(chunk) && chunk.every(value => typeof value === 'number')) controller.enqueue(new uint8ar...
...ray(chunk)) else if ('function' === typeof chunk.valueof && chunk.valueof() !== chunk) this.transform(chunk.valueof(), controller) // hack else if ('tojson' in chunk) this.transform(json.stringify(chunk), controller) break case 'symbol': controller.error("cannot send a symbol as a chunk part") break case 'undefined': controller.error("cannot send undefined as a chunk part") default: controller.enqueue(this.textencoder.encode(string(chunk))) break }, flush() { /* do any destructor work here */ } } class anytou8stream extends transformstream { constructor() { super({...transformcontent, textencoder: new textencoder()}) } } polyfilling textencoderstream and textdecoderstream note that this ...
TransitionEvent() - Web APIs
syntax transitionevent = new transitionevent(type, {propertyname: apropertyname, elapsedtime : afloat, pseudoelement: apseudoelementname}); arguments the transitionevent() constructor also inherits arguments from event().
... type is a domstring representing the name of the type of the transitionevent.
TreeWalker - Web APIs
treewalker.whattoshow read only returns an unsigned long being a bitmask made of constants describing the types of node that must be presented.
... nodefilter.show_document_type 512 shows documenttype nodes.
UIEvent.initUIEvent() - Web APIs
syntax event.inituievent(type, canbubble, cancelable, view, detail) parameters type is a domstring defining the type of event.
... detail is an unsigned long specifying some detail information about the event, depending on the type of event.
UIEvent.layerX - Web APIs
WebAPIUIEventlayerX
examples <html> <head> <title>pagex\pagey & layerx\layery example</title> <script type="text/javascript"> function showcoords(evt){ var form = document.forms.form_coords; var parent_id = evt.target.parentnode.id; form.parentid.value = parent_id; form.pagexcoords.value = evt.pagex; form.pageycoords.value = evt.pagey; form.layerxcoords.value = evt.layerx; form.layerycoords.value = evt.layery; } </script> <style type="text/css"> #d1 { border: solid blue 1px; padd...
...note the pagex\pagey properties still return the absolute position in the document, including page scrolling.</span> </div> <div id="d3"> <form name="form_coords" id="form1"> parent element id: <input type="text" name="parentid" size="7" /><br /> pagex:<input type="text" name="pagexcoords" size="7" /> pagey:<input type="text" name="pageycoords" size="7" /><br /> layerx:<input type="text" name="layerxcoords" size="7" /> layery:<input type="text" name="layerycoords" size="7" /> </form> </div> </body> </html> specifications this property is not part of any specification.
UIEvent.layerY - Web APIs
WebAPIUIEventlayerY
example <html> <head> <title>pagex\pagey & layerx\layery example</title> <script type="text/javascript"> function showcoords(evt){ var form = document.forms.form_coords; var parent_id = evt.target.parentnode.id; form.parentid.value = parent_id; form.pagexcoords.value = evt.pagex; form.pageycoords.value = evt.pagey; form.layerxcoords.value = evt.layerx; form.layerycoords.value = evt.layery; } </script> <style type="text/css"> #d1 { border: solid blue 1px; padd...
...note the pagex\pagey properties still return the absolute position in the document, including page scrolling.</span> </div> <div id="d3"> <form name="form_coords" id="form1"> parent element id: <input type="text" name="parentid" size="7" /><br /> pagex:<input type="text" name="pagexcoords" size="7" /> pagey:<input type="text" name="pageycoords" size="7" /><br /> layerx:<input type="text" name="layerxcoords" size="7" /> layery:<input type="text" name="layerycoords" size="7" /> </form> </div> </body> </html> specifications this property is not part of any specification.
UIEvent.pageY - Web APIs
WebAPIUIEventpageY
example <html> <head> <title>pagex\pagey & layerx\layery example</title> <script type="text/javascript"> function showcoords(evt){ var form = document.forms.form_coords; var parent_id = evt.target.parentnode.id; form.parentid.value = parent_id; form.pagexcoords.value = evt.pagex; form.pageycoords.value = evt.pagey; form.layerxcoords.value = evt.layerx; form.layerycoords.value = evt.layery; } </script> <style type="text/css"> #d1 { border: solid blue 1px; pad...
...note the pagex\pagey properties still return the absolute position in the document, including page scrolling.</span> </div> <div id="d3"> <form name="form_coords"> parent element id: <input type="text" name="parentid" size="7" /><br /> pagex:<input type="text" name="pagexcoords" size="7" /> pagey:<input type="text" name="pageycoords" size="7" /><br /> layerx:<input type="text" name="layerxcoords" size="7" /> layery:<input type="text" name="layerycoords" size="7" /> </form> </div> </body> </html> specifications this property is not part of any specification.
UIEvent - Web APIs
WebAPIUIEvent
uievent.detailread only returns a long with details about the event, depending on the event type.
... obsolete added the uievent() constructor, deprecated the inituievent() method and changed the type of view from abstractview to windowproxy.
USBDevice.controlTransferOut() - Web APIs
the available options are: requesttype: must be one of three values specifying whether the tranfer is "standard" (common to all usb devices) "class" (common to an industry-standard class of devices) or "vendor".
... data a typedarray containing the data that will be transfered to the device.
ValidityState.rangeOverflow - Web APIs
if the field is numeric in nature, including the date, month, week, time, datetime-local, number and range types and a max value is set, if the value don't doesn't conform to the constraints set by the max value, the rangeoverflow property will be true.
... given the following: <input type="number" min="20" max="40" step="2"/> if value > 40, rangeoverflow will be true.
ValidityState.rangeUnderflow - Web APIs
if the field is numeric in nature, including the date, month, week, time, datetime-local, number and range types and a min value is set, if the value don't doesn't conform to the constraints set by the min value, the rangeunderflow property will be true.
... given the following: <input type="number" min="20" max="40" step="2"/> if value < 20, rangeunderflow will be true.
ValidityState.stepMismatch - Web APIs
if the field is numeric in nature, including the date, month, week, time, datetime-local, number and range types and the step value is not any, if the value don't doesn't conform to the constraints set by the step and min values, then stepmismatch will be true.
... given the following: <input type="number" min="20" max="40" step="2"/> if (value - min) / 2 != 0, stepmismatch will be true.
VideoTrackList: change event - Web APIs
bubbles no cancelable no interface event event handler property onchange examples using addeventlistener(): const videoelement = document.queryselector('video'); videoelement.videotracks.addeventlistener('change', (event) => { console.log(`'${event.type}' event fired`); }); // changing the value of `selected` will trigger the `change` event const toggletrackbutton = document.queryselector('.toggle-track'); toggletrackbutton.addeventlistener('click', () => { const track = videoelement.videotracks[0]; track.selected = !track.selected; }); using the onchange event handler property: const videoelement = document.queryselector('video'); video...
...element.videotracks.onchange = (event) => { console.log(`'${event.type}' event fired`); }; // changing the value of `selected` will trigger the `change` event const toggletrackbutton = document.queryselector('.toggle-track'); toggletrackbutton.addeventlistener('click', () => { const track = videoelement.videotracks[0]; track.selected = !track.selected; }); specifications specification status html living standardthe definition of 'change' in that specification.
WakeLockSentinel - Web APIs
releasing all wakelocksentinel instances of a given wake lock type will cause the underlying platform wake lock to be released.
... type read only returns a string representation of the currently acquired wakelocksentinel type.
WebGLRenderingContext.bufferData() - Web APIs
srcdata optional an arraybuffer, sharedarraybuffer or one of the arraybufferview typed array types that will be copied into the data store.
... gl.getbufferparameter(gl.array_buffer, gl.buffer_size); gl.getbufferparameter(gl.array_buffer, gl.buffer_usage); getting size of a typed array to calculate size parameter for a typed array.
WebGLRenderingContext.checkFramebufferStatus() - Web APIs
gl.framebuffer_incomplete_attachment: the attachment types are mismatched or not all framebuffer attachment points are framebuffer attachment complete.
... when using the ovr_multiview2 extension, the following value can be returned additionally: ext.framebuffer_incomplete_view_targets_ovr: if baseviewindex is not the same for all framebuffer attachment points where the value of framebuffer_attachment_object_type is not none, the framebuffer is considered incomplete.
WebGLRenderingContext.getActiveAttrib() - Web APIs
the webglrenderingcontext.getactiveattrib() method of the webgl api returns a webglactiveinfo object containing size, type, and name of a vertex attribute.
... examples const numattribs = gl.getprogramparameter(program, gl.active_attributes); for (let i = 0; i < numattribs; ++i) { const info = gl.getactiveattrib(program, i); console.log('name:', info.name, 'type:', info.type, 'size:', info.size); } specifications specification status comment webgl 1.0the definition of 'getactiveattrib' in that specification.
WebGLRenderingContext.getShaderParameter() - Web APIs
gl.shader_type: returns a glenum indicating whether the shader is a vertex shader (gl.vertex_shader) or fragment shader (gl.fragment_shader) object.
... examples gl.getshaderparameter(shader, gl.shader_type); specifications specification status comment webgl 1.0the definition of 'getshaderparameter' in that specification.
WebGLRenderingContext.getUniform() - Web APIs
return value the returned type depends on the uniform type: uniform type returned type webgl 1 only boolean glboolean int glint float glfloat vec2 float32array (with 2 elements) ivec2 int32array (with 2 elements) bvec2 array of glboolean (with 2 elements) vec3 float32array (with 3 elements) ivec3 int32array (with 3 elements) ...
...int32array (with 3 elements) uvec4 uint32array (with 4 elements) mat2x3 float32array (with 6 elements) mat2x4 float32array (with 8 elements) mat3x2 float32array (with 6 elements) mat3x4 float32array (with 12 elements) mat4x2 float32array (with 8 elements) mat4x3 float32array (with 12 elements) any sampler type glint examples var loc = gl.getuniformlocation(program, 'u_foobar'); gl.getuniform(program, loc); specifications specification status comment webgl 1.0the definition of 'getuniform' in that specification.
WebGLRenderingContext.pixelStorei() - Web APIs
pixel storage parameters parameter name (for pname) description type default value allowed values (for param) specified in gl.pack_alignment packing of pixel data into memory glint 4 1, 2, 4, 8 opengl es 2.0 gl.unpack_alignment unpacking of pixel data from memory.
... glenum gl.browser_default_webgl gl.browser_default_webgl, gl.none webgl when using a webgl 2 context, the following values are available additionally: constant description type default value allowed values (for param) specified in gl.pack_row_length number of pixels in a row.
WebGLRenderingContext.renderbufferStorage() - Web APIs
alpha8 (also available as an extension for webgl 1, see below) gl.rgb10_a2 gl.rgba8ui gl.rgba8i gl.rgb10_a2ui gl.rgba16ui gl.rgba16i gl.rgba32i gl.rgba32ui gl.depth_component24 gl.depth_component32f gl.depth24_stencil8 gl.depth32f_stencil8 when using the webgl_color_buffer_float extension: ext.rgba32f_ext: rgba 32-bit floating-point type.
... ext.rgb32f_ext: rgb 32-bit floating-point type.
WebGLShader - Web APIs
a webglprogram requires both types of shaders.
... function createshader (gl, sourcecode, type) { // compiles either a shader of type gl.vertex_shader or gl.fragment_shader var shader = gl.createshader( type ); gl.shadersource( shader, sourcecode ); gl.compileshader( shader ); if ( !gl.getshaderparameter(shader, gl.compile_status) ) { var info = gl.getshaderinfolog( shader ); throw 'could not compile webgl program.
Hello GLSL - Web APIs
hello glsl!</p> <canvas>your browser does not seem to support html5 canvas.</canvas> body { text-align : center; } canvas { width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : block; font-size : inherit; margin : auto; padding : 0.6em; } <script type="x-shader/x-vertex" id="vertex-shader"> #version 100 void main() { gl_position = vec4(0.0, 0.0, 0.0, 1.0); gl_pointsize = 64.0; } </script> <script type="x-shader/x-fragment" id="fragment-shader"> #version 100 void main() { gl_fragcolor = vec4(0.18, 0.54, 0.34, 1.0); } </script> ;(function(){ "use strict" window.addeventlistener("load", setupwebgl, false); var gl, program; functio...
...n setupwebgl (evt) { window.removeeventlistener(evt.type, setupwebgl, false); if (!(gl = getrenderingcontext())) return; var source = document.queryselector("#vertex-shader").innerhtml; var vertexshader = gl.createshader(gl.vertex_shader); gl.shadersource(vertexshader,source); gl.compileshader(vertexshader); source = document.queryselector("#fragment-shader").innerhtml var fragmentshader = gl.createshader(gl.fragment_shader); gl.shadersource(fragmentshader,source); gl.compileshader(fragmentshader); program = gl.createprogram(); gl.attachshader(program, vertexshader); gl.attachshader(program, fragmentshader); gl.linkprogram(program); gl.detachshader(program, vertexshader); gl.detachshader(program, fragmentshader); gl.deleteshader(vertexshader); gl.delete...
Hello vertex attributes - Web APIs
on the canvas to change the horizontal position of the square.</p> <canvas>your browser does not seem to support html5 canvas.</canvas> body { text-align : center; } canvas { width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : block; font-size : inherit; margin : auto; padding : 0.6em; } <script type="x-shader/x-vertex" id="vertex-shader"> #version 100 precision highp float; attribute float position; void main() { gl_position = vec4(position, 0.0, 0.0, 1.0); gl_pointsize = 64.0; } </script> <script type="x-shader/x-fragment" id="fragment-shader"> #version 100 precision mediump float; void main() { gl_fragcolor = vec4(0.18, 0.54, 0.34, 1.0); } </script> ;(function(){ "use stric...
...t" window.addeventlistener("load", setupwebgl, false); var gl, program; function setupwebgl (evt) { window.removeeventlistener(evt.type, setupwebgl, false); if (!(gl = getrenderingcontext())) return; var source = document.queryselector("#vertex-shader").innerhtml; var vertexshader = gl.createshader(gl.vertex_shader); gl.shadersource(vertexshader,source); gl.compileshader(vertexshader); source = document.queryselector("#fragment-shader").innerhtml var fragmentshader = gl.createshader(gl.fragment_shader); gl.shadersource(fragmentshader,source); gl.compileshader(fragmentshader); program = gl.createprogram(); gl.attachshader(program, vertexshader); gl.attachshader(program, fragmentshader); gl.linkprogram(program); gl.detachshader(program, vertexshader); gl.de...
Scissor animation - Web APIs
var gl, color = getrandomcolor(), position; function setupanimation (evt) { window.removeeventlistener(evt.type, setupanimation, false); if (!(gl = getrenderingcontext())) return; gl.enable(gl.scissor_test); gl.clearcolor(color[0], color[1], color[2], 1.0); // unlike the browser window, vertical position in webgl is // measured from bottom to top.
... position = [0, gl.drawingbufferheight]; var button = document.queryselector("button"); var timer; function startanimation(evt) { button.removeeventlistener(evt.type, startanimation, false); button.addeventlistener("click", stopanimation, false); document.queryselector("strong").innerhtml = "stop"; timer = setinterval(drawanimation, 17); drawanimation(); } function stopanimation(evt) { button.removeeventlistener(evt.type, stopanimation, false); button.addeventlistener("click", startanimation, false); document.queryselector("strong").innerhtml = "start"; clearinterval(timer); } stopanimation({type: "click"}); } // variables to hold...
Textures from code - Web APIs
simple demonstration of procedural texturing</p> <canvas>your browser does not seem to support html5 canvas.</canvas> body { text-align : center; } canvas { width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : block; font-size : inherit; margin : auto; padding : 0.6em; } <script type="x-shader/x-vertex" id="vertex-shader"> #version 100 precision highp float; attribute vec2 position; void main() { gl_position = vec4(position, 0.0, 1.0); gl_pointsize = 128.0; } </script> <script type="x-shader/x-fragment" id="fragment-shader"> #version 100 precision mediump float; void main() { vec2 fragmentposition = 2.0*gl_pointcoord - 1.0; float distance = length(fragmentposition...
...); float distancesqrd = distance * distance; gl_fragcolor = vec4( 0.2/distancesqrd, 0.1/distancesqrd, 0.0, 1.0 ); } </script> ;(function(){ "use strict" window.addeventlistener("load", setupwebgl, false); var gl, program; function setupwebgl (evt) { window.removeeventlistener(evt.type, setupwebgl, false); if (!(gl = getrenderingcontext())) return; var source = document.queryselector("#vertex-shader").innerhtml; var vertexshader = gl.createshader(gl.vertex_shader); gl.shadersource(vertexshader,source); gl.compileshader(vertexshader); source = document.queryselector("#fragment-shader").innerhtml var fragmentshader = gl.createshader(gl.fragment_shader); gl.shadersource(fragmentshader,source); gl.compileshader(fragmentshader); program = gl.createp...
Data in WebGL - Web APIs
WebAPIWebGL APIData
each kind of variable is accessible by one or both types of shader program (depending on the data store type) and possibly by the site's javascript code, depending on the specific type of variable.
... glsl data types <<document the basic types, vectors, etc; see data type (glsl) on the khronos webgl wiki>> glsl variables there are three kinds of "variable" or data storage available in glsl, each of which with its own purpose and use cases: attributes, varyings, and uniforms.
Animating textures in WebGL - Web APIs
const level = 0; const internalformat = gl.rgba; const width = 1; const height = 1; const border = 0; const srcformat = gl.rgba; const srctype = gl.unsigned_byte; const pixel = new uint8array([0, 0, 255, 255]); // opaque blue gl.teximage2d(gl.texture_2d, level, internalformat, width, height, border, srcformat, srctype, pixel); // turn off mips and set wrapping to clamp to edge so it // will work regardless of the dimensions of the video.
...edge); gl.texparameteri(gl.texture_2d, gl.texture_wrap_t, gl.clamp_to_edge); gl.texparameteri(gl.texture_2d, gl.texture_min_filter, gl.linear); return texture; } here's what the updatetexture() function looks like; this is where the real work is done: function updatetexture(gl, texture, video) { const level = 0; const internalformat = gl.rgba; const srcformat = gl.rgba; const srctype = gl.unsigned_byte; gl.bindtexture(gl.texture_2d, texture); gl.teximage2d(gl.texture_2d, level, internalformat, srcformat, srctype, video); } you've seen this code before.
Creating 3D objects using WebGL - Web APIs
gl.vertexattribpointer( programinfo.attriblocations.vertexposition, numcomponents, type, normalize, stride, offset); gl.enablevertexattribarray( programinfo.attriblocations.vertexposition); } define the vertices' colors we also need to build an array of colors for each of the 24 vertices.
... { const vertexcount = 36; const type = gl.unsigned_short; const offset = 0; gl.drawelements(gl.triangles, vertexcount, type, offset); } since each face of our cube is comprised of two triangles, there are 6 vertices per side, or 36 total vertices in the cube, even though many of them are duplicates.
Lighting in WebGL - Web APIs
there are three basic types of lighting: ambient light is the light that permeates the scene; it's non-directional and affects every face in the scene equally, regardless of which direction it's facing.
... { const numcomponents = 3; const type = gl.float; const normalize = false; const stride = 0; const offset = 0; gl.bindbuffer(gl.array_buffer, buffers.normal); gl.vertexattribpointer( programinfo.attriblocations.vertexnormal, numcomponents, type, normalize, stride, offset); gl.enablevertexattribarray( programinfo.attriblocations.vertexnormal); } finall...
WebGL: 2D and 3D graphics for the web - Web APIs
WebAPIWebGL API
_astc webgl_compressed_texture_atc webgl_compressed_texture_etc webgl_compressed_texture_etc1 webgl_compressed_texture_pvrtc webgl_compressed_texture_s3tc webgl_compressed_texture_s3tc_srgb webgl_debug_renderer_info webgl_debug_shaders webgl_depth_texture webgl_draw_buffers webgl_lose_context events webglcontextlost webglcontextrestored webglcontextcreationerror constants and types webgl constants webgl types webgl 2 webgl 2 is a major update to webgl which is provided through the webgl2renderingcontext interface.
... guides data in webgl a guide to variables, buffers, and other types of data used when writing webgl code.
Introduction to WebRTC protocols - Web APIs
structure sdp consists of one or more lines of utf-8 text, each beginning with a one-character type, followed by an equals sign ("="), followed by structured text comprising a value or description, whose format depends on the type.
...for example, lines providing media descriptions have the type "m", so those lines are referred to as "m-lines." for more information to learn more about sdp, see the following useful resources: specification: rfc 4566: sdp: session description protocol iana registry of sdp parameters ...
Writing a WebSocket server in C# - Web APIs
opcode: these bits describe the type of message received.
...(int i = 0; i < msglen; ++i) decoded[i] = (byte)(bytes[offset + i] ^ masks[i % 4]); string text = encoding.utf8.getstring(decoded); console.writeline("{0}", text); } else console.writeline("mask bit not set"); console.writeline(); } } } } client.html <!doctype html> <style> textarea { vertical-align: bottom; } #output { overflow: auto; } #output > p { overflow-wrap: break-word; } #output span { color: blue; } #output span.error { color: red; } </style> <h2>websocket test</h2> <textarea cols=60 rows=6></textarea> <button>send</button> <div id=output></div> <script> // http://www.websocket.org/echo.html var button = document.
Writing WebSocket servers - Web APIs
todo subprotocols think of a subprotocol as a custom xml schema or doctype declaration.
...like a doctype or schema, both parties must agree on the subprotocol; unlike a doctype or schema, the subprotocol is implemented on the server and cannot be externally refered to by the client.
WebXR application life cycle - Web APIs
call navigator.xr.issessionsupported(), specifying the webxr experience mode you want to provide: inline, immersive-vr, or immersive-ar, in order to determine whether or not the type of session you wish to provide is available.
... if the session type you want to use is available, provide the appropriate interface to the user to allow them to activate it.
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
viewer poses a specialized type of pose, the viewer pose, is the pose that represents the perspective of the viewer of the scene.
... converting between webxr session types another common reason you may need to convert positional information from one reference space to another is when it's necessary to change the session type from inline to immersive-vr or back.
Web Authentication API - Web APIs
smith" }, pubkeycredparams: [{ type: "public-key", alg: -7 }], attestation: "direct", timeout: 60000, challenge: new uint8array([ // must be a cryptographically random number sent from a server 0x8c, 0x0a, 0x26, 0xff, 0x22, 0x91, 0xc1, 0xe9, 0xb9, 0x4e, 0x2e, 0x17, 0x1a, 0x98, 0x6a, 0x73, 0x71, 0x9d, 0x43, 0x48, 0xd5, 0xa7, 0x6a, 0x15, 0x7e, 0x38, 0x94, 0x52, 0x...
... var idlist = [{ id: cred.rawid, transports: ["usb", "nfc", "ble"], type: "public-key" }]; getcredentialdefaultargs.publickey.allowcredentials = idlist; return navigator.credentials.get(getcredentialdefaultargs); }) .then((assertion) => { console.log("assertion", assertion); }) .catch((err) => { console.log("error", err); }); mozilla demo website and its source code.
Using the Web Speech API - Web APIs
the second line indicates a type of term that we want to recognise.
...change voices using the dropdown menu.</p> <form> <input type="text" class="txt"> <div> <label for="rate">rate</label><input type="range" min="0.5" max="2" value="1" step="0.1" id="rate"> <div class="rate-value">1</div> <div class="clearfix"></div> </div> <div> <label for="pitch">pitch</label><input type="range" min="0" max="2" value="1" step="0.1" id="pitch"> <div class="pitch-value">1</div> <div class="clearfix"></div> </di...
Window.content - Web APIs
WebAPIWindowcontent
this is useful in xul windows that have a <browser> (or tabbrowser or <iframe>) with type="content-primary" attribute on it — the most famous example is firefox main window, browser.xul.
... syntax var windowobject = window.content; example executing the following code in a chrome xul window with a <browser type="content-primary"/> element in it draws a red border around the first div on the page currently displayed in the browser: content.document.getelementsbytagname("div")[0].style.border = "solid red 1px"; specification none.
Window: error event - Web APIs
examples live example html <div class="controls"> <button id="script-error" type="button">generate script error</button> <img class="bad-img" /> </div> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="30"></textarea> </div> css body { display: grid; grid-template-areas: "control log"; } .controls { grid-area: control; display: flex; align-items: center; justify-content: center; } .event-log...
... { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } button { height: 2rem; margin: .5rem; } img { width: 0; height: 0; } js const log = document.queryselector('.event-log-contents'); window.addeventlistener('error', (event) => { log.textcontent = log.textcontent + `${event.type}: ${event.message}\n`; console.log(event) }); const scripterror = document.queryselector('#script-error'); scripterror.addeventlistener('click', () => { const badcode = 'const s;'; eval(badcode); }); result specifications specification status ui events working draft ...
Window.getComputedStyle() - Web APIs
throws typeerror if the passed object is not an element or the pseudoelt is not a valid pseudo-element selector or is ::part() or ::slotted().
...purple; color: white; } javascript let para = document.queryselector('p'); let compstyles = window.getcomputedstyle(para); para.textcontent = 'my computed font-size is ' + compstyles.getpropertyvalue('font-size') + ',\nand my computed line-height is ' + compstyles.getpropertyvalue('line-height') + '.'; result description the returned object is the same cssstyledeclaration type as the object returned from the element's style property.
window.location - Web APIs
WebAPIWindowlocation
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 properties</button> example #5: send a string of data to the server by modifying the search property: function sen...
... example #6: using bookmarks without changing the hash property: <!doctype html> <html> <head> <meta charset="utf-8"/> <title>mdn example</title> <script> function shownode (onode) { document.documentelement.scrolltop = onode.offsettop; document.documentelement.scrollleft = onode.offsetleft; } function showbookmark (sbookmark, busehash) { if (arguments.length === 1 || busehash) { location.hash = sbookmark; return; } var obookmark = document.queryselector(sbookmark); if (obookmark) { shownode(obo...
Window.releaseEvents() - Web APIs
summary releases the window from trapping events of a specific type.
... syntax window.releaseevents(eventtype) eventtype is a combination of the following values: event.abort, event.blur, event.click, event.change, event.dblclick, event.dragddrop, event.error, event.focus, event.keydown, event.keypress, event.keyup, event.load, event.mousedown, event.mousemove, event.mouseout, event.mouseover, event.mouseup, event.move, event.reset, event.resize, event.select, event.submit, event.unload.
Window: unload event - Web APIs
examples <!doctype html> <html> <head> <title>parent frame</title> <script> window.addeventlistener('beforeunload', function(event) { console.log('i am the 1st one.'); }); window.addeventlistener('unload', function(event) { console.log('i am the 3rd one.'); }); </script> </head> <body> <iframe src="child-frame.html"></iframe> </body> </html> below, th...
...e content of child-frame.html: <!doctype html> <html> <head> <title>child frame</title> <script> window.addeventlistener('beforeunload', function(event) { console.log('i am the 2nd one.'); }); window.addeventlistener('unload', function(event) { console.log('i am the 4th and last one…'); }); </script> </head> <body> ☻ </body> </html> when the parent frame is unloaded, events will be fired in the order described by the console.log() messages.
WindowOrWorkerGlobalScope.queueMicrotask() - Web APIs
examples self.queuemicrotask(() => { // function contents here }) taken from the queuemicrotask spec: myelement.prototype.loaddata = function (url) { if (this._cache[url]) { queuemicrotask(() => { this._setdata(this._cache[url]); this.dispatchevent(new event("load")); }); } else { fetch(url).then(res => res.arraybuffer()).then(data => { this._cache[url] = data; this._setdata(data); this.dispatchevent(new event("load")); }); } }; when queuemicrotask() isn't availab...
... if (typeof window.queuemicrotask !== "function") { window.queuemicrotask = function (callback) { promise.resolve() .then(callback) .catch(e => settimeout(() => { throw e; })); // report exceptions }; } specifications specification status comment html living standardthe definition of 'self.queuemicrotask()' in that specification.
WorkerGlobalScope.self - Web APIs
syntax var selfref = self; value a global scope object (differs depending on the type of worker you are dealing with, as indicated above).
... example if you called console.log(self); inside a worker, you will get a worker global scope of the same type as that worker object written to the console — something like the following: dedicatedworkerglobalscope { undefined: undefined, infinity: infinity, math: mathconstructor, nan: nan, intl: object…} infinity: infinity array: function array() { [native code] } arguments: null caller: null isarray: function isarray() { [native code] } length: 1 name: "array" observe: function observe() { [native code] } prototype: array[0] unobserve: function unobserve() { [native code] } __proto__: function empty() {} <function scope> arraybuffer: function arraybuffer() { [native code] } blob: function blob() { [native co...
WritableStream.getWriter() - Web APIs
exceptions typeerror the stream you are trying to create a writer for is not a writablestream.
... const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sink."); }) .catch((err)...
WritableStreamDefaultWriter.WritableStreamDefaultWriter() - Web APIs
exceptions typeerror the provided stream value is not a writablestream, or it is locked to another writer already.
... const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sink."); }) .catch((err)...
WritableStreamDefaultWriter.close() - Web APIs
exceptions typeerror the stream you are trying to close is not a writablestream.
... const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sink."); }) .catch((err)...
WritableStreamDefaultWriter.write() - Web APIs
exceptions typeerror the target stream is not a writable stream, or it does not have an owner.
... const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sink."); }) .catch((err)...
XMLHttpRequest: abort event - Web APIs
bubbles no cancelable no interface progressevent event handler property onabort examples live example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; ...
... margin: .5rem; } js const xhrbuttonsuccess = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function handleevent(e) { log.textcontent = log.textcontent + `${e.type}: ${e.loaded} bytes transferred\n`; } function addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlis...
XMLHttpRequest: error event - Web APIs
bubbles no cancelable no interface progressevent event handler property onerror examples live example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const xhrbuttonsuccess = documen...
...t.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function handleevent(e) { log.textcontent = log.textcontent + `${e.type}: ${e.loaded} bytes transferred\n`; } function addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get", url); xhr.send(); ...
XMLHttpRequest.getAllResponseHeaders() - Web APIs
an example of what a raw header string looks like: date: fri, 08 dec 2017 21:04:30 gmt\r\n content-encoding: gzip\r\n x-content-type-options: nosniff\r\n server: meinheld/0.6.1\r\n x-frame-options: deny\r\n content-type: text/html; charset=utf-8\r\n connection: keep-alive\r\n strict-transport-security: max-age=63072000\r\n vary: cookie, accept-encoding\r\n content-length: 6502\r\n x-xss-protection: 1; mode=block\r\n each line is terminated by both carriage return and line feed characters (\r\n).
...to an array // of individual headers var arr = headers.trim().split(/[\r\n]+/); // create a map of header names to values var headermap = {}; arr.foreach(function (line) { var parts = line.split(': '); var header = parts.shift(); var value = parts.join(': '); headermap[header] = value; }); } } once this is done, you can, for example: var contenttype = headermap["content-type"]; this obtains the value of the content-type header into the variable contenttype.
XMLHttpRequest: load event - Web APIs
bubbles no cancelable no interface progressevent event handler property onload examples live example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const xhrbutto...
...nsuccess = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function handleevent(e) { log.textcontent = log.textcontent + `${e.type}: ${e.loaded} bytes transferred\n`; } function addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get", url); ...
XMLHttpRequest: loadend event - Web APIs
bubbles no cancelable no interface progressevent event handler property onloadend examples live example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { wid...
...th: 11rem; margin: .5rem; } js const xhrbuttonsuccess = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function handleevent(e) { log.textcontent = log.textcontent + `${e.type}: ${e.loaded} bytes transferred\n`; } function addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest...
XMLHttpRequest: loadstart event - Web APIs
bubbles no cancelable no interface progressevent event handler property onloadstart examples live example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const xhrbuttonsuccess...
... = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function handleevent(e) { log.textcontent = log.textcontent + `${e.type}: ${e.loaded} bytes transferred\n`; } function addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get", url); xhr.
XMLHttpRequest: progress event - Web APIs
bubbles no cancelable no interface progressevent event handler property onprogress examples live example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const xhrbuttonsu...
...ccess = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function handleevent(e) { log.textcontent = log.textcontent + `${e.type}: ${e.loaded} bytes transferred\n`; } function addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get", url); ...
XMLHttpRequest.responseText - Web APIs
exceptions invalidstateerror the xmlhttprequest.responsetype is not set to either the empty string or "text".
... example var xhr = new xmlhttprequest(); xhr.open('get', '/server', true); // if specified, responsetype must be empty string or "text" xhr.responsetype = 'text'; xhr.onload = function () { if (xhr.readystate === xhr.done) { if (xhr.status === 200) { console.log(xhr.response); console.log(xhr.responsetext); } } }; xhr.send(null); specifications specification status comment xmlhttprequest living standard whatwg living standard ...
XPathEvaluator - Web APIs
xpathevaluator.evaluate() evaluates an xpath expression string and returns a result of the specified type if possible.
... html <div>xpath example</div> <div>number of &lt;div&gt;s: <output></output></div> javascript var xpath = "//div"; var evaluator = new xpathevaluator(); var expression = evaluator.createexpression("//div"); var result = expression.evaluate(document, xpathresult.ordered_node_snapshot_type); document.queryselector("output").textcontent = result.snapshotlength; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathevaluator' in that specification.
XPathExpression - Web APIs
objects of this type are created by calling xpathevaluator.createexpression().
... html <div>xpath example</div> <div>number of &lt;div&gt;s: <output></output></div> javascript var xpath = "//div"; var evaluator = new xpathevaluator(); var expression = evaluator.createexpression(xpath); var result = expression.evaluate(document, xpathresult.ordered_node_snapshot_type); document.queryselector("output").textcontent = result.snapshotlength; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathexpression' in that specification.
XPathResult.invalidIteratorState - Web APIs
it is true if xpathresult.resulttype is unordered_node_iterator_type or ordered_node_iterator_type and the document has been modified since this result was returned.
... html <div>xpath example</div> <p>iterator state: <output></output></p> javascript var xpath = "//div"; var result = document.evaluate(xpath, document, null, xpathresult.any_type, null); // invalidates the iterator state document.queryselector("div").remove(); document.queryselector("output").textcontent = result.invaliditeratorstate ?
XPathResult.snapshotItem() - Web APIs
exceptions type_err in case xpathresult.resulttype is not unordered_node_snapshot_type or ordered_node_snapshot_type, an xpathexception of type type_err is thrown.
... html <div>xpath example</div> <div>tag names of the matched nodes: <output></output></div> javascript var xpath = "//div"; var result = document.evaluate(xpath, document, null, xpathresult.ordered_node_snapshot_type, null); var node = null; var tagnames = []; for(var i = 0; i < result.snapshotlength; i++) { var node = result.snapshotitem(i); tagnames.push(node.localname); } document.queryselector("output").textcontent = tagnames.join(", "); result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.snapshotitem()' in that specification.
XPathResult.snapshotLength - Web APIs
exceptions type_err in case xpathresult.resulttype is not unordered_node_snapshot_type or ordered_node_snapshot_type, an xpathexception of type type_err is thrown.
... html <div>xpath example</div> <div>number of matched nodes: <output></output></div> javascript var xpath = "//div"; var result = document.evaluate(xpath, document, null, xpathresult.ordered_node_snapshot_type, null); document.queryselector("output").textcontent = result.snapshotlength; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.snapshotlength' in that specification.
XRInputSourcesChangeEvent() - Web APIs
syntax newinputsourceschangeevent = new xrinputsourceschangeevent(type, eventinitdict); parameters type a domstring indicating the type of event which has occurred.
... event types inputsourceschange delivered to the xrsession when the set of input devices available to it changes.
XRInputSourcesChangeEvent - Web APIs
the specified type must be inputsourceschange, which is the only event that uses this interface.
... event types inputsourceschange delivered to the xrsession when the set of input devices available to it changes.
XRPermissionDescriptor.mode - Web APIs
the mode property of the xrpermissiondescriptor dictionary is a string taken from the xrsessionmode enumerated type, specifying which web xr session mode (inline, immersive-vr, or immersive-ar) the described permissions will be used for.
... syntax xrpermissiondescriptor = { mode: xrsessionmode, requiredfeatures: reqfeaturelist, optionalfeatures: optfeaturelist }; xrpermissiondescriptor.mode = xrsessionmode; xrmode = xrpermissiondescriptor.mode; value a domstring whose value is one of the strings found in the xrsessionmode enumerated type: immersive-ar the session's output will be given exclusive access to the immersive device, but the rendered content will be blended with the real-world environment.
XRReferenceSpaceEvent() - Web APIs
currently, only the reset event is defined using this type.
... syntax let refspaceevent = new xrreferencespaceevent(type, eventinitdict); parameters type a domstring indicating the event type which has occurred.
XRSession.environmentBlendMode - Web APIs
the value is a domstring which contains one of the values defined by the xrenvironmentblendmode enumerated type.
... syntax blendmode = xrsession.environmentblendmode; value a domstring whose value is one of the strings found in the enumerated type xrenvironmentblendmode, defining if—and if so, how—virtual, rendered content is overlaid atop the image of the real world.
XRSession: selectend event - Web APIs
if the target ray pose was fetched successfully, the code then uses the value of event property type to route control to an appropriate function to handle the event which arrived: for selectstart events, a mybegintracking() function is called with the target ray pose's matrix.
...deventlistener("select", onselectionevent); xrsession.addeventlistener("selectend", onselectionevent); function onselectionevent(event) { let source = event.inputsource; let targetobj = null; if (source.targetraymode != "tracked-pointer") { return; } let targetraypose = event.frame.getpose(source.targetrayspace, myrefspace); if (!targetraypose) { return; } switch(event.type) { case "selectstart": targetobj = mybegintracking(targetraypose.matrix); break; case "select": mydropobject(targetobj, targetraypose.matrix); break; case "selectend": mystoptracking(targetobj, targetraypose.matrix); break; } } you can of course also set up a handler for selectend events by setting the xrsession object's onselectend event handle...
XRSession: selectstart event - Web APIs
if the target ray pose was fetched successfully, the code then uses the value of event property type to route control to an appropriate function to handle the event which arrived: for selectstart events, a mybegintracking() function is called with the target ray pose's matrix.
...deventlistener("select", onselectionevent); xrsession.addeventlistener("selectend", onselectionevent); function onselectionevent(event) { let source = event.inputsource; let targetobj = null; if (source.targetraymode != "tracked-pointer") { return; } let targetraypose = event.frame.getpose(source.targetrayspace, myrefspace); if (!targetraypose) { return; } switch(event.type) { case "selectstart": targetobj = mybegintracking(targetraypose.matrix); break; case "select": mydropobject(targetobj, targetraypose.matrix); break; case "selectend": mystoptracking(targetobj, targetraypose.matrix); break; } } you can of course also set up a handler for selectend events by setting the xrsession object's onselectend event handle...
XRSession: squeezeend event - Web APIs
if the target ray pose was fetched successfully, the code then uses the value of event property type to route control to an appropriate function to handle the event which arrived: for squeezestart events, a mybegintracking() function is called with the target ray pose's matrix.
...n.addeventlistener("squeeze", onsqueezeevent); xrsession.addeventlistener("squeezeend", onsqueezeevent); function onsqueezeevent(event) { let source = event.inputsource; let targetobj = null; if (source.targetraymode != "tracked-pointer") { return; } let targetraypose = event.frame.getpose(source.targetrayspace, myrefspace); if (!targetraypose) { return; } switch(event.type) { case "squeezestart": targetobj = mybegintracking(targetraypose.matrix); break; case "squeeze": mydropobject(targetobj, targetraypose.matrix); break; case "squeezeend": mystoptracking(targetobj, targetraypose.matrix); break; } } you can of course also set up a handler these events by setting the xrsession object's onsqueezeend event handler pr...
XRSession: squeezestart event - Web APIs
if the target ray pose was fetched successfully, the code then uses the value of event property type to route control to an appropriate function to handle the event which arrived: for squeezestart events, a mybegintracking() function is called with the target ray pose's matrix.
...n.addeventlistener("squeeze", onsqueezeevent); xrsession.addeventlistener("squeezeend", onsqueezeevent); function onsqueezeevent(event) { let source = event.inputsource; let targetobj = null; if (source.targetraymode != "tracked-pointer") { return; } let targetraypose = event.frame.getpose(source.targetrayspace, myrefspace); if (!targetraypose) { return; } switch(event.type) { case "squeezestart": targetobj = mybegintracking(targetraypose.matrix); break; case "squeeze": mydropobject(targetobj, targetraypose.matrix); break; case "squeezeend": mystoptracking(targetobj, targetraypose.matrix); break; } } you can of course also set up a handler these events by setting the xrsession object's onsqueezeend event handler pr...
XRSessionMode - Web APIs
the webxr device api's xrsessionmode enumerated type defines the string values used to identify the possible kinds of session mode that can be used.
... usage notes the xrsessionmode type indicates the values that can be specified when calling xr.issessionsupported() to determine whether or not the specified session type is supported and available to be used, and by requestsession() to attempt to open a new webxr session.
XRView.eye - Web APIs
WebAPIXRVieweye
the xrview interface's read-only eye property is a string taken from the xreye enumerated type, indicating which eye's viewpoint the xrview represents: left or right.
... syntax let eye = xrview.eye; value a domstring whose value is one of the strings enumerated by the xreye type: left the xrview represents the point-of-view of the viewer's left eye.
XRViewport - Web APIs
usage notes currently, the only type of surface available is the xrwebgllayer.
... the precise orientation of the coordinate system may vary with other surface types, but in webgl, the origin (0, 0) is located at the bottom-left corner of the surface.
XRWebGLLayer - Web APIs
although xrwebgllayer is currently the only type of framebuffer layer supported by webgl, it's entirely possible that future updates to the webxr specification may allow for other layer types and corresponding image sources.
...the specific type of anti-aliasing is determined by the user agent.
msCachingEnabled - Web APIs
syntax var cachestate = xmlhttprequest.mscachingenabled(); parameters cachestate[out, retval] type = boolean.
... return value type: boolean.
msGetPropertyEnabled - Web APIs
syntax var retval = style.msgetpropertyenabled(name); parameters name [in] type: string the name of the property to enable.
... return value type: boolean if false, the property is not enabled.
msGetRegionContent - Web APIs
syntax var retval = element.msgetregioncontent(); parameters retval [out, reval] type: msrangecollection the name of the property to enable.
... return value type: boolean returned ranges are sorted by document position and do not overlap.
msWriteProfilerMark - Web APIs
type = string.
... return value type: hresult.
Using the aria-labelledby attribute - Accessibility
in addition to form elements, you can use the aria-labelledby attribute to associate static text with widgets, groups of elements, panes, regions that have a heading, definitions, and other types of objects.
... examples example 1: multiple labels in the example below, each input field is labelled by both its own individual label and by the label for the group: <div id="mybillingid">billing</div> <div> <div id="mynameid">name</div> <input type="text" aria-labelledby="mybillingid mynameid"/> </div> <div> <div id="myaddressid">address</div> <input type="text" aria-labelledby="mybillingid myaddressid"/> </div> example 2: associating headings with regions in the example below, header elements are associated with the content they head.
ARIA annotations - Accessibility
oll/voting ui widget that shows numbers of votes, but you want to summarize the purpose of the widget in a clear description because the ui does not make it clear: <section aria-description="choose your favourite fruit — the fruit with the highest number of votes will be added to the lunch options next week."> <p>pick your favourite fruit:</p> <form> <ul> <li><label>apple: <input type="radio" name="fruit" value="apple"></label></li> <li><label>orange: <input type="radio" name="fruit" value="orange"></label></li> <li><label>banana: <input type="radio" name="fruit" value="banana"></label></li> </ul> </form> </section> if the descriptive text does appear in the ui, you can link the description to the widget using aria-describedby, like so: <p id="fruit-desc">c...
...hoose your favourite fruit — the fruit with the highest number of votes will be added to the lunch options next week.</p> <section aria-describedby="fruit-desc"> <form> <ul> <li><label>apple: <input type="radio" name="fruit" value="apple"></label></li> <li><label>orange: <input type="radio" name="fruit" value="orange"></label></li> <li><label>banana: <input type="radio" name="fruit" value="banana"></label></li> </ul> </form> </section> insertions and deletions a common wish in online document systems like google docs is to be able to track changes, to see what reviewers or editors have suggested as changes to the text, before the managing editor or author accepts or rejects those changes.
ARIA: form role - Accessibility
examples <div role="form" id="send-comment" aria-label="add a comment"> <label for="username">username</label> <input id="username" name="username" autocomplete="nickname" autocorrect="off" type="text"> <label for="email">email</label> <input id="email" name="email" autocomplete="email" autocapitalize="off" autocorrect="off" spellcheck="false" type="text"> <label for="comment">comment</label> <textarea id="comment" name="comment"></textarea> <input value="comment" type="submit"> </div> it is recommended to use <form> instead.
... using role="form" <div role="form" id="gift-cards" aria-label="purchase a gift card"> <!-- form content --> </div> redundant descriptions screen readers will announce the type of role the landmark is.
ARIA: rowgroup role - Accessibility
there is, however, no differentiation between different types of rowgroups.
...these cells can be of different types, depending on whether they are column or row headers, or plain or grid cells.
ARIA: listbox role - Accessibility
type-ahead is recommended for all listboxes, especially those with more than seven options: type a character: focus moves to the next item with a name that starts with the typed character.
... type multiple characters in rapid succession: focus moves to the next item with a name that starts with the string of characters typed.
Basic form hints - Accessibility
<form> <ul> <li> <input id="wine-1" type="checkbox" value="riesling"/> <label for="wine-1">berg rottland riesling</label> </li> <li> <input id="wine-2" type="checkbox" value="pinot-blanc"/> <label for="wine-2">pinot blanc</label> </li> <li> <input id="wine-3" type="checkbox" value="pinot-grigio"/> <label for="wine-3">pinot grigio</label> </li> <li> <input id="wine-4" type="chec...
... <form> <div> <label for="name">* name:</label> <input type="text" value="name" id="name" aria-required="true"/> </div> <div> <label for="phone">phone:</label> <input type="text" value="phone" id="phone" aria-required="false"/> </div> <div> <label for="email">* e-mail:</label> <input type="text" value="email" id="email" aria-required="true"/> </div> </form> the script that validates the form entry would look something like this:...
Alerts - Accessibility
d):</label> <input name="email" id="email" aria-required="true"/> <br /> <label for="website">website (optional):</label> <input name="website" id="website"/> </fieldset> <label for="message">please enter your message (required):</label> <br /> <textarea name="message" id="message" rows="5" cols="80" aria-required="true"></textarea> <br /> <input type="submit" name="submit" value="send message"/> <input type="reset" name="reset" value="reset form"/> </form> checking for validity and notifying the user form validations consists of several steps: checking if the e-mail address or entered name are valid.
... below is example javascript code which could be inserted above the closing “head” tag: <script type="application/javascript"> function removeoldalert() { var oldalert = document.getelementbyid("alert"); if (oldalert){ document.body.removechild(oldalert); } } function addalert(amsg) { removeoldalert(); var newalert = document.createelement("div"); newalert.setattribute("role", "alert"); newalert.setattribute("id", "alert"); var msg = document.createtextnode(ams...
An overview of accessible web applications and widgets - Accessibility
the aria specification is split up into three different types of attributes: roles, states, and properties.
...html for a tooltip <div class="text"> <label id="tp1-label" for="first">first name:</label> <input type="text" id="first" name="first" size="20" aria-labelledby="tp1-label" aria-describedby="tp1" aria-required="false" /> <div id="tp1" class="tooltip" role="tooltip" aria-hidden="true">your first name is optional</div> </div> the css for this markup is shown in example 2b.
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
will return object of type role_window.
...the nsiaccessible that is returned is either a new one, or reused from the accessibility cache, and the correct type of accessibility object to correctly expose that dom node through the cross-platform nsiaccessible and msaa-specific iaccessible interfaces.
Color contrast - Accessibility
when designing readable interfaces for different vision capabilities, the wcag guidelines recommend the following contrast ratios: type of content minimum ratio (aa rating) enhanced ratio (aaa rating) body text 4.5 : 1 7 : 1 large-scale text (120-150% larger than body text) 3 : 1 4.5 : 1 active user interface components and graphical objects such as icons and graphs 3 : 1 not defined these ratios do not apply to "incidental" text, such as inactive controls, logotypes, or purely decorative text.
... having good color contrast on your site benefits all your users, but it is particularly beneficial to users with certain types of color blindness and other similar conditions, who experience low contrast, and have trouble differentiating between similar colors.
Accessibility
accessibility for seizure disorders some types of visual web content can induce seizures in people with certain brain disorders.
... understand the types of content that can be problematic, and find tools and strategies to help you avoid them.
-moz-user-focus - CSS: Cascading Style Sheets
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete note: this property doesn't work for xul <xul:textbox> elements, because the textbox itself never takes focus.
... formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax ignore | normal | select-after | select-before | select-menu | select-same | select-all | none examples html <input class="ignored" value="the user cannot focus on this element."> css .ignored { -moz-user-focus: ignore; } specifications not part of any standard.
-webkit-mask-position-x - CSS: Cascading Style Sheets
-webkit-mask-position-x: -1cm; /* multiple values values */ -webkit-mask-position-x: 50px, 25%, -3em; /* global values */ -webkit-mask-position-x: inherit; -webkit-mask-position-x: initial; -webkit-mask-position-x: unset; initial value0%applies toall elementsinheritednopercentagesrefer to the size of the box itselfcomputed valuefor <length> the absolute value, otherwise a percentageanimation typediscrete syntax values <length-percentage> a length indicating the position of the left edge of the image relative to the box's left padding edge.
... formal definition initial value0%applies toall elementsinheritednopercentagesrefer to the size of the box itselfcomputed valuefor <length> the absolute value, otherwise a percentageanimation typediscrete formal syntax [ <length-percentage> | left | center | right ]#where <length-percentage> = <length> | <percentage> examples horizontally positioning a mask image .exampleone { -webkit-mask-image: url(mask.png); -webkit-mask-position-x: right; } .exampletwo { -webkit-mask-image: url(mask.png); -webkit-mask-position-x: 25%; } specifications not part of any standard.
-webkit-mask-position-y - CSS: Cascading Style Sheets
-webkit-mask-position-y: -1cm; /* multiple values values */ -webkit-mask-position-y: 50px, 25%, -3em; /* global values */ -webkit-mask-position-y: inherit; -webkit-mask-position-y: initial; -webkit-mask-position-y: unset; initial value0%applies toall elementsinheritednopercentagesrefer to the size of the box itselfcomputed valuefor <length> the absolute value, otherwise a percentageanimation typediscrete syntax values <length-percentage> a length indicating the position of the top side of the image relative to the box's top padding edge.
... formal definition initial value0%applies toall elementsinheritednopercentagesrefer to the size of the box itselfcomputed valuefor <length> the absolute value, otherwise a percentageanimation typediscrete formal syntax [ <length-percentage> | top | center | bottom ]#where <length-percentage> = <length> | <percentage> examples vertically positioning a mask image .exampleone { -webkit-mask-image: url(mask.png); -webkit-mask-position-y: bottom; } .exampletwo { -webkit-mask-image: url(mask.png); -webkit-mask-position-y: 25%; } specifications not part of any standard.
-webkit-text-security - CSS: Cascading Style Sheets
it only affects fields that are not of type=password.
... html <label for="name">name:</label> <input type="text" name="name" id="name" /> css input { -webkit-text-security: square; } result specifications not part of any standard.
-webkit-text-stroke-color - CSS: Cascading Style Sheets
formal definition initial valuecurrentcolorapplies toall elementsinheritedyescomputed valuecomputed coloranimation typea color formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
...)where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples varying the stroke color html <p>text with stroke</p> <input type="color" value="#ff0000"> css p { margin: 0; font-size: 4em; -webkit-text-stroke-width: 3px; -webkit-text-stroke-color: #ff0000; /* can be changed in the live sample */ } javascript var colorpicker = document.queryselector("input"); colorpicker.addeventlistener("change", function(evt) { document.queryselector("p").style.webkittextstrokecolor = evt.target.value; }); results spe...
::-moz-focus-inner - CSS: Cascading Style Sheets
the ::-moz-focus-inner css pseudo-element is a mozilla extension that represents an inner focus ring of the <button> element as well as the button, submit, reset, and color types of the <input> element.
... examples html <input type="submit" value="input"/> <button type="submit">button</button> css button::-moz-focus-inner, input[type="color"]::-moz-focus-inner, input[type="reset"]::-moz-focus-inner, input[type="button"]::-moz-focus-inner, input[type="submit"]::-moz-focus-inner { padding-block-start: 0px; padding-inline-end: 2px; padding-block-end: 0px; padding-inline-start: 2px; border: 1px dotted red; } result specifications not part of any standard.
::-webkit-file-upload-button - CSS: Cascading Style Sheets
the ::-webkit-file-upload-button css pseudo-element represents the button of an <input> of type="file".
... syntax selector::-webkit-file-upload-button examples html <form> <label for="fileupload">upload file</label><br> <input type="file" id="fileupload"> </form> css input, label { display: block; } input[type=file]::-webkit-file-upload-button { border: 1px solid grey; background: #fffaaa; } below is the example for you to try.
::placeholder - CSS: Cascading Style Sheets
<label for="user-email">your email address</label> <span id="user-email-hint" class="input-hint">example: jane@sample.com</span> <input id="user-email" aria-describedby="user-email-hint" name="email" type="email"> placeholders in form fields are harmful — nielsen norman group windows high contrast mode placeholder text will appear with the same styling as user-entered text content when rendered in windows high contrast mode.
... mdn basic form hints placeholders in form fields are harmful — nielsen norman group examples red text html <input placeholder="type something here!"> css input::placeholder { color: red; font-size: 1.2em; font-style: italic; } result green text html <input placeholder="type something here..."> css input::placeholder { color: green; } result specifications specification status comment css pseudo-elements level 4the definition of '::placeholder' in that specification.
::slotted() - CSS: Cascading Style Sheets
WebCSS::slotted
/* selects any element placed inside a slot */ ::slotted(*) { font-weight: bold; } /* selects any <span> placed inside a slot */ ::slotted(span) { font-weight: bold; } syntax ::slotted( <compound-selector-list> )where <compound-selector-list> = <compound-selector>#where <compound-selector> = [ <type-selector>?
... <subclass-selector>* [ <pseudo-element-selector> <pseudo-class-selector>* ]* ]!where <type-selector> = <wq-name> | <ns-prefix>?
:enabled - CSS: Cascading Style Sheets
WebCSS:enabled
an element is enabled if it can be activated (selected, clicked on, typed into, etc.) or accept focus.
... html <form action="url_of_form"> <label for="firstfield">first field (enabled):</label> <input type="text" id="firstfield" value="lorem"><br> <label for="secondfield">second field (disabled):</label> <input type="text" id="secondfield" value="ipsum" disabled="disabled"><br> <input type="button" value="submit"> </form> css input:enabled { color: #2b2; } input:disabled { color: #aaa; } result specifications specification status comment html living ...
:has() - CSS: Cascading Style Sheets
WebCSS:has
<compound-selector> ]*where <compound-selector> = [ <type-selector>?
... <subclass-selector>* [ <pseudo-element-selector> <pseudo-class-selector>* ]* ]!where <type-selector> = <wq-name> | <ns-prefix>?
:host() - CSS: Cascading Style Sheets
WebCSS:host()
/* selects a shadow root host, only if it is matched by the selector argument */ :host(.special-custom-element) { font-weight: bold; } syntax :host( <compound-selector-list> )where <compound-selector-list> = <compound-selector>#where <compound-selector> = [ <type-selector>?
... <subclass-selector>* [ <pseudo-element-selector> <pseudo-class-selector>* ]* ]!where <type-selector> = <wq-name> | <ns-prefix>?
:host-context() - CSS: Cascading Style Sheets
font-weight: bold; } :host-context(main article) { font-weight: bold; } /* changes paragraph text color from black to white when a .dark-theme class is applied to the document body */ p { color: #000; } :host-context(body.dark-theme) p { color: #fff; } syntax :host-context( <compound-selector-list> )where <compound-selector-list> = <compound-selector>#where <compound-selector> = [ <type-selector>?
... <subclass-selector>* [ <pseudo-element-selector> <pseudo-class-selector>* ]* ]!where <type-selector> = <wq-name> | <ns-prefix>?
:indeterminate - CSS: Cascading Style Sheets
/* selects any <input> whose state is indeterminate */ input:indeterminate { background: lime; } elements targeted by this selector are: <input type="checkbox"> elements whose indeterminate property is set to true by javascript <input type="radio"> elements, when all radio buttons with the same name value in the form are unchecked <progress> elements in an indeterminate state syntax :indeterminate examples checkbox & radio button this example applies special styles to the labels associated with indeterminate form fields.
... html <div> <input type="checkbox" id="checkbox"> <label for="checkbox">this label starts out lime.</label> </div> <div> <input type="radio" id="radio"> <label for="radio">this label starts out lime.</label> </div> css input:indeterminate + label { background: lime; } javascript var inputs = document.getelementsbytagname("input"); for (var i = 0; i < inputs.length; i++) { inputs[i].indeterminate = true; } progress bar html <progress> css progress { margin: 4px; } progress:indeterminate { opacity: 0.5; background-color: lightgray; box-shadow: 0 0 2px 1px red; } result specifications specification status comment html living standardthe definition of ':indeterminate' in that specification.
:invalid - CSS: Cascading Style Sheets
WebCSS:invalid
html <form> <div class="field"> <label for="url_input">enter a url:</label> <input type="url" id="url_input"> </div> <div class="field"> <label for="email_input">enter an email address:</label> <input type="email" id="email_input" required> </div> </form> css label { display: block; margin: 1px; padding: 1px; } .field { margin: 1px; padding: 1px; } input:invalid { background-color: #ffdddd; } form:invalid { border: 5px solid #ffdddd; } input:valid ...
...people who have certain types of color blindness will be unable to determine the input's state unless it is accompanied by an additional indicator that does not rely on color to convey meaning.
:lang() - CSS: Cascading Style Sheets
WebCSS:lang
for other document types there may be other document methods for determining the language.
...note that this doesn't illustrate the only way to do this, and that the best method to use depends on the type of document.
:not() - CSS: Cascading Style Sheets
WebCSS:not
<compound-selector> ]*where <compound-selector> = [ <type-selector>?
... <subclass-selector>* [ <pseudo-element-selector> <pseudo-class-selector>* ]* ]!<combinator> = '>' | '+' | '~' | [ '|' ]where <type-selector> = <wq-name> | <ns-prefix>?
:nth-last-child() - CSS: Cascading Style Sheets
<compound-selector> ]*where <compound-selector> = [ <type-selector>?
... <subclass-selector>* [ <pseudo-element-selector> <pseudo-class-selector>* ]* ]!<combinator> = '>' | '+' | '~' | [ '|' ]where <type-selector> = <wq-name> | <ns-prefix>?
:placeholder-shown - CSS: Cascading Style Sheets
html <input placeholder="type something here!"> css input { border: 1px solid black; padding: 3px; } input:placeholder-shown { border-color: teal; color: purple; font-style: italic; } result overflowing text when form fields are too small, placeholder text can get cropped in an undesirable way.
... html <form id="test"> <p> <label for="name">enter student name:</label> <input id="name" placeholder="student name"/> </p> <p> <label for="branch">enter student branch:</label> <input id="branch" placeholder="student branch"/> </p> <p> <label for="sid">enter student id:</label> <input type="number" pattern="[0-9]{8}" title="8 digit id" id="sid" class="studentid" placeholder="8 digit id"/> </p> <input type="submit"/> </form> css input { background-color: #e8e8e8; color: black; } input.studentid:placeholder-shown { background-color: yellow; color: red; font-style: italic; } result specifications specification status comment selectors ...
:valid - CSS: Cascading Style Sheets
WebCSS:valid
syntax :valid examples indicating valid and invalid form fields in this example, we use structures like this, which include extra <span>s to generate content on; we'll use these to provide indicators of valid/invalid data: <div> <label for="fname">first name *: </label> <input id="fname" name="fname" type="text" required> <span></span> </div> to provide these indicators, we use the following css: input + span { position: relative; } input + span::before { position: absolute; right: -20px; top: 5px; } input:invalid { border: 2px solid red; } input:invalid + span::before { content: '✖'; color: red; } input:valid + span::before { content: '✓'; color: green; } we set the...
...people who have certain types of color blindness will be unable to determine the input's state unless it is accompanied by an additional indicator that does not rely on color to convey meaning.
:where() - CSS: Cascading Style Sheets
WebCSS:where
<compound-selector> ]*where <compound-selector> = [ <type-selector>?
... <subclass-selector>* [ <pseudo-element-selector> <pseudo-class-selector>* ]* ]!<combinator> = '>' | '+' | '~' | [ '|' ]where <type-selector> = <wq-name> | <ns-prefix>?
font-stretch - CSS: Cascading Style Sheets
for truetype or opentype variable fonts, the "wdth" variation is used to implement varying widths.
... for truetype or opentype variable fonts, the "wdth" variation is used to implement varying glyph widths.
src - CSS: Cascading Style Sheets
WebCSS@font-facesrc
th/to/svgfont.svg#example); /* fragment identifying font */ /* <font-face-name> values */ src: local(font); /* unquoted name */ src: local(some font); /* name containing space */ src: local("font"); /* quoted name */ /* multiple items */ src: local(font), url(path/to/font.svg) format("svg"), url(path/to/font.woff) format("woff"), url(path/to/font.otf) format("opentype"); values <url> [ format( <string># ) ]?
...| local( <family-name> ) ]#where <family-name> = <string> | <custom-ident>+ examples specifying font resources using url() and local() @font-face { font-family: examplefont; src: local(example font), url('examplefont.woff') format("woff"), url('examplefont.otf') format("opentype"); } specifications specification status comment css fonts module level 3the definition of 'src' in that specification.
-ms-high-contrast - CSS: Cascading Style Sheets
for web content, theme colors are mapped to content types.
... this media feature applies to bitmap media types.
pointer - CSS: Cascading Style Sheets
WebCSS@mediapointer
html <input id="test" type="checkbox" /> <label for="test">look at me!</label> css input[type="checkbox"] { -moz-appearance: none; -webkit-appearance: none; appearance: none; border: solid; margin: 0; } input[type="checkbox"]:checked { background: gray; } @media (pointer: fine) { input[type="checkbox"] { width: 15px; height: 15px; border-width: 1px; border-color: blue; } } @media (point...
...er: coarse) { input[type="checkbox"] { width: 30px; height: 30px; border-width: 2px; border-color: red; } } result specifications specification status comment media queries level 4the definition of 'pointer' in that specification.
@supports - CSS: Cascading Style Sheets
WebCSS@supports
<compound-selector> ]*where <compound-selector> = [ <type-selector>?
... <subclass-selector>* [ <pseudo-element-selector> <pseudo-class-selector>* ]* ]!<combinator> = '>' | '+' | '~' | [ '|' ]where <type-selector> = <wq-name> | <ns-prefix>?
Alternative style sheets - CSS: Cascading Style Sheets
for example: <link href="reset.css" rel="stylesheet" type="text/css"> <link href="default.css" rel="stylesheet" type="text/css" title="default style"> <link href="fancy.css" rel="alternate stylesheet" type="text/css" title="fancy"> <link href="basic.css" rel="alternate stylesheet" type="text/css" title="basic"> in this example, the styles "default style", "fancy", and "basic" will be listed in the page style submenu, with "default style" pre-selected...
... specifications specification status comment html living standardthe definition of 'link type "alternate"' in that specification.
At-rules - CSS: Cascading Style Sheets
WebCSSAt-rule
(at the candidate recommendation stage, but only implemented in gecko as of writing) @font-feature-values (plus @swash, @ornaments, @annotation, @stylistic, @styleset and @character-variant) — define common names in font-variant-alternates for feature activated differently in opentype.
...furthermore, they all convey a common semantic meaning—they all link some type of condition, which at any time evaluates to either true or false.
Using CSS animations - CSS: Cascading Style Sheets
function listener(event) { var l = document.createelement("li"); switch(event.type) { case "animationstart": l.innerhtml = "started: elapsed time is " + event.elapsedtime; break; case "animationend": l.innerhtml = "ended: elapsed time is " + event.elapsedtime; break; case "animationiteration": l.innerhtml = "new loop started at time " + event.elapsedtime; break; } document.getelementbyid("output").appendchild(l); } this code...
...it simply looks at the event.type to determine which kind of animation event occurred, then adds an appropriate note to the <ul> (unordered list) we’re using to log these events.
CSS Box Alignment - CSS: Cascading Style Sheets
types of alignment there are three different types of alignment that the specification details; these use keyword values.
... pages detailing individual alignment properties as the css box alignment properties are implemented differently depending on the specification they interact with, refer to the following pages for each layout type for details of how to use the alignment properties with it: box alignment in flexbox box alignment in css grid layout box alignment in multiple-column layout box alignment for block, absolutely positioned and table layout reference css properties justify-content align-content place-content justify-items align-items place-items justify-self align-self place-self row-gap colu...
CSS Color - CSS: Cascading Style Sheets
WebCSSCSS Color
css color is a css module that deals with colors, color types, color blending, opacity, and how you can apply these colors and effects to html content.
... reference properties color color-adjust opacity data types <color> guides applying color to html elements using css a guide to using css to apply color to a variety of types of content.
Flow Layout and Writing Modes - CSS: Cascading Style Sheets
a block-level box will establish a new block formatting context, meaning that if its inner display type would be flow, it will get a computed display type of flow-root.
...this can be used to properly typeset vertical languages or for creative reasons.
In Flow and Out of Flow - CSS: Cascading Style Sheets
the list is displayed using flexbox to arrange the items into a row, however it too is participating in block and inline layout - the container has an outside display type of block.
... summary in this guide we have covered the ways to take an element out of flow in order to achieve some very specific types of positioning.
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
a responsive layout with 1 to 3 fluid columns using grid-template-areas many websites are a variation of this type of layout, with content, sidebars, a header and a footer.
...we can create this type of system using css grid layout.
CSS Images - CSS: Cascading Style Sheets
css images is a module of css that defines what types of images can be used (the <image> type, containing urls, gradients and other types of images), how to resize them and how they, and other replaced content, interact with the different layout models.
... reference properties image-orientation image-rendering image-resolution object-fit object-position functions linear-gradient() radial-gradient() repeating-linear-gradient() repeating-radial-gradient() conic-gradient() repeating-conic-gradient() url() element() image() cross-fade() data types <gradient> <image> guides using css gradients presents a specific type of css images, gradients, and how to create and use these.
Browser compatibility and Scroll Snap - CSS: Cascading Style Sheets
the main things to note are as follows: the scroll-snap-type-x and scroll-snap-type-y properties have been dropped the scroll-snap-type property has become a longhand, so the old shorthand syntax like scroll-snap-type:mandatory will stop working can i use the old implementation as a fallback?
...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.
Pseudo-classes - CSS: Cascading Style Sheets
index of standard pseudo-classes :active :any-link :blank :checked :current :default :defined :dir() :disabled :drop :empty :enabled :first :first-child :first-of-type :fullscreen :future :focus :focus-visible :focus-within :has() :host :host() :host-context() :hover :indeterminate :in-range :invalid :is() :lang() :last-child :last-of-type :left :link :local-link :not() :nth-child() :nth-col() :nth-last-child() :nth-last-col() :nth-last-of-type() :nth-of-type() :only-child :only-of-type :optional :out-of-range :...
... selectors level 3 recommendation defined :target, :root, :nth-child(), :nth-last-of-child(), :nth-of-type(), :nth-last-of-type(), :last-child, :first-of-type, :last-of-type, :only-child, :only-of-type, :empty and :not().
Replaced elements - CSS: Cascading Style Sheets
replaced elements typical replaced elements are: <iframe> <video> <embed> <img> some elements are treated as replaced elements only in specific cases: <option> <audio> <canvas> <object> <applet> html spec also says that an <input> element can be replaced, because <input> elements of the "image" type are replaced elements similar to <img>.
... however, other form controls, including other types of <input> elements, are explicitly listed as non-replaced elements (the spec describes their default platform-specific rendering with the term "widgets").
WebKit CSS extensions - CSS: Cascading Style Sheets
p-collapse -webkit-marquee-direction -webkit-marquee-increment -webkit-marquee-repetition -webkit-marquee-speed -webkit-marquee-style -webkit-marquee -webkit-mask-box-image-outset -webkit-mask-box-image-repeat -webkit-mask-box-image-slice -webkit-mask-box-image-source -webkit-mask-box-image-width -webkit-mask-box-image -webkit-mask-repeat-x -webkit-mask-repeat-y -webkit-mask-source-type -webkit-max-logical-height -webkit-max-logical-width -webkit-min-logical-height -webkit-min-logical-width n -webkit-nbsp-mode p -webkit-padding-after** -webkit-padding-before** -webkit-padding-end** -webkit-padding-start** -webkit-perspective-origin-x -webkit-perspective-origin-y -webkit-print-color-adjust r-s -webkit-rtl-ordering -webkit-svg-shadow t -webkit-tap-hi...
...ens -webkit-justify-content -webkit-justify-items -webkit-justify-self -webkit-line-break m -webkit-mask -webkit-mask-clip -webkit-mask-composite -webkit-mask-image -webkit-mask-origin -webkit-mask-position -webkit-mask-repeat -webkit-mask-size o-r -webkit-opacity -webkit-order -webkit-perspective -webkit-perspective-origin -webkit-ruby-position s -webkit-scroll-snap-type -webkit-shape-image-threshold -webkit-shape-margin -webkit-shape-outside t -epub-text-decoration -webkit-text-color-decoration -webkit-text-decoration-line -webkit-text-decoration-style -epub-text-emphasis -webkit-text-emphasis -epub-text-emphasis-color -webkit-text-emphasis-color -webkit-text-emphasis-position -epub-text-emphasis-style -webkit-text-emphasis-style -webkit-text-...
align-content - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies tomulti-line flex containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax normal | <baseline-position> | <content-distribution> | <overflow-position>?
... candidate recommendation initial definition initial valuenormalapplies tomulti-line flex containersinheritednocomputed valueas specifiedanimation typediscrete ...
<alpha-value> - CSS: Cascading Style Sheets
the <alpha-value> css data type represents a value that can be either a <number> or a <percentage>, specifying the alpha channel or transparency of a color.
... interpolation when animated, values of the <alpha-value> css data type are interpolated as real, floating-point numbers.
<angle> - CSS: Cascading Style Sheets
WebCSSangle
the <angle> css data type represents an angle value expressed in degrees, gradians, radians, or turns.
... syntax the <angle> data type consists of a <number> followed by one of the units listed below.
animation - CSS: Cascading Style Sheets
WebCSSanimation
animation: 3s linear 1s slidein; } .a3 { animation: 3s slidein; } .animation { background: #3f87a6; width: 100%; height: calc(100% - 1.5em); transform-origin: left center; } window.addeventlistener('load', function () { var animation = array.from(document.queryselectorall('.animation')); var button = array.from(document.queryselectorall('button')); function togglebutton (btn, type) { btn.classlist.remove('play', 'pause', 'restart'); btn.classlist.add(type); btn.title = type.touppercase(type); } function playpause (i) { var btn = button[i]; var anim = animation[i]; if (btn.classlist.contains('play')) { anim.style.animationplaystate = 'running'; togglebutton(btn, 'pause'); } else if (btn.classlist.contains('pause')) { anim...
...es 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> | <time> | <single-animation-iteration-count> | <single-animation-direction> | <single-animation-fill-mode> | <single-animation-play-state> | [ none | <keyframes-name> ]where <timing-function> = linear | <cubic-bezier-timing-function> | <step-timing-function><single-animation-iteration-count> = infini...
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
<div>lorem</div> firefox checkmenuitem div { color: black; height: 20px; -moz-appearance: checkmenuitem; -webkit-appearance: checkmenuitem; } <div>lorem</div> firefox color-well div{ color: black; -moz-appearance: color-well; -webkit-appearance: color-well; } <div>lorem</div> safari input type=color continuous-capacity-level-indicator div{ color: black; -moz-appearance: continuous-capacity-level-indicator; -webkit-appearance: continuous-capacity-level-indicator; } <div>lorem</div> safari default-button div{ color: black; -moz-appearance: default-button; -webkit-appearance: default-button; } <div>lorem</div> ...
... formal definition initial valueautoapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | auto | button | textfield | menulist-button | <compat-auto>where <compat-auto> = searchfield | textarea | push-button | slider-horizontal | checkbox | radio | square-button | menulist | listbox | meter | progress-bar examples the following would make an element look like a menulist button: .exampleone { appearance: menulist-button; } see also this jsfiddle fo...
aspect-ratio - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toall elements except inline boxes and internal ruby or table boxesinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | <ratio> examples mapping width and height to aspect-ratio firefox has added an internal aspect-ratio property (in version 69 onwards) that applies to replaced elements and other related elements that accept width and height attributes.
... in firefox, the internal stylesheet rule looks like this: img, input[type="image"], video, embed, iframe, marquee, object, table { aspect-ratio: attr(width) / attr(height); } specifications specification status comment css box sizing module level 4the definition of 'aspect-ratio' in that specification.
background-attachment - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritednocomputed valueas specifiedanimation typediscrete formal syntax <attachment>#where <attachment> = scroll | fixed | local examples simple example html <p> there were doors all round the hall, but they were all locked; and when alice had been all the way down one side and up the other, trying every door, she walked sadly down the middle, wondering how she was ever to get out again.
...each image is matched with the corresponding attachment type, from first specified to last.
background-image - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritednocomputed valueas specified, but with <url> values made absoluteanimation typediscrete formal syntax <bg-image>#where <bg-image> = none | <image>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( <image-tags>?
... candidate recommendation from css2 revision 1, the property has been extended to support multiple backgrounds and any <image> css data type.
<blend-mode> - CSS: Cascading Style Sheets
the <blend-mode> css data type describes how colors should appear when elements overlap.
... syntax the <blend-mode> data type is defined using a keyword value chosen from the list below.
block-size - CSS: Cascading Style Sheets
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; block-size: 200px; } result specifications specification status comment css logical properties and values level 1the definition of 'block-size' in that specification.
border-block-start-width - CSS: Cascading Style Sheets
initial valuemediumapplies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typea length values <'border-width'> the width of the border.
... formal definition initial valuemediumapplies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typea length formal syntax <'border-top-width'> examples border width with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 1px solid blue; border-block-start-width: 5px; } results specifications specification status comment css logical properties and values level 1the definition of 'border-block-start-width' in that specification.
border-bottom-left-radius - CSS: Cascading Style Sheets
as absolute length it can be expressed in any unit allowed by the css <length> data type.
...it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sanimation typea length, percentage or calc(); formal syntax <length-percentage>{1,2}where <length-percentage> = <length> | <percentage> examples live example code .
border-bottom-right-radius - CSS: Cascading Style Sheets
as absolute length it can be expressed in any unit allowed by the css <length> data type.
...it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sanimation typea length, percentage or calc(); formal syntax <length-percentage>{1,2}where <length-percentage> = <length> | <percentage> examples live example code .
border-color - CSS: Cascading Style Sheets
it also applies to ::first-letter.inheritednocomputed valueas each of the properties of the shorthand:border-bottom-color: computed colorborder-left-color: computed colorborder-right-color: computed colorborder-top-color: computed coloranimation typeas each of the properties of the shorthand:border-bottom-color: a colorborder-left-color: a colorborder-right-color: a colorborder-top-color: a color formal syntax <color>{1,4}where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
... candidate recommendation the transparent keyword has been removed as it is now a part of the <color> data type.
border-end-end-radius - CSS: Cascading Style Sheets
as absolute length it can be expressed in any unit allowed by the css <length> data type.
...it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sanimation typea length, percentage or calc(); formal syntax <length-percentage>{1,2}where <length-percentage> = <length> | <percentage> examples border radius with vertical text html <div> <p class="exampletext">example</p> </div> css content div { background-color: rebeccapurple; width: 120px; height: 120px; border-end-end-radius: 10px; } .exampletext { writing-mode: vertical-rl; paddin...
border-end-start-radius - CSS: Cascading Style Sheets
as absolute length it can be expressed in any unit allowed by the css <length> data type.
...it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sanimation typea length, percentage or calc(); formal syntax <length-percentage>{1,2}where <length-percentage> = <length> | <percentage> examples border radius with vertical text html <div> <p class="exampletext">example</p> </div> css div { background-color: rebeccapurple; width: 120px; height: 120px; border-end-start-radius: 10px; } .exampletext { writing-mode: vertical-rl; padding: 10p...
border-image-slice - CSS: Cascading Style Sheets
it also applies to ::first-letter.inheritednopercentagesrefer to the size of the border imagecomputed valueone to four percentage(s) (as specified) or absolute length(s), plus the keyword fill if specifiedanimation typeby computed value type formal syntax <number-percentage>{1,4} && fill?where <number-percentage> = <number> | <percentage> examples adjustable border width and slice the folowing example shows a simple <div> with a border image set on it.
... html <div class="wrapper"> <div></div> </div> <ul> <li> <label for="width">slide to adjust <code>border-width</code></label> <input type="range" min="10" max="45" id="width"> <output id="width-output">30px</output> </li> <li> <label for="slice">slide to adjust <code>border-image-slice</code></label> <input type="range" min="10" max="45" id="slice"> <output id="slice-output">30</output> </li> </ul> css .wrapper { width: 400px; height: 300px; } div > div { width: 300px; height: 200px; border-width:...
border-image - CSS: Cascading Style Sheets
age-outset: as specified, but with relative lengths converted into absolute lengthsborder-image-repeat: as specifiedborder-image-slice: one to four percentage(s) (as specified) or absolute length(s), plus the keyword fill if specifiedborder-image-source: none or the image with its uri made absoluteborder-image-width: as specified, but with relative lengths converted into absolute lengthsanimation typediscrete formal syntax <'border-image-source'> | <'border-image-slice'> [ / <'border-image-width'> | / <'border-image-width'>?
...age-outset: as specified, but with relative lengths converted into absolute lengthsborder-image-repeat: as specifiedborder-image-slice: one to four percentage(s) (as specified) or absolute length(s), plus the keyword fill if specifiedborder-image-source: none or the image with its uri made absoluteborder-image-width: as specified, but with relative lengths converted into absolute lengthsanimation typediscrete ...
border-inline-end-color - CSS: Cascading Style Sheets
initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typea color values <'color'> the color of the border.
... formal definition initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typea color formal syntax <'border-top-color'> examples html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 10px solid blue; border-inline-end-color: red; } specifications specification status comment css logical properties and values level 1the definition of 'border-inline-end-color' in that specification.
border-inline-end-width - CSS: Cascading Style Sheets
initial valuemediumapplies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typea length values <'border-width'> the width of the border.
... formal definition initial valuemediumapplies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typea length formal syntax <'border-top-width'> examples applying a border with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 1px solid blue; border-inline-end-width: 5px; } results specifications specification status comment css logical properties and values level 1the definition of 'border-inline-end-width' in that specification.
border-inline-end - CSS: Cascading Style Sheets
ddenborder-right-width: the absolute length or 0 if border-right-style is none or hiddenborder-top-width: the absolute length or 0 if border-top-style is none or hiddenborder-style: as each of the properties of the shorthand:border-bottom-style: as specifiedborder-left-style: as specifiedborder-right-style: as specifiedborder-top-style: as specifiedborder-inline-end-color: computed coloranimation typeas each of the properties of the shorthand:border-inline-end-color: a colorborder-inline-end-style: discreteborder-inline-end-width: a length values the border-inline-end is specified with one or more of the following, in any order: <'border-width'> the width of the border.
...ddenborder-right-width: the absolute length or 0 if border-right-style is none or hiddenborder-top-width: the absolute length or 0 if border-top-style is none or hiddenborder-style: as each of the properties of the shorthand:border-bottom-style: as specifiedborder-left-style: as specifiedborder-right-style: as specifiedborder-top-style: as specifiedborder-inline-end-color: computed coloranimation typeas each of the properties of the shorthand:border-inline-end-color: a colorborder-inline-end-style: discreteborder-inline-end-width: a length formal syntax <'border-top-width'> | <'border-top-style'> | <'color'>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
border-inline-start-style - CSS: Cascading Style Sheets
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete values <'border-style'> the line style of the border.
... formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'border-top-style'> examples html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 5px solid blue; border-inline-start-style: dashed; } specifications specification status comment css logical properties and values level 1the definition of 'border-inline-start-style' in that specification.
border-inline - CSS: Cascading Style Sheets
initial valueas each of the properties of the shorthand:border-top-width: mediumborder-top-style: noneborder-top-color: currentcolorapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:border-top-width: the absolute length or 0 if border-top-style is none or hiddenborder-top-style: as specifiedborder-top-color: computed coloranimation typediscrete constituent properties this property is a shorthand for the following css properties: border-inline-color border-inline-style border-inline-width syntax values the border-inline is specified with one or more of the following, in any order: <'border-width'> the width of the border.
... formal definition initial valueas each of the properties of the shorthand:border-top-width: mediumborder-top-style: noneborder-top-color: currentcolorapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:border-top-width: the absolute length or 0 if border-top-style is none or hiddenborder-top-style: as specifiedborder-top-color: computed coloranimation typediscrete formal syntax <'border-top-width'> | <'border-top-style'> | <'color'>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
border-start-end-radius - CSS: Cascading Style Sheets
as absolute length it can be expressed in any unit allowed by the css <length> data type.
...it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sanimation typea length, percentage or calc(); formal syntax <length-percentage>{1,2}where <length-percentage> = <length> | <percentage> examples border radius with vertical text html <div> <p class="exampletext">example</p> </div> css div { background-color: rebeccapurple; width: 120px; height: 120px; border-start-end-radius: 10px; } .exampletext { writing-mode: vertical-rl; padding: 10p...
border-start-start-radius - CSS: Cascading Style Sheets
as absolute length it can be expressed in any unit allowed by the css <length> data type.
...it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sanimation typea length, percentage or calc(); formal syntax <length-percentage>{1,2}where <length-percentage> = <length> | <percentage> examples border radius with vertical text html <div> <p class="exampletext">example</p> </div> css div { background-color: rebeccapurple; width: 120px; height: 120px; border-start-start-radius: 10px; } .exampletext { writing-mode: vertical-rl; padding: 1...
border-top-left-radius - CSS: Cascading Style Sheets
as absolute length it can be expressed in any unit allowed by the css <length> data type.
...it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sanimation typea length, percentage or calc(); formal syntax <length-percentage>{1,2}where <length-percentage> = <length> | <percentage> examples live example code an arc of ellipse is used as the border div { border-top-left-radius: 40px 40px; } an arc of ellipse is used as the border div { border-top-left-radius: 40px 20px; } ...
border-top-right-radius - CSS: Cascading Style Sheets
as absolute length it can be expressed in any unit allowed by the css <length> data type.
...it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sanimation typea length, percentage or calc(); formal syntax <length-percentage>{1,2}where <length-percentage> = <length> | <percentage> examples live example code an arc of circle is used as the border div { border-top-right-radius: 40px 40px; } an arc of ellipse is used as the border div { border-top-right-radius: 40px 20px; } ...
border-top-style - CSS: Cascading Style Sheets
it also applies to ::first-letter.inheritednocomputed valueas specifiedanimation typediscrete formal syntax <line-style>where <line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset examples html <table> <tr> <td class="b1">none</td> <td class="b2">hidden</td> <td class="b3">dotted</td> <td class="b4">dashed</td> </tr> <tr> <td class="b5">solid</td> <td class="b6">double</td> <td class="b7">groove</td...
...it also applies to ::first-letter.inheritednocomputed valueas specifiedanimation typediscrete ...
border-width - CSS: Cascading Style Sheets
ocomputed valueas each of the properties of the shorthand:border-bottom-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-left-width: the absolute length or 0 if border-left-style is none or hiddenborder-right-width: the absolute length or 0 if border-right-style is none or hiddenborder-top-width: the absolute length or 0 if border-top-style is none or hiddenanimation typeas each of the properties of the shorthand:border-bottom-width: a lengthborder-left-width: a lengthborder-right-width: a lengthborder-top-width: a length formal syntax <line-width>{1,4}where <line-width> = <length> | thin | medium | thick examples a mix of values and lengths html <p id="sval"> one value: 6px wide border on all 4 sides</p> <p id="bival"> two different values: 2px wide...
... candidate recommendation no direct change; the <length> css data type extension has an effect on this property.
color-adjust - CSS: Cascading Style Sheets
by default, the browser is allowed to make any adjustments to the element's appearance it determines to be necessary and prudent given the type and capabilities of the output device.
... formal definition initial valueeconomyapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax economy | exact examples preserving low contrast in this example, a box is shown which uses a background-image and a translucent linear-gradient() function atop a black background color to have a dark blue gradient behind medium red text.
color - CSS: Cascading Style Sheets
WebCSScolor
it can't be a <gradient>, which is actually a type of <image>.
...the transparent keyword maps to rgba(0,0,0,0).animation typea color formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
column-gap (grid-column-gap) - CSS: Cascading Style Sheets
for all other layout types it is 0.
... formal definition initial valuenormalapplies tomulti-column elements, flex containers, grid containersinheritednopercentagesrefer to corresponding dimension of the content areacomputed valueas specified, with <length>s made absolute, and normal computing to zero except on multi-column elementsanimation typea length, percentage or calc(); formal syntax normal | <length-percentage>where <length-percentage> = <length> | <percentage> examples flex layout html <div id="flexbox"> <div></div> <div></div> <div></div> </div> css #flexbox { display: flex; height: 100px; column-gap: 20px; } #flexbox > div { border: 1px solid green; background-color: lime; flex: auto; } result g...
<display-inside> - CSS: Cascading Style Sheets
these keywords specify the element’s inner display type, which defines the type of formatting context that lays out its contents (assuming it is a non-replaced element).
... 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.
flex-basis - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toflex items, including in-flow pseudo-elementsinheritednopercentagesrefer to the flex container's inner main sizecomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typea length, percentage or calc(); formal syntax content | <'width'> examples setting flex item initial sizes html <ul class="container"> <li class="flex flex1">1: flex-basis test</li> <li class="flex flex2">2: flex-basis test</li> <li class="flex flex3">3: flex-basis test</li> <li class="flex flex4">4: flex-basis test</li> <li class="flex flex5">5: flex-basis test</li> </ul> <ul cla...
...ss="container"> <li class="flex flex6">6: flex-basis test</li> </ul> css .container { font-family: arial, sans-serif; margin: 0; padding: 0; list-style-type: none; display: flex; flex-wrap: wrap; } .flex { background: #6ab6d8; padding: 10px; margin-bottom: 50px; border: 3px solid #2e86bb; color: white; font-size: 14px; text-align: center; position: relative; } .flex:after { position: absolute; z-index: 1; left: 0; top: 100%; margin-top: 10px; width: 100%; color: #333; font-size: 12px; } .flex1 { flex-basis: auto; } .flex1:after { content: 'auto'; } .flex2 { flex-basis: max-content; } .flex2:after { content: 'max-content'; } .flex3 { flex-basis: min-content; } .flex3:after { content: 'min-content'; } .flex4 { flex-basis: fi...
<flex> - CSS: Cascading Style Sheets
the <flex> css data type denotes a flexible length within a grid container.
... syntax the <flex> data type is specified as a <number> followed by the unit fr.
font-stretch - CSS: Cascading Style Sheets
for truetype or opentype variable fonts, the "wdth" variation is used to implement varying widths.
...it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typea font stretch formal syntax <font-stretch-absolute>where <font-stretch-absolute> = normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | <percentage> examples setting font stretch percentages note that this example will only work in browsers that support <percentage> values.
<frequency-percentage> - CSS: Cascading Style Sheets
the <frequency-percentage> css data type represents a value that can be either a <frequency> or a <percentage>.
... description use in calc() where a <frequency-percentage> is specified as an allowable type, this means that the percentage resolves to a frequency and therefore can be used in a calc() expression.
<gradient> - CSS: Cascading Style Sheets
WebCSSgradient
the <gradient> css data type is a special type of <image> that consists of a progressive transition between two or more colors.
... syntax the <gradient> data type is defined with one of the function types listed below.
grid-auto-flow - CSS: Cascading Style Sheets
formal definition initial valuerowapplies togrid containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ row | column ] | dense examples setting grid auto-placement html <div id="grid"> <div id="item1"></div> <div id="item2"></div> <div id="item3"></div> <div id="item4"></div> <div id="item5"></div> </div> <select id="direction" onchange="changegridautoflow()"> <option value="column">column</option> <option value="row">row</option> </select> <input id="den...
...se" type="checkbox" onchange="changegridautoflow()"> <label for="dense">dense</label> css #grid { height: 200px; width: 200px; display: grid; grid-gap: 10px; grid-template: repeat(4, 1fr) / repeat(2, 1fr); grid-auto-flow: column; /* or 'row', 'row dense', 'column dense' */ } #item1 { background-color: lime; grid-row-start: 3; } #item2 { background-color: yellow; } #item3 { background-color: blue; } #item4 { grid-column-start: 2; background-color: red; } #item5 { background-color: aqua; } function changegridautoflow() { var grid = document.getelementbyid("grid"); var direction = document.getelementbyid("direction"); var dense = document.getelementbyid("dense"); var gridautoflow = direction.value === "row" ?
list-style-position - CSS: Cascading Style Sheets
formal definition initial valueoutsideapplies tolist itemsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax inside | outside examples setting list item position html <ul class="inside">list 1 <li>list item 1-1</li> <li>list item 1-2</li> <li>list item 1-3</li> <li>list item 1-4</li> </ul> <ul class="outside">list 2 <li>list item 2-1</li> <li>list item 2-2</li> <li>list item 2-3</li> <li>list item 2-4</li> </ul> <ul class="inside-img">list 3 <li>list item 3-...
...1</li> <li>list item 3-2</li> <li>list item 3-3</li> <li>list item 3-4</li> </ul> css .inside { list-style-position: inside; list-style-type: square; } .outside { list-style-position: outside; list-style-type: circle; } .inside-img { list-style-position: inside; list-style-image: url("https://mdn.mozillademos.org/files/11979/starsolid.gif"); } result specifications specification status comment css lists module level 3the definition of 'list-style-position' in that specification.
margin-bottom - CSS: Cascading Style Sheets
formal definition initial value0applies toall elements, except elements with table display types other than table-caption, table and inline-table.
... it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length formal syntax <length> | <percentage> | auto examples setting positive and negative bottom margins html <div class="container"> <div class="box0">box 0</div> <div class="box1">box 1</div> <div class="box2">box one's negative margin pulls me up</div> </div> css css for divs to set margin-bottom and height .box0 { margin-bottom:1em; height:3em; } .box1 { margin-bottom:-1.5em; height:4em; } .box2 { border:1px dashed black; border-width:1px 0; margin-bottom:2em; } some definitions for container and divs so margins' effects can be seen more clearly .container...
margin-inline - CSS: Cascading Style Sheets
formal 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 formal syntax <'margin-left'>{1,2} examples setting inline start and end margins html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; margin-inline: 20px 40px; background-color: #c8c800; } result specifications specification status c...
... 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 ...
margin-left - CSS: Cascading Style Sheets
flexbox layout mode formal definition initial value0applies toall elements, except elements with table display types other than table-caption, table and inline-table.
... it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length formal syntax <length> | <percentage> | auto examples setting left margin using pixels and percentages .content { margin-left: 5%; } .sidebox { margin-left: 10px; } .logo { margin-left: -5px; } specifications specification status comment css basic box modelthe definition of 'margin-left' in that specification.
margin-right - CSS: Cascading Style Sheets
flexbox layout mode formal definition initial value0applies toall elements, except elements with table display types other than table-caption, table and inline-table.
... it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length formal syntax <length> | <percentage> | auto examples setting right margin using pixels and percentages .content { margin-right: 5%; } .sidebox { margin-right: 10px; } .logo { margin-right: -5px; } specifications specification status comment css basic box modelthe definition of 'margin-right' in that specification.
margin-top - CSS: Cascading Style Sheets
formal definition initial value0applies toall elements, except elements with table display types other than table-caption, table and inline-table.
... it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length formal syntax <length> | <percentage> | auto examples setting positive and negative top margins .content { margin-top: 5%; } .sidebox { margin-top: 10px; } .logo { margin-top: -5px; } #footer { margin-top: 1em; } specifications specification status comment css basic box modelthe definition of 'margin-top' in that specification.
margin - CSS: Cascading Style Sheets
WebCSSmargin
initial valueas each of the properties of the shorthand:margin-bottom: 0margin-left: 0margin-right: 0margin-top: 0applies toall elements, except elements with table display types other than table-caption, table and inline-table.
...d ::first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valueas each of the properties of the shorthand:margin-bottom: the percentage as specified or the absolute lengthmargin-left: the percentage as specified or the absolute lengthmargin-right: the percentage as specified or the absolute lengthmargin-top: the percentage as specified or the absolute lengthanimation typea length ...
mask-border-mode - CSS: Cascading Style Sheets
formal definition initial valuealphaapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax luminance | alpha examples basic usage this property doesn't yet seem to have support anywhere.
... when browsers support it, it will specify the type of blending mode used for the mask border — luminance or alpha: mask-border-mode: luminance; mask-border-mode: alpha; specifications specification status comment css masking module level 1the definition of 'mask-border-mode' in that specification.
min() - CSS: Cascading Style Sheets
WebCSSmin
the expressions can be math expressions (using arithmetic operators), literal values, or other expressions, such as attr(), that evaluate to a valid argument type (like <length>).
... <form> <label>type something:</label> <input type="text"> </form> specifications specification status comment css values and units module level 4the definition of 'min()' in that specification.
<number> - CSS: Cascading Style Sheets
WebCSSnumber
the <number> css data type represents a number, being either an integer or a number with a fractional component.
... interpolation when animated, values of the <number> css data type are interpolated as real, floating-point numbers.
offset-position - CSS: Cascading Style Sheets
for more explanation of these value types, see background-position.
... formal definition initial valueautoapplies totransformable elementsinheritednopercentagesrefertosizeofcontainingblockcomputed valuefor <length> the absolute value, otherwise a percentageanimation typea position formal syntax auto | <position>where <position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]?
order - CSS: Cascading Style Sheets
WebCSSorder
flexbox & the keyboard navigation disconnect — tink source order matters | adrian roselli mdn understanding wcag, guideline 1.3 explanations understanding success criterion 1.3.2 | w3c understanding wcag 2.0 formal definition initial value0applies toflex items and absolutely-positioned flex container childreninheritednocomputed valueas specifiedanimation typean integer formal syntax <integer> examples ordering items in a flex container this example uses css to create a classic two-sidebar layout surrounding a content block.
... candidate recommendation initial definition initial value0applies toflex items and absolutely-positioned flex container childreninheritednocomputed valueas specifiedanimation typean integer ...
orphans - CSS: Cascading Style Sheets
WebCSSorphans
formal definition initial value2applies toblock container elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax <integer> examples setting a minimum orphan size of three lines html <div> <p>this is the first paragraph containing some text.</p> <p>this is the second paragraph containing some more text than the first one.
... candidate recommendation extends orphans to apply to any type of fragment, including pages, regions, or columns.
overflow-block - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toblock-containers, flex containers, and grid containersinheritednocomputed valueas specified, except with visible/clip computing to auto/hidden respectively if one of overflow-x or overflow-y is neither visible nor clipanimation typediscrete formal syntax visible | hidden | clip | scroll | auto examples html <ul> <li><code>overflow-block:hidden</code> — hides the text outside the box <div id="div1"> lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
... working draft initial valueautoapplies toblock-containers, flex containers, and grid containersinheritednocomputed valueas specified, except with visible/clip computing to auto/hidden respectively if one of overflow-x or overflow-y is neither visible nor clipanimation typediscrete ...
overflow-wrap - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies tonon-replaced inline elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | break-word | anywhere examples comparing overflow-wrap, word-break, and hyphens this example compares the results of overflow-wrap, word-break, and hyphens when breaking up a long word.
... working draft initial definition initial valuenormalapplies tonon-replaced inline elementsinheritedyescomputed valueas specifiedanimation typediscrete ...
overscroll-behavior-y - CSS: Cascading Style Sheets
/* keyword values */ overscroll-behavior-y: auto; /* default */ overscroll-behavior-y: contain; overscroll-behavior-y: none; /* global values */ overscroll-behavior-y: inherit; overscroll-behavior-y: initial; overscroll-behavior-y: unset; initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax the overscroll-behavior-y property is specified as a keyword chosen from the list of values below.
... formal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax contain | none | auto examples preventing an underlying element from scrolling vertically .messages { height: 220px; overflow: auto; overscroll-behavior-y: contain; } see overscroll-behavior for a full example and explanation.
overscroll-behavior - CSS: Cascading Style Sheets
you can use overscroll-behavior to get rid of unwanted scroll chaining and the browser's facebook/twitter app-inspired "pull to refresh"-type behavior.
... formal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ contain | none | auto ]{1,2} examples preventing an underlying element from scrolling in our overscroll-behavior example (see the source code also), we present a full-page list of fake contacts, and a dialog box containing a chat window.
position - CSS: Cascading Style Sheets
WebCSSposition
description types of positioning a positioned element is an element whose computed position value is either relative, absolute, fixed, or sticky.
... formal definition initial valuestaticapplies toall elementsinheritednocomputed valueas specifiedanimation typediscretecreates stacking contextyes formal syntax static | relative | absolute | sticky | fixed examples relative positioning relatively positioned elements are offset a given amount from their normal position within the document, but without the offset affecting other elements.
<position> - CSS: Cascading Style Sheets
the <position> (or <bg-position>) css data type denotes a two-dimensional coordinate used to set a location relative to an element box.
... syntax the <position> data type is specified with one or two keywords, with optional offsets.
resize - CSS: Cascading Style Sheets
WebCSSresize
resize does not apply to the following: inline elements block elements for which the overflow property is set to visible formal definition initial valuenoneapplies toelements with overflow other than visible, and optionally replaced elements representing images or videos, and iframesinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | both | horizontal | vertical | block | inline examples disabling resizability of textareas in many browsers, <textarea> elements are resizable by default.
... html <textarea>type some text here.</textarea> css textarea { resize: none; /* disables resizability */ } result using resize with arbitrary elements you can use the resize property to make any element resizable.
<resolution> - CSS: Cascading Style Sheets
the <resolution> css data type, used for describing resolutions in media queries, denotes the pixel density of an output device, i.e., its resolution.
... syntax the <resolution> data type consists of a strictly positive <number> followed by one of the units listed below.
scroll-margin-inline-end - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length> examples simple demonstration this example implements something very similar to the interactive example above, except that here we'll explain to you how it's implemented.
...the outer container is styled like this: .scroller { text-align: left; width: 250px; height: 250px; overflow-x: scroll; display: flex; box-sizing: border-box; border: 1px solid #000; scroll-snap-type: x mandatory; } the main parts relevant to the scroll snapping are overflow-x: scroll, which makes sure the contents will scroll and not be hidden, and scroll-snap-type: x mandatory, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point.
scroll-margin-inline-start - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length> examples simple demonstration this example implements something very similar to the interactive example above, except that here we'll explain to you how it's implemented.
...the outer container is styled like this: .scroller { text-align: left; width: 250px; height: 250px; overflow-x: scroll; display: flex; box-sizing: border-box; border: 1px solid #000; scroll-snap-type: x mandatory; } the main parts relevant to the scroll snapping are overflow-x: scroll, which makes sure the contents will scroll and not be hidden, and scroll-snap-type: x mandatory, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point.
scroll-margin-inline - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length>{1,2} examples simple demonstration this example implements something very similar to the interactive example above, except that here we'll explain to you how it's implemented.
...the outer container is styled like this: .scroller { text-align: left; width: 250px; height: 250px; overflow-x: scroll; display: flex; box-sizing: border-box; border: 1px solid #000; scroll-snap-type: x mandatory; } the main parts relevant to the scroll snapping are overflow-x: scroll, which makes sure the contents will scroll and not be hidden, and scroll-snap-type: x mandatory, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point.
scroll-margin - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length>{1,4} examples simple demonstration this example implements something very similar to the interactive example above, except that here we'll explain to you how it's implemented.
...the outer container is styled like this: .scroller { text-align: left; width: 250px; height: 250px; overflow-x: scroll; display: flex; box-sizing: border-box; border: 1px solid #000; scroll-snap-type: x mandatory; } the main parts relevant to the scroll snapping are overflow-x: scroll, which makes sure the contents will scroll and not be hidden, and scroll-snap-type: x mandatory, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point.
scroll-snap-coordinate - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednopercentagesrefer to the element’s border boxcomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typea position formal syntax none | <position>#where <position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]?
... <div>3</div> </div> </div> <div> <p>at coordinate (50, 0)</p> <div class="scrollcontainer coordinate50"> <div>1</div> <div>2</div> <div>3</div> </div> </div> </div> css #container { display: flex; } #container > div:nth-child(-n+2) { margin-right: 20px; } .scrollcontainer { width: 100px; overflow: auto; white-space: nowrap; scroll-snap-type: mandatory; font-size: 0; } .scrollcontainer > div { width: 100px; height: 100px; display: inline-block; line-height: 100px; text-align: center; font-size: 50px; } .coordinate0 > div { scroll-snap-coordinate: 0 0; } .coordinate25 > div { scroll-snap-coordinate: 25px 0; } .coordinate50 > div { scroll-snap-coordinate: 50px 0; } .scrollcontainer > div:nth-child(even) { bac...
scroll-snap-destination - CSS: Cascading Style Sheets
formal definition initial value0px 0pxapplies toscroll containersinheritednopercentagesrelative to same axis of the padding-box of the scroll containercomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typea position formal syntax <position>where <position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]?
... <div> <p>at coordinate (50, 0)</p> <div class="scrollcontainer destination50"> <div>1</div> <div>2</div> <div>3</div> </div> </div> </div> css #container { display: flex; } #container > div:nth-child(-n+2) { margin-right: 20px; } .scrollcontainer { width: 100px; overflow: auto; white-space: nowrap; scroll-snap-points-x: repeat(100%); scroll-snap-type: mandatory; scroll-snap-destination: 20px 0; font-size: 0; } .destination0 { scroll-snap-destination: 0 0; } .destination25 { scroll-snap-destination: 25px 0; } .destination50 { scroll-snap-destination: 50px 0; } .scrollcontainer > div { width: 100px; height: 100px; display: inline-block; line-height: 100px; text-align: center; font-size: 50px; } .scrollcontainer > div:...
scrollbar-width - CSS: Cascading Style Sheets
initial valueautoapplies toscrolling boxesinheritednocomputed valueas specifiedanimation typediscrete syntax /* keyword values */ scrollbar-width: auto; scrollbar-width: thin; scrollbar-width: none; /* global values */ scrollbar-width: inherit; scrollbar-width: initial; scrollbar-width: unset; values <scrollbar-width> defines the width of the scrollbar as a keyword.
... mdn understanding wcag, guideline 2.1 explanations mdn understanding wcag, guideline 2.5 explanations understanding success criterion 2.1.1 | w3c understanding wcag 2.1 understanding success criterion 2.5.5 | w3c understanding wcag 2.1 formal definition initial valueautoapplies toscrolling boxesinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | thin | none examples sizing overflow scrollbars css .scroller { width: 300px; height: 100px; overflow-y: scroll; scrollbar-width: thin; } html <div class="scroller">veggies es bonus vobis, proinde vos postulo essum magis kohlrabi welsh onion daikon amaranth tatsoi tomatillo melon azuki bean garlic.
<string> - CSS: Cascading Style Sheets
WebCSSstring
the <string> css data type represents a sequence of characters.
... syntax the <string> data type is composed of any number of unicode characters surrounded by either double (") or single (') quotes.
symbols() - CSS: Cascading Style Sheets
WebCSSsymbols
syntax symbols() = symbols( <symbols-type>?
... [ <string> | <image> ]+ ); <symbols-type> can be one of the following: cyclic: the system cycles through the given values in the order of their definition, and returns to the start when it reaches the end.
text-combine-upright - CSS: Cascading Style Sheets
all attempts to typeset all consecutive characters within the box horizontally, such that they take up the space of a single character within the vertical line of the box.
... formal definition initial valuenoneapplies tonon-replaced inline elementsinheritedyescomputed valuespecified keyword, plus integer if 'digits'animation typediscrete formal syntax none | all | [ digits <integer>?
text-transform - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | capitalize | uppercase | lowercase | full-width | full-size-kana examples none <p>initial string <strong>lorem ipsum dolor sit amet, consectetur adipisicing elit, ...</strong> </p> <p>text-transform: none <strong><span>lorem ipsum dolor sit amet, consectetur adipisicing elit, ...</span></strong> </p> span { text-transform: none; } strong { float: right; }...
... full-size-kana <p>ァィゥェ ォヵㇰヶ ㇱㇲッㇳ ㇴㇵㇶㇷ ㇸㇹㇺャ ュョㇻㇼ ㇽㇾㇿヮ</p> <p>ァィゥェ ォヵㇰヶ ㇱㇲッㇳ ㇴㇵㇶㇷ ㇸㇹㇺャ ュョㇻㇼ ㇽㇾㇿヮ</p> </p> p:nth-of-type(2) { text-transform: full-size-kana; } specifications specification status comment css text module level 3the definition of 'text-transform' in that specification.
<time> - CSS: Cascading Style Sheets
WebCSStime
the <time> css data type represents a time value expressed in seconds or milliseconds.
... syntax the <time> data type consists of a​ ​​​​​​<number> followed by one of the units listed below.
scale() - CSS: Cascading Style Sheets
its result is a <transform-function> data type.
... cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 sx0 0sy sx000sy0001 sx000sy0001 sx0000sy0000100001 [sx 0 0 sy 0 0] accessibility concerns scaling/zooming animations are problematic for accessibility, as they are a common trigger for certain types of migraine.
transform-style - CSS: Cascading Style Sheets
formal definition initial valueflatapplies totransformable elementsinheritednocomputed valueas specifiedanimation typediscretecreates stacking contextyes formal syntax flat | preserve-3d examples transform style demonstration in this example we have a 3d cube created using transforms.
... html <section id="example-element"> <div class="face front">1</div> <div class="face back">2</div> <div class="face right">3</div> <div class="face left">4</div> <div class="face top">5</div> <div class="face bottom">6</div> </section> <div class="checkbox"> <label for="preserve"><code>preserve-3d</code></label> <input type="checkbox" id="preserve" checked> </div> css #example-element { margin: 50px; width: 100px; height: 100px; transform-style: preserve-3d; transform: rotate3d(1, 1, 1, 30deg); } .face { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; position: absolute; backface-visibility: inherit; font-size: 60px; color: #fff; } .front { ...
transform - CSS: Cascading Style Sheets
WebCSStransform
accessibility concerns scaling/zooming animations are problematic for accessibility, as they are a common trigger for certain types of migraine.
... find out more: mdn understanding wcag, guideline 2.3 explanations understanding success criterion 2.3.3 | w3c understanding wcag 2.1 formal definition initial valuenoneapplies totransformable elementsinheritednopercentagesrefer to the size of bounding boxcomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typea transformcreates stacking contextyes formal syntax none | <transform-list>where <transform-list> = <transform-function>+where <transform-function> = <matrix()> | <translate()> | <translatex()> | <translatey()> | <scale()> | <scalex()> | <scaley()> | <rotate()> | <skew()> | <skewx()> | <skewy()> | <matrix3d()> | <translate3d()> | <translatez()> | <scale3d()> | <scalez()> | <rotate3d()> | <rotat...
translate - CSS: Cascading Style Sheets
WebCSStranslate
formal definition initial valuenoneapplies totransformable elementsinheritednopercentagesrefer to the size of bounding boxcomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typea transformcreates stacking contextyes formal syntax none | <length-percentage> [ <length-percentage> <length>?
... initial valuenoneapplies totransformable elementsinheritednopercentagesrefer to the size of bounding boxcomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typea transformcreates stacking contextyes ...
unicode-bidi - CSS: Cascading Style Sheets
note: this property is intended for document type definition (dtd) designers.
... formal definition initial valuenormalapplies toall elements, though some values have no effect on non-inline elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax normal | embed | isolate | bidi-override | isolate-override | plaintext examples css .bible-quote { direction: rtl; unicode-bidi: embed; } html <div class="bible-quote"> a line of text </div> <div> another line of text </div> result specifications specification status comment css writing modes module level 3the definition of ...
vertical-align - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the line-height of the element itselfcomputed valuefor percentage and length values, the absolute length, otherwise the keyword as specifiedanimation typea length formal syntax baseline | sub | super | text-top | text-bottom | middle | top | bottom | <percentage> | <length> examples basic example html <div>an <img src="https://udn.realityripple.com/samples/b4/e1f0faff5b.svg" alt="link" width="32" height="32" /> image with a default alignment.</div> <div>an <img class="top" src="https://udn.realityripple.com/samples/b4/e1f0faff5b.svg" alt="lin...
... recommendation adds the <length> value and allows it to be applied to elements with a display type of table-cell.
widows - CSS: Cascading Style Sheets
WebCSSwidows
formal definition initial value2applies toblock container elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax <integer> examples controlling column widows html <div> <p>this is the first paragraph containing some text.</p> <p>this is the second paragraph containing some more text than the first one.
... candidate recommendation extends widows to apply to any type of fragment, including pages, regions, or columns.
Ajax - Developer guides
WebGuideAJAX
sending and receiving binary data the responsetype property of the xmlhttprequest object can be set to change the expected response type from the server.
...the response property will contain the entity body according to responsetype, as an arraybuffer, blob, document, json, or string.
Media buffering, seeking, and time ranges - Developer guides
t would have the following available properties: myaudio.buffered.length; // returns 2 myaudio.buffered.start(0); // returns 0 myaudio.buffered.end(0); // returns 5 myaudio.buffered.start(1); // returns 15 myaudio.buffered.end(1); // returns 19 to try out and visualize buffered time ranges we can write a little bit of html: <p> <audio id="my-audio" controls> <source src="music.mp3" type="audio/mpeg"> </audio> </p> <p> <canvas id="my-canvas" width="300" height="20"> </canvas> </p> and a little bit of javascript: window.onload = function(){ var myaudio = document.getelementbyid('my-audio'); var mycanvas = document.getelementbyid('my-canvas'); var context = mycanvas.getcontext('2d'); context.fillstyle = 'lightgray'; context.fillrect(0, 0, mycanvas.wi...
...the html for our player looks like this: <audio id="my-audio" preload controls> <source src="music.mp3" type="audio/mpeg"> </audio> <div class="buffered"> <span id="buffered-amount"></span> </div> <div class="progress"> <span id="progress-amount"></span> </div> we'll use the following css to style the buffering display: .buffered { height: 20px; position: relative; background: #555; width: 300px; } #buffered-amount { display: block; height: 100%; background-color: #777; width: 0;...
Content categories - Developer guides
there are three types of content categories: main content categories, which describe common rules shared by many elements.
... some elements belong to this category only under specific conditions: <audio>, if the controls attribute is present <img>, if the usemap attribute is present <input>, if the type attribute is not in the hidden state <menu>, if the type attribute is in the toolbar state <object>, if the usemap attribute is present <video>, if the controls attribute is present palpable content content is palpable when it's neither empty or hidden; it is content that is rendered and is substantive.
Printing - Developer guides
open and automatically close a popup window when finished if you want to be able to automatically close a popup window (for example, the printer-friendly version of a document) after the user prints its contents, you can use code like this: <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>javascript window close example </title> <script type="text/javascript"> function popuponclick() { my_window = window.open('', 'mywindow', 'status=1,width=350,height=150'); my_window.document.write('<html><head><title>print me</title></head>'); my_window.document.write('<body...
...the following is a possible example which will print a file named externalpage.html: <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>mdn example</title> <script type="text/javascript"> function closeprint () { document.body.removechild(this.__container__); } function setprint () { this.contentwindow.__container__ = this; this.contentwindow.onbeforeunload = closeprint; this.contentwindow.onafterprint = closeprint; this.co...
The Unicode Bidirectional Text Algorithm - Developer guides
fundamentals (base direction, character types, etc) the algorithm character level directionality directional runs (what they are, how base direction applies) handling neutral characters overriding the algorithm content about using html and css to override the default behavior of the algorithm; include info about isolating ranges etc.
...base direction to ltr, isolating the embedded content from the surrounding text right-to-left isolate (lri) u+2067 &#x2067; dir="rtl" sets the base direction to rtl, isolating the embedded content from the surrounding text first strong isolate (fsi) u+2068 &#x2068; dir="auto" isolates the content and sets the base direction according to the first strongly-typed directional character in the embedded content left-to-right embedding (lre) u+202a &#x202a; dir="ltr" sets the base direction to ltr but allows the embedded text to interact with the surrounding content; this risks the effect spilling over to the outer content right-to-left embedding (rle) u+202b &#x202b; dir="rtl" sets the base direction to rtl, but let...
Developer guides
events developer guide events refer to two things: a design pattern used for the asynchronous handling of various incidents which occur in the lifetime of a web page; and the naming, characterization, and use of a large number of incidents of different types.
...the transmission is in the same format that the form's submit() method would use to send the data if the form's encoding type were set to "multipart/form-data".
disabled - HTML: Hypertext Markup Language
<fieldset> <legend>checkboxes</legend> <p><label> <input type="checkbox" name="chbox" value="regular"> regular </label></p> <p><label> <input type="checkbox" name="chbox" value="disabled" disabled> disabled </label></p> </fieldset> <fieldset> <legend>radio buttons</legend> <p><label> <input type="radio" name="radio" value="regular"> regular </label></p> <p><label> <input type="radio" name="radio" value="disabled" disabled> disable...
... <option>option 2.1</option> <option disabled>option 2.2</option> <option>option 2.3</option> </optgroup> <optgroup label="group 3" disabled> <option>disabled 3.1</option> <option>disabled 3.2</option> <option>disabled 3.3</option> </optgroup> </select> </label> </p> <fieldset disabled> <legend>disabled fieldset</legend> <p> <label>name: <input type="name" name="radio" value="regular"> regular </label> </p> <p> <label>number: <input type="number"></label> </p> </fieldset> specifications specification status comment html living standardthe definition of 'disabled attribute' in that specification.
<area> - HTML: Hypertext Markup Language
WebHTMLElementarea
the value is a space-separated list of link types values.
... type no effect.
<embed>: The Embed External Content element - HTML: Hypertext Markup Language
WebHTMLElementembed
type the mime type to use to select the plug-in to instantiate.
... examples <embed type="video/quicktime" src="movie.mov" width="640" height="480" title="title of my video"> accessibility concerns use the title attribute on an embed element to label its content so that people navigating with assistive technology such as a screen reader can understand what it contains.
<fieldset>: The Field Set element - HTML: Hypertext Markup Language
WebHTMLElementfieldset
<form action="#"> <fieldset> <legend>simple fieldset</legend> <input type="radio" id="radio"> <label for="radio">spirit of radio</label> </fieldset> </form> disabled fieldset this example shows a disabled <fieldset> with two controls inside it.
... <form action="#"> <fieldset disabled> <legend>disabled fieldset</legend> <div> <label for="name">name: </label> <input type="text" id="name" value="chris"> </div> <div> <label for="pwd">archetype: </label> <input type="password" id="pwd" value="wookie"> </div> </fieldset> </form> technical summary content categories flow content, sectioning root, listed, form-associated element, palpable content.
<isindex> - HTML: Hypertext Markup Language
WebHTMLElementisindex
<input name="isindex"> </label> <hr> </form> history on june 1992, dan connolly would prefer a different anchor type instead of isindex.
...in this thread, different type of solutions are proposed.
<noembed>: The Embed Fallback element (Obsolete) - HTML: Hypertext Markup Language
WebHTMLElementnoembed
the <noembed> element is an obsolete, non-standard way to provide alternative, or "fallback", content for browsers that do not support the <embed> element or do not support the type of embedded content an author wishes to use.
... show an alternative content <embed type="vide/webm" src="/media/examples/flower.mp4" width="200" height="200"> <noembed> <h1>alternative content</h1> </noembed> </embed> ...
<strong>: The Strong Importance element - HTML: Hypertext Markup Language
WebHTMLElementstrong
browsers typically render the contents in bold type.
...each element is meant to be used in certain types of scenarios, and if you want to bold text simply for decoration, you should instead actually use the css font-weight property.
<textarea> - HTML: Hypertext Markup Language
WebHTMLElementtextarea
note: placeholders should only be used to show an example of the type of data that should be entered into a form; they are not a substitute for a proper <label> element tied to the input.
... <textarea name="textarea" rows="5" cols="30" placeholder="comment text."></textarea> note: placeholders should only be used to show an example of the type of data that should be entered into a form; they are not a substitute for a proper <label> element tied to the input.
<track>: The Embed Text Track element - HTML: Hypertext Markup Language
WebHTMLElementtrack
usage notes track data types the type of data that track adds to the media is set in the kind attribute, which can take values of subtitles, captions, descriptions, chapters or metadata.
...); texttrackelem.addeventlistener("cuechange", (event) => { let cues = event.target.track.activecues; }); in addition, you can use the oncuechange event handler: let texttrackelem = document.getelementbyid("texttrack"); texttrackelem.oncuechange = (event) => { let cues = event.target.track.activecues; }); examples <video controls poster="/images/sample.gif"> <source src="sample.mp4" type="video/mp4"> <source src="sample.ogv" type="video/ogv"> <track kind="captions" src="samplecaptions.vtt" srclang="en"> <track kind="descriptions" src="sampledescriptions.vtt" srclang="en"> <track kind="chapters" src="samplechapters.vtt" srclang="en"> <track kind="subtitles" src="samplesubtitles_de.vtt" srclang="de"> <track kind="subtitles" src="samplesubtitles_en.vtt" srclan...
contextmenu - HTML: Hypertext Markup Language
example html <body contextmenu="share"> <menu type="context" id="share"> <menu label="share"> <menuitem label="twitter" onclick="shareviatwitter()"></menuitem> <menuitem label="facebook" onclick="shareviafacebook()"></menuitem> </menu> </menu> <ol> <li> anywhere in the example you can share the page on twitter and facebook using the share menu from your context menu.
... </li> <li contextmenu="changefont" id="fontsizing"> on this specific list element, you can change the size of the text by using the "increase/decrease font" actions from your context menu </li> <menu type="context" id="changefont"> <menuitem label="increase font" onclick="incfont()"></menuitem> <menuitem label="decrease font" onclick="decfont()"></menuitem> </menu> <li contextmenu="changeimage" id="changeimage"> on the image below, you can fire the "change image" action in your context menu.<br /> <img src="https://udn.realityripple.com/samples/a2/b601bdfc0c.png" contextmenu="changeimage" id="promobutton" /> <menu type="context" id="changeimage"> <menuitem label="change image" onclick="changeimage()"></m...
Identifying resources on the Web - HTTP
https://developer.mozilla.org https://developer.mozilla.org/docs/learn/ https://developer.mozilla.org/search?q=url any of those urls can be typed into your browser's address bar to tell it to load the associated page (resource).
... ftp is still acceptable at the top level (such as typed directly into the browser's url bar, or the target of a link), although some browsers may delegate loading ftp content to another application.
Basics of HTTP - HTTP
mime types since http/1.0, different types of content can be transmitted.
... this article explains how this is accomplished using the content-type header and the mime standard.
Compression in HTTP - HTTP
file format compression each data type has some redundancy, that is wasted space, in it.
...unlike text, these other media types use lot of space to store their data and the need to optimize storage and regain space was apparent very early.
List of default Accept values - HTTP
note that all browsers add the */* mime type to cover all cases.
... edge text/html, application/xhtml+xml, image/jxr, */* opera text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1 values for an image when requesting an image, like through an html <img> element, user-agent often sets a specific list of media types to be welcomed.
Using HTTP cookies - HTTP
WebHTTPCookies
a simple cookie is set like this: set-cookie: <cookie-name>=<cookie-value> this shows the server sending headers to tell the client to store a pair of cookies: http/2.0 200 ok content-type: text/html set-cookie: yummy_cookie=choco set-cookie: tasty_cookie=strawberry [page content] then, with every subsequent request to the server, the browser sends back all previously stored cookies to the server using the cookie header.
...see for example the types of cookies used by google.
Access-Control-Expose-Headers - HTTP
by default, only the 7 cors-safelisted response headers are exposed: cache-control content-language content-length content-type expires last-modified pragma if you want clients to be able to access other headers, you have to list them using the access-control-expose-headers header.
... header type response header forbidden header name no syntax access-control-expose-headers: <header-name>, <header-name>, ...
Access-Control-Request-Headers - HTTP
header type request header forbidden header name yes syntax access-control-request-headers: <header-name>, <header-name>, ...
... examples access-control-request-headers: x-pingother, content-type specifications specification status comment fetchthe definition of 'access-control-request-headers' in that specification.
Cache-Control - HTTP
header type general header forbidden header name no cors-safelisted response header yes syntax caching directives have the following rules to be valid: case-insensitive, but lowercase is recommended.
... other no-transform an intermediate cache or proxy cannot edit the response body, content-encoding, content-range, or content-type.
Content-Language - HTTP
multiple language tags are also possible, as well as applying the content-language header to various media types and not only to textual documents.
... header type entity header forbidden header name no cors-safelisted response header yes cors-safelisted request header yes, with the additional restriction that values can only be 0-9, a-z, a-z, space or *,-.;=.
CSP: base-uri - HTTP
csp version 2 directive type document directive default-src fallback no.
...sites needing to allow these content types can specify them using the data attribute.
CSP: child-src - HTTP
csp version 2 directive type fetch directive default-src fallback yes.
...sites needing to allow these content types can specify them using the data attribute.
CSP: connect-src - HTTP
note: connect-src 'self' does not resolve to websocket schemas in all browsers, more info: https://github.com/w3c/webappsec-csp/issues/7 csp version 1 directive type fetch directive default-src fallback yes.
...sites needing to allow these content types can specify them using the data attribute.
CSP: default-src - HTTP
for each of the following directives that are absent, the user agent looks for the default-src directive and uses this value for it: child-src connect-src font-src frame-src img-src manifest-src media-src object-src prefetch-src script-src script-src-elem script-src-attr style-src style-src-elem style-src-attr worker-src csp version 1 directive type fetch directive syntax one or more sources can be allowed for the default-src policy: content-security-policy: default-src <source>; content-security-policy: default-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number.
...sites needing to allow these content types can specify them using the data attribute.
CSP: font-src - HTTP
csp version 1 directive type fetch directive default-src fallback yes.
...sites needing to allow these content types can specify them using the data attribute.
CSP: frame-ancestors - HTTP
csp version 2 directive type navigation directive default-src fallback no.
...sites needing to allow these content types can specify them using the data attribute.
CSP: frame-src - HTTP
csp version 1 directive type fetch directive fallback if this directive is absent, the user agent will look for the child-src directive (which falls back to the default-src directive).
...sites needing to allow these content types can specify them using the data attribute.
CSP: img-src - HTTP
csp version 1 directive type fetch directive default-src fallback yes.
...sites needing to allow these content types can specify them using the data attribute.
CSP: manifest-src - HTTP
csp version 3 directive type fetch directive default-src fallback yes.
...sites needing to allow these content types can specify them using the data attribute.
CSP: media-src - HTTP
csp version 1 directive type fetch directive default-src fallback yes.
...sites needing to allow these content types can specify them using the data attribute.
CSP: prefetch-src - HTTP
csp version 3 directive type fetch directive default-src fallback yes.
...sites needing to allow these content types can specify them using the data attribute.
CSP: report-uri - HTTP
csp version 1 directive type reporting directive this directive is not supported in the <meta> element.
... $log_file; mail($email_address, $email_subject, $message, 'content-type: text/plain;charset=utf-8'); } else if (filesize($log_file) > $log_file_size_limit) { exit(0); } file_put_contents($log_file, $json_data, file_append | lock_ex); } specifications specification status comment content security policy level 3the definition of 'report-uri' in that specification.
CSP: script-src-attr - HTTP
csp version 3 directive type fetch directive default-src fallback yes.
...sites needing to allow these content types can specify them using the data attribute.
CSP: script-src-elem - HTTP
csp version 3 directive type fetch directive default-src fallback yes.
...sites needing to allow these content types can specify them using the data attribute.
CSP: script-src - HTTP
csp version 1 directive type fetch directive default-src fallback yes.
...sites needing to allow these content types can specify them using the data attribute.
CSP: style-src-attr - HTTP
csp version 3 directive type fetch directive default-src fallback yes.
...sites needing to allow these content types can specify them using the data attribute.
CSP: style-src-elem - HTTP
csp version 3 directive type fetch directive default-src fallback yes.
...sites needing to allow these content types can specify them using the data attribute.
CSP: worker-src - HTTP
csp version 3 directive type fetch directive fallback if this directive is absent, the user agent will first look for the child-src directive, then the script-src directive, then finally for the default-src directive, when governing worker execution.
...sites needing to allow these content types can specify them using the data attribute.
Content-Security-Policy-Report-Only - HTTP
header type response header forbidden header name no this header is not supported inside a <meta> element.
... content-security-policy-report-only: default-src 'none'; style-src cdn.example.com; report-uri /_/csp-reports the html of signup.html looks like this: <!doctype html> <html> <head> <title>sign up</title> <link rel="stylesheet" href="css/style.css"> </head> <body> ...
Digest - HTTP
WebHTTPHeadersDigest
the selected representation depends on the content-type and content-encoding header values: so a single resource may have multiple different digest values.
... header type response header forbidden header name no syntax digest: <digest-algorithm>=<digest-value> digest: <digest-algorithm>=<digest-value>,<digest-algorithm>=<digest-value> directives <digest-algorithm> supported digest algorithms are defined in rfc 3230 and rfc 5843, and include sha-256 and sha-512.
Expect-CT - HTTP
ct requirements can be satisfied via any one of the following mechanisms: x.509v3 certificate extension to allow embedding of signed certificate timestamps issued by individual logs a tls extension of type signed_certificate_timestamp sent during the handshake supporting ocsp stapling (that is, the status_request tls extension) and providing a signedcertificatetimestamplist when a site enables the expect-ct header, they are requesting that the browser check that any certificate for that site appears in public ct logs.
... header type response header forbidden header name yes syntax expect-ct: report-uri="<uri>", enforce, max-age=<age> directives max-age the number of seconds after reception of the expect-ct header field during which the user agent should regard the host of the received message as a known expect-ct host.
Expect - HTTP
WebHTTPHeadersExpect
header type request header forbidden header name yes syntax no other expectations except "100-continue" are specified currently.
... put /somewhere/fun http/1.1 host: origin.example.com content-type: video/h264 content-length: 1234567890987 expect: 100-continue the server now checks the request headers and may respond with a 100 (continue) response to instruct the client to go ahead and send the message body, or it will send a 417 (expectation failed) status if any of the expectations cannot be met.
Feature-Policy - HTTP
header type response header forbidden header name yes syntax feature-policy: <directive> <allowlist> <directive> the feature policy directive to apply the allowlist to.
...when this policy is disabled, the returned promise rejects with a typeerror.
Keep-Alive - HTTP
header type general header forbidden header name yes syntax keep-alive: parameters directives parameters a comma-separated list of parameters, each consisting of an identifier and a value separated by the equal sign ('=').
... examples a response containing a keep-alive header: http/1.1 200 ok connection: keep-alive content-encoding: gzip content-type: text/html; charset=utf-8 date: thu, 11 aug 2016 15:23:13 gmt keep-alive: timeout=5, max=1000 last-modified: mon, 25 jul 2016 04:32:39 gmt server: apache (body) specifications specification title http keep-alive header keep-alive header (ietf internet draft) rfc 7230, appendix a.1.2: keep-alive hypertext transfer protocol (http/1.1): message syntax and r...
Proxy-Authenticate - HTTP
header type response header forbidden header name no syntax proxy-authenticate: <type> realm=<realm> directives <type> authentication type.
... a common type is "basic".
Proxy-Authorization - HTTP
header type request header forbidden header name no syntax proxy-authorization: <type> <credentials> directives <type> authentication type.
... a common type is "basic".
Strict-Transport-Security - HTTP
header type response header forbidden header name no syntax strict-transport-security: max-age=<expire-time> strict-transport-security: max-age=<expire-time>; includesubdomains strict-transport-security: max-age=<expire-time>; preload directives max-age=<expire-time> the time, in seconds, that the browser should remember that a site is only to be accessed using https.
... description if a website accepts a connection through http and redirects to https, visitors may initially communicate with the non-encrypted version of the site before being redirected, if, for example, the visitor types http://www.foo.com/ or even just foo.com.
Transfer-Encoding - HTTP
header type response header forbidden header name yes syntax transfer-encoding: chunked transfer-encoding: compress transfer-encoding: deflate transfer-encoding: gzip transfer-encoding: identity // several values can be listed, separated by a comma transfer-encoding: gzip, chunked directives chunked data is sent in a series of chunks.
...a chunked response looks like this: http/1.1 200 ok content-type: text/plain transfer-encoding: chunked 7\r\n mozilla\r\n 9\r\n developer\r\n 7\r\n network\r\n 0\r\n \r\n specifications specification title rfc 7230, section 3.3.1: transfer-encoding hypertext transfer protocol (http/1.1): message syntax and routing ...
Upgrade - HTTP
WebHTTPHeadersUpgrade
header type request header, response header forbidden header name yes overview the upgrade header field may be used by clients to invite a server to switch to one (or more) of the listed protocols, in descending preference order.
... syntax connection: upgrade upgrade: protocol_name[/protocol_version] notes: the connection header with type upgrade must always be sent with the upgrade header (as shown above).
WWW-Authenticate - HTTP
header type response header forbidden header name no syntax www-authenticate: <type> realm=<realm>[, charset="utf-8"] directives <type> authentication type.
... a common type is "basic".
Warning - HTTP
WebHTTPHeadersWarning
header type general header forbidden header name no syntax warning: <warn-code> <warn-agent> <warn-text> [<warn-date>] directives <warn-code> a three-digit warning number.
... 199 miscellaneous warning arbitrary, non-specific warning 214 transformation applied added by a proxy if it applies any transformation to the representation, such as changing the content-coding, media-type or the like.
X-DNS-Prefetch-Control - HTTP
header type response header forbidden header name no syntax x-dns-prefetch-control: on x-dns-prefetch-control: off directives on enables dns prefetching.
... forcing lookup of specific hostnames you can force the lookup of specific hostnames without providing specific anchors using that hostname by using the rel attribute on the <link> element with a link type of dns-prefetch: <link rel="dns-prefetch" href="https://www.mozilla.org/contribute/"> in this example, the domain name "www.mozilla.org/contribute" will be pre-resolved.
Proxy servers and tunneling - HTTP
there are two types of proxies: forward proxies (or tunnel, or gateway) and reverse proxies (used to control and protect access to a server for load-balancing, authentication, decryption or caching).
...the javascript function contained in the pac file defines the function: the auto-config file should be saved to a file with a .pac filename extension: proxy.pac and the mime type set to: application/x-ns-proxy-autoconfig the file consists of a function called findproxyforurl.
Redirections in HTTP - HTTP
there are several types of redirects, sorted into three categories: permanent redirections temporary redirections special redirections permanent redirections these redirections are meant to last forever.
... obviously, this method only works with html, and cannot be used for images or other types of content.
Unicode property escapes - JavaScript
see also regexp.prototype.unicode.
...if a unicodepropertyname is specified, the value must correspond to the property type given.
JavaScript Guide - JavaScript
chapters this guide is divided into several chapters: introduction about this guide about javascript javascript and java ecmascript tools hello world grammar and types basic syntax & comments declarations variable scope variable hoisting data structures and types literals control flow and error handling if...else switch try/catch/throw error objects loops and iteration for while do...while break/continue for..in for..of functions defining functions calling functions function scope closures arguments & para...
... functions expressions and operators assignment & comparisons arithmetic operators bitwise & logical operators conditional (ternary) operator numbers and dates number literals number object math object date object text formatting string literals string object template literals internationalization regular expressions indexed collections arrays typed arrays keyed collections map weakmap set weakset working with objects objects and properties creating objects defining methods getter and setter details of the object model prototype-based oop creating object hierarchies inheritance promises guarantees chaining error propagation composition timing iterators and generators iterators...
JavaScript technologies overview - JavaScript
among other things, ecmascript defines: language syntax (parsing rules, keywords, control flow, object literal initialization, ...) error handling mechanisms (throw, try...catch, ability to create user-defined error types) types (boolean, number, string, function, object, ...) the global object.
... a prototype-based inheritance mechanism built-in objects and functions (json, math, array.prototype methods, object introspection methods, etc.) strict mode browser support as of october 2016, the current versions of the major web browsers implement ecmascript 5.1 and ecmascript 2015, but older versions (still in use) implement ecmascript 5 only.
Private class fields - JavaScript
class baseclasswithprivatestaticfield { static #private_static_field static basepublicstaticmethod() { this.#private_static_field = 42 return this.#private_static_field } } class subclass extends baseclasswithprivatestaticfield { } let error = null try { subclass.basepublicstaticmethod() } catch(e) { error = e} console.assert(error instanceof typeerror) private instance fields private instance fields are declared with # names (pronounced "hash names"), which are identifiers prefixed with #.
...on" as mentioned above: class base { static #privatestaticmethod() { return 42; } static publicstaticmethod1() { return base.#privatestaticmethod(); } static publicstaticmethod2() { return this.#privatestaticmethod(); } } class derived extends base {} console.log(derived.publicstaticmethod1()); // 42 console.log(derived.publicstaticmethod2()); // typeerror private instance methods private instance methods are methods available on class instances whose access is restricted in the same manner as private instance fields.
constructor - JavaScript
this.name = 'square'; } get area() { return this.height * this.width; } set area(value) { this.height = value**0.5; this.width = value**0.5; } } another example here the prototype of square class is changed—but the constructor of its base class polygon is still called when a new instance of a square is created.
... class polygon { constructor() { this.name = "polygon"; } } class square extends polygon { constructor() { super(); } } class rectangle {} object.setprototypeof(square.prototype, rectangle.prototype); console.log(object.getprototypeof(square.prototype) === polygon.prototype); //false console.log(object.getprototypeof(square.prototype) === rectangle.prototype); //true let newinstance = new square(); console.log(newinstance.name); //polygon specifications specification ecmascript (ecma-262)the definition of 'constructor method' in that specification.
ReferenceError: deprecated caller or arguments usage - JavaScript
message typeerror: 'arguments', 'callee' and 'caller' are restricted function properties and cannot be accessed in this context (edge) warning: referenceerror: deprecated caller usage (firefox) warning: referenceerror: deprecated arguments usage (firefox) typeerror: 'callee' and 'caller' cannot be accessed in strict mode.
... (safari) error type a strict-mode-only warning that a referenceerror occurred.
SyntaxError: illegal character - JavaScript
message syntaxerror: invalid character (edge) syntaxerror: illegal character (firefox) syntaxerror: invalid or unexpected token (chrome) error type syntaxerror what went wrong?
...when something like this happens to your code and you're not able to find the source of the problem, it's often best to just delete the problematic line and retype it.
ReferenceError: "x" is not defined - JavaScript
message referenceerror: "x" is not defined error type referenceerror.
...it needs to be some string, so that the string.prototype.substring() method will work.
Error: Permission denied to access property "x" - JavaScript
message error: permission denied to access property "x" error type error.
... examples no permission to access document <!doctype html> <html> <head> <iframe id="myframe" src="http://www1.w3c-test.org/common/blank.html"></iframe> <script> onload = function() { console.log(frames[0].document); // error: permission denied to access property "document" } </script> </head> <body></body> </html> ...
ReferenceError: reference to undefined property "x" - JavaScript
message referenceerror: reference to undefined property "x" (firefox) error type (firefox only) referenceerror warning which is reported only if javascript.options.strict preference is set to true.
... var foo = {}; foo.bar; // referenceerror: reference to undefined property "bar" valid cases to avoid the error, you need to either add a definition for bar to the object or check for the existence of the bar property before trying to access it; one way to do that is to use the object.prototype.hasownproperty() method), like this: var foo = {}; // define the bar property foo.bar = 'moon'; console.log(foo.bar); // "moon" // test to be sure bar exists before accessing it if (foo.hasownproperty('bar')) { console.log(foo.bar); } ...
Default parameters - JavaScript
to guard against this, something like the second line would be used, where b is set to 1 if multiply is called with only one argument: function multiply(a, b) { b = (typeof b !== 'undefined') ?
... function test(num = 1) { console.log(typeof num) } test() // 'number' (num is set to 1) test(undefined) // 'number' (num is set to 1 too) // test with other falsy values: test('') // 'string' (num is set to '') test(null) // 'object' (num is set to null) evaluated at call time the default argument is evaluated at call time.
Method definitions - JavaScript
they will throw a typeerror if you try to instantiate them.
... const obja = { method() {} } new obja.method // typeerror: obj.method is not a constructor const objb = { * g() {} } new objb.g // typeerror: obj.g is not a constructor (changed in es2016) examples simple test case const obj = { a: 'foo', b() { return this.a } }; console.log(obj.b()) // "foo" computed property names the shorthand syntax also supports computed property names.
Rest parameters - JavaScript
from arguments to an array rest parameters have been introduced to reduce the boilerplate code that was induced by the arguments // before rest parameters, "arguments" could be converted to a normal array using: function f(a, b) { let normalarray = array.prototype.slice.call(arguments) // -- or -- let normalarray = [].slice.call(arguments) // -- or -- let normalarray = array.from(arguments) let first = normalarray.shift() // ok, gives the first argument let first = arguments.shift() // error (arguments is not a normal array) } // now, you can easily gain access to a normal array using a rest parameter function f(...args) { let normalar...
... object array methods can be used on rest parameters, but not on the arguments object: function sortrestargs(...theargs) { let sortedargs = theargs.sort() return sortedargs } console.log(sortrestargs(5, 3, 7, 1)) // 1, 3, 5, 7 function sortarguments() { let sortedargs = arguments.sort() return sortedargs // this will never happen } console.log(sortarguments(5, 3, 7, 1)) // throws a typeerror (arguments.sort is not a function) to use array methods on the arguments object, it must be converted to a real array first.
Functions - JavaScript
var result; result = padzeros(42,4); // returns "0042" result = padzeros(42,2); // returns "42" result = padzeros(5,4); // returns "0005" determining whether a function exists you can determine whether a function exists by using the typeof operator.
... if ('function' === typeof window.nofunc) { // use nofunc() } else { // do something else } note that in the if test, a reference to nofunc is used—there are no brackets "()" after the function name so the actual function is not called.
AggregateError - JavaScript
instance properties aggregateerror.prototype.message error message, defaults to "".
... aggregateerror.prototype.name error name, defaults to aggregateerror.
Array.of() - JavaScript
the array.of() method creates a new array instance from a variable number of arguments, regardless of number or type of the arguments.
... if (!array.of) { array.of = function() { return array.prototype.slice.call(arguments); // or let vals = []; for(let prop in arguments){ vals.push(arguments[prop]); } return vals; } } examples using array.of array.of(1); // [1] array.of(1, 2, 3); // [1, 2, 3] array.of(undefined); // [undefined] specifications specification ecmascript (ecma-262)the definition of 'array.of' in that specificat...
ArrayBuffer() constructor - JavaScript
calling an arraybuffer constructor as a function without new, will throw a typeerror from now on.
... var dv = arraybuffer(10); // typeerror: calling a builtin arraybuffer constructor // without new is forbidden var dv = new arraybuffer(10); examples creating an arraybuffer in this example, we create a 8-byte buffer with a int32array view referring to the buffer: var buffer = new arraybuffer(8); var view = new int32array(buffer); specifications specification ecmascript (ecma-262)the definition of 'arraybuffer' in that specification.
AsyncFunction - JavaScript
it can be obtained with the following code: object.getprototypeof(async function(){}).constructor syntax new asyncfunction([arg1[, arg2[, ...argn]],] functionbody) parameters arg1, arg2, ...
... examples creating an async function from an asyncfunction() constructor function resolveafter2seconds(x) { return new promise(resolve => { settimeout(() => { resolve(x); }, 2000); }); } let asyncfunction = object.getprototypeof(async function(){}).constructor let a = new asyncfunction('a', 'b', 'return await resolveafter2seconds(a) + await resolveafter2seconds(b);'); a(10, 20).then(v => { console.log(v); // prints 30 after 4 seconds }); specifications specification ecmascript (ecma-262)the definition of 'asyncfunction object' in that spec...
FinalizationRegistry - JavaScript
instance methods finalizationregistry.prototype.register() registers an object with the registry in order to get a cleanup callback when/if the object is garbage-collected.
... finalizationregistry.prototype.unregister() unregisters an object from the registry.
GeneratorFunction - JavaScript
object.getprototypeof(function*(){}).constructor syntax new generatorfunction ([arg1[, arg2[, ...argn]],] functionbody) parameters arg1, arg2, ...
... examples creating a generator function from a generatorfunction() constructor var generatorfunction = object.getprototypeof(function*(){}).constructor var g = new generatorfunction('a', 'yield a * 2'); var iterator = g(10); console.log(iterator.next().value); // 20 specifications specification ecmascript (ecma-262)the definition of 'generatorfunction' in that specification.
Intl.Locale() constructor - JavaScript
examples basic usage at its very simplest, the intl.locale constructor takes a locale identifier string as its argument: let us = new intl.locale('en-us'); using the locale constructor with an options object the constructor also takes an optional configuration object argument, which can contain any of several extension types.
... for example, set the hourcycle property of the configuration object to your desired hour cycle type, and then pass it into the constructor: let us12hour = new intl.locale("en-us", {hourcycle: "h12"}); console.log(us12hour.hourcycle); // prints "h12" specifications specification ecmascript internationalization api (ecma-402) ...
Intl.PluralRules - JavaScript
instance methods intl.pluralrules.prototype.resolvedoptions() returns a new object with properties reflecting the locale and collation options computed during initialization of the object.
... intl.pluralrules.prototype.select() returns a string indicating which plural rule to use for locale-aware formatting.
JSON - JavaScript
the reviver option allows for interpreting what the replacer has used to stand in for other datatypes.
...by default, all instances of undefined are replaced with null, and other unsupported native data types are censored.
Number.isFinite() - JavaScript
this means only values of the type number, that are also finite, return true.
... polyfill if (number.isfinite === undefined) number.isfinite = function(value) { return typeof value === 'number' && isfinite(value); } examples using isfinite number.isfinite(infinity); // false number.isfinite(nan); // false number.isfinite(-infinity); // false number.isfinite(0); // true number.isfinite(2e64); // true number.isfinite('0'); // false, would've been true with // global isfinite('0') number.isfinite(null); // false, would've been true with // global isfinite(null) specifications specification ecmascript (ecma-262)the definition of 'number.isinteger' in that specification.
Object() constructor - JavaScript
otherwise, it will return an object of a type that corresponds to the given value.
... examples creating a new object let o = new object() o.foo = 42 console.log(o) // object { foo: 42 } using object given undefined and null types the following examples store an empty object object in o: let o = new object() let o = new object(undefined) let o = new object(null) specifications specification ecmascript (ecma-262)the definition of 'object constructor' in that specification.
Object.entries() - JavaScript
(the only important difference is that a for...in loop enumerates properties in the prototype chain as well).
... 'c'], ['100', 'a'] ] // getfoo is 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" }...
Object.isExtensible() - JavaScript
var frozen = object.freeze({}); object.isextensible(frozen); // === false non-object coercion in es5, if the argument to this method is not an object (a primitive), then it will cause a typeerror.
... object.isextensible(1); // typeerror: 1 is not an object (es5 code) object.isextensible(1); // false (es2015 code) specifications specification ecmascript (ecma-262)the definition of 'object.isextensible' in that specification.
Object.isFrozen() - JavaScript
object.issealed(frozen); // === true non-object coercion in es5, if the argument to this method is not an object (a primitive), then it will cause a typeerror.
... object.isfrozen(1); // typeerror: 1 is not an object (es5 code) object.isfrozen(1); // true (es2015 code) specifications specification ecmascript (ecma-262)the definition of 'object.isfrozen' in that specification.
Object.isSealed() - JavaScript
// === 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.
... object.issealed(1); // typeerror: 1 is not an object (es5 code) object.issealed(1); // true (es2015 code) specifications specification ecmascript (ecma-262)the definition of 'object.issealed' in that specification.
handler.get() - JavaScript
interceptions this trap can intercept these operations: property access: proxy[foo]and proxy.bar inherited property access: object.create(proxy)[foo] reflect.get() invariants if the following invariants are violated, the proxy will throw a typeerror: the value reported for a property must be the same as the value of the corresponding target object property if the target object property is a non-writable, non-configurable own data property.
... const obj = {}; object.defineproperty(obj, 'a', { configurable: false, enumerable: false, value: 10, writable: false }); const p = new proxy(obj, { get: function(target, property) { return 20; } }); p.a; // typeerror is thrown specifications specification ecmascript (ecma-262)the definition of '[[get]]' in that specification.
handler.getOwnPropertyDescriptor() - JavaScript
interceptions this trap can intercept these operations: object.getownpropertydescriptor() reflect.getownpropertydescriptor() invariants if the following invariants are violated, the proxy will throw a typeerror: getownpropertydescriptor() must return an object or undefined.
... const obj = { a: 10 }; object.preventextensions(obj); const p = new proxy(obj, { getownpropertydescriptor: function(target, prop) { return undefined; } }); object.getownpropertydescriptor(p, 'a'); // typeerror is thrown specifications specification ecmascript (ecma-262)the definition of '[[getownproperty]]' in that specification.
handler.has() - JavaScript
interceptions this trap can intercept these operations: property query: foo in proxy inherited property query: foo in object.create(proxy) with check: with(proxy) { (foo); } reflect.has() invariants if the following invariants are violated, the proxy will throw a typeerror: a property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object.
... const obj = { a: 10 }; object.preventextensions(obj); const p = new proxy(obj, { has: function(target, prop) { return false; } }); 'a' in p; // typeerror is thrown specifications specification ecmascript (ecma-262)the definition of '[[hasproperty]]' in that specification.
handler.isExtensible() - JavaScript
interceptions this trap can intercept these operations: object.isextensible() reflect.isextensible() invariants if the following invariants are violated, the proxy will throw a typeerror: object.isextensible(proxy) must return the same value as object.isextensible(target).
... const p = new proxy({}, { isextensible: function(target) { return false; } }); object.isextensible(p); // typeerror is thrown specifications specification ecmascript (ecma-262)the definition of '[[isextensible]]' in that specification.
handler.preventExtensions() - JavaScript
interceptions this trap can intercept these operations: object.preventextensions() reflect.preventextensions() invariants if the following invariants are violated, the proxy will throw a typeerror: object.preventextensions(proxy) only returns true if object.isextensible(proxy) is false.
... const p = new proxy({}, { preventextensions: function(target) { return true; } }); object.preventextensions(p); // typeerror is thrown specifications specification ecmascript (ecma-262)the definition of '[[preventextensions]]' in that specification.
Proxy() constructor - JavaScript
handler.getprototypeof() a trap for object.getprototypeof.
... handler.setprototypeof() a trap for object.setprototypeof.
Proxy.revocable() - JavaScript
if the revoke() function gets called, the proxy becomes unusable: any trap to a handler will throw a typeerror.
... examples using proxy.revocable var revocable = proxy.revocable({}, { get: function(target, name) { return "[[" + name + "]]"; } }); var proxy = revocable.proxy; console.log(proxy.foo); // "[[foo]]" revocable.revoke(); console.log(proxy.foo); // typeerror is thrown proxy.foo = 1 // typeerror again delete proxy.foo; // still typeerror typeof proxy // "object", typeof doesn't trigger any trap specifications specification ecmascript (ecma-262)the definition of 'proxy revocation functions' in that specification.
Reflect.has() - JavaScript
exceptions a typeerror, if target is not an object.
... examples using reflect.has() reflect.has({x: 0}, 'x') // true reflect.has({x: 0}, 'y') // false // returns true for properties in the prototype chain reflect.has({x: 0}, 'tostring') // proxy with .has() handler method obj = new proxy({}, { has(t, k) { return k.startswith('door') } }); reflect.has(obj, 'doorbell') // true reflect.has(obj, 'dormitory') // false reflect.has returns true for any inherited properties, like the in operator: const a = {foo: 123} const b = {__proto__: a} const c = {__proto__: b} // the prototype chain is: c -> b -> a reflect.has(c, 'foo') // true specifications specification ecmascript (ecma-262)the d...
SharedArrayBuffer() constructor - JavaScript
calling a sharedarraybuffer constructor as a function without new will throw a typeerror.
... var sab = sharedarraybuffer(1024); // typeerror: calling a builtin sharedarraybuffer constructor // without new is forbidden var sab = new sharedarraybuffer(1024); specifications specification ecmascript (ecma-262)the definition of 'sharedarraybuffer constructor' in that specification.
Symbol.isConcatSpreadable - JavaScript
the symbol.isconcatspreadable well-known symbol is used to configure if an object should be flattened to its array elements when using the array.prototype.concat() method.
... property attributes of symbol.isconcatspreadable writable no enumerable no configurable no examples arrays by default, array.prototype.concat() spreads (flattens) arrays into its result: let alpha = ['a', 'b', 'c'], let numeric = [1, 2, 3] let alphanumeric = alpha.concat(numeric) console.log(alphanumeric) // result: ['a', 'b', 'c', 1, 2, 3] when setting symbol.isconcatspreadable to false, you can disable the default behavior: let alpha = ['a', 'b', 'c'], let numeric = [1, 2, 3] numeric[symbol.isconcatspreadable] = false ...
Symbol.replace - JavaScript
this function is called by the string.prototype.replace() method.
... for more information, see regexp.prototype[@@replace]() and string.prototype.replace().
Symbol.search - JavaScript
this function is called by the string.prototype.search() method.
... for more information, see regexp.prototype[@@search]() and string.prototype.search().
Symbol.split - JavaScript
this function is called by the string.prototype.split() method.
... for more information, see regexp.prototype[@@split]() and string.prototype.split().
WebAssembly.Memory - JavaScript
instance properties memory.prototype.buffer an accessor property that returns the buffer contained in the memory.
... instance methods memory.prototype.grow() increases the size of the memory instance by a specified number of webassembly pages (each one is 64kb in size).
WebAssembly.compile() - JavaScript
syntax promise<webassembly.module> webassembly.compile(buffersource); parameters buffersource a typed array or arraybuffer containing the binary code of the .wasm module you want to compile.
... exceptions if buffersource is not a typed array, a typeerror is thrown.
WebAssembly.instantiateStreaming() - JavaScript
exceptions if either of the parameters are not of the correct type or structure, a typeerror is thrown.
... note: for this to work, .wasm files should be returned with an application/wasm mime type by the server.
WebAssembly - JavaScript
webassembly.runtimeerror() error type that is thrown whenever webassembly specifies a trap.
... webassembly.validate() validates a given typed array of webassembly binary code, returning whether the bytes are valid webassembly code (true) or not (false).
globalThis - JavaScript
however, this causes csp violations in some settings, so es6-shim uses a check like this, for example: var getglobal = function () { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } throw new error('unable to locate global object'); }; var globals = getglobal(); if (typeof globals.settimeout !== 'function') { // no settimeout in this environment!
... } with globalthis available, the additional search for the global across environments is not necessary anymore: if (typeof globalthis.settimeout !== 'function') { // no settimeout in this environment!
isNaN() - JavaScript
when the argument to the isnan function is not of type number, the value is first coerced to a number.
...thus for non-numbers that when coerced to numeric type result in a valid non-nan numeric value (notably the empty string and boolean primitives, which when coerced give numeric values zero or one), the "false" returned value may be unexpected; the empty string, for example, is surely "not a number." the confusion stems from the fact that the term, "not a number", has a specific meaning for numbers represented as ieee-754 floating-point values.
null - JavaScript
it is not defined and has never been initialized: foo; //referenceerror: foo is not defined // foo is known to exist now but it has no type or value: var foo = null; foo; //null examples difference between null and undefined when checking for null or undefined, beware of the differences between equality (==) and identity (===) operators, as the former performs type-conversion.
... typeof null // "object" (not "null" for legacy reasons) typeof undefined // "undefined" null === undefined // false null == undefined // true null === null // true null == null // true !null // true isnan(1 + null) // false isnan(1 + undefined) // true specifications specification ecmascript (ecma-262)the definition of 'null value' in that specification.
Destructuring assignment - JavaScript
say you want the third element in the array props below, and then you want the name property in the object, you can do the following: const props = [ { id: 1, name: 'fizz'}, { id: 2, name: 'buzz'}, { id: 3, name: 'fizzbuzz'} ]; const [,, { name }] = props; console.log(name); // "fizzbuzz" the prototype chain is looked up when the object is deconstructed when deconstructing an object, if a property is not accessed in itself, it will continue to look up along the prototype chain.
... let obj = {self: '123'}; obj.__proto__.prot = '456'; const {self, prot} = obj; // self "123" // prot "456"(access to the prototype chain) specifications specification ecmascript (ecma-262)the definition of 'destructuring assignment' in that specification.
Inequality (!=) - JavaScript
unlike the strict inequality operator, it attempts to convert and compare operands that are of different types.
... like the equality operator, the inequality operator will attempt to convert and compare operands of different types: 3 != "3"; // false to prevent this, and require that different types are considered to be different, use the strict inequality operator instead: 3 !== "3"; // true examples comparison with no type conversion 1 != 2; // true "hello" != "hola"; // true 1 != 1; // false "hello" != "hello"; // false comparison with type conversion "1" != 1; // false...
Operator precedence - JavaScript
precedence operator type associativity individual operators 21 grouping n/a ( … ) 20 member access left-to-right … .
...… bitwise not ~ … unary plus + … unary negation - … prefix increment ++ … prefix decrement -- … typeof typeof … void void … delete delete … await await … 16 exponentiation right-to-left … ** … 15 multiplication left-to-right … * … division … / … remainder … % … 14 addition left-to-right … + … subtraction … - … 13 bitwise left...
Optional chaining (?.) - JavaScript
will still raise a typeerror exception (someinterface.custommethod is not a function).
... note: if someinterface itself is null or undefined, a typeerror exception will still be raised (someinterface is null).
Unary plus (+) - JavaScript
using the operator on bigint values throws a typeerror.
... examples usage with numbers const x = 1; const y = -1; console.log(+x); // 1 console.log(+y); // -1 usage with non-numbers +true // 1 +false // 0 +null // 0 +function(val){ return val } // nan +1n // throws typeerror: cannot convert bigint value to number specifications specification ecmascript (ecma-262)the definition of 'unary plus operator' in that specification.
Function expression - JavaScript
nothoisted(); // typeerror: nothoisted is not a function var nothoisted = function() { console.log('bar'); }; named function expression if you want to refer to the current function inside the function body, you need to create a named function expression.
... var foo = function() {} foo.name // "foo" var foo2 = foo foo2.name // "foo" var bar = function baz() {} bar.name // "baz" console.log(foo === foo2); // true console.log(typeof baz); // undefined console.log(bar === baz); // false (errors because baz == undefined) examples creating an unnamed function the following example defines an unnamed function and assigns it to x.
import - JavaScript
the import statement cannot be used in embedded scripts unless such script has a type="module".
... there is also a function-like dynamic import(), which does not require scripts of type="module".
let - JavaScript
console.log(this.y); // undefined emulating private members in dealing with constructors it is possible to use the let bindings to share one or more private members without using closures: var thing; { let privatescope = new weakmap(); let counter = 0; thing = function() { this.someproperty = 'foo'; privatescope.set(this, { hidden: ++counter, }); }; thing.prototype.showpublic = function() { return this.someproperty; }; thing.prototype.showprivate = function() { return privatescope.get(this).hidden; }; } console.log(typeof privatescope); // "undefined" var thing = new thing(); console.log(thing); // thing {someproperty: "foo"} thing.showpublic(); // "foo" thing.showprivate(); // 1 the same privacy pattern with closures over local variab...
... function do_something() { console.log(bar); // undefined console.log(foo); // referenceerror var bar = 1; let foo = 2; } the temporal dead zone and typeof unlike with simply undeclared variables and variables that hold a value of undefined, using the typeof operator to check for the type of a variable in that variable's temporal dead zone will throw a referenceerror: // prints out 'undefined' console.log(typeof undeclaredvariable); // results in a 'referenceerror' console.log(typeof i); let i = 10; another example of temporal dead zone combin...
throw - JavaScript
the following example creates an object of type userexception and uses it in a throw statement.
...if the zip code uses an invalid format, the throw statement throws an exception by creating an object of type zipcodeformatexception.
with - JavaScript
however, ecmascript 2015 introduces a values property on array.prototype (so that it will be available on every array).
...however, in this particular example, array.prototype has been defined with values in its symbol.unscopables object.
Transitioning to strict mode - JavaScript
if you really want to set a value to the global object, pass it as an argument and explicitly assign it as a property: var global = this; // in the top-level context, "this" always // refers to the global object function f(x) { 'use strict'; var a = 12; global.b = a + x * 35; } f(42); trying to delete a non-configurable property 'use strict'; delete object.prototype; // error!
... stay away from semantic differences eval: use it only if you know what you're doing arguments: always access function arguments via their name or perform a copy of the arguments object using: var args = array.prototype.slice.call(arguments) as the first line of your function this: only use this when it refers to an object you created.
screenshots - Web app manifests
type object mandatory no the screenshots member defines an array of screenshots intended to showcase the application.
... examples "screenshots" : [ { "src": "screenshot1.webp", "sizes": "1280x720", "type": "image/webp" }, { "src": "screenshot2.webp", "sizes": "1280x720", "type": "image/webp" } ] specification specification status comment feedback web app manifestthe definition of 'screenshots' in that specification.
MathML attribute reference - MathML
the xlink attributes on mathml elements: xlink:actuate, xlink:href, xlink:show and xlink:type are deprecated as well.
... actiontype <maction> a string value specifying the action happening for this element.
Web media technologies
guide to media types and formats on the web a guide to the file types and codecs available for images, audio, and video media on the web.
... this includes recommendations for what formats to use for what kinds of content, best practices including how to provide fallbacks and how to prioritize media types, and also includes general browser support information for each media container and codec.
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.
... 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.
Lazy loading - Web Performance
entry point splitting: separates code by entry point(s) in the app dynamic splitting: separates code where dynamic import() statements are used javascript script type module any script tag with type="module" is treated like a javascript module and is deferred by default.
...css must be thin, delivered as quickly as possible, and the usage media types and queries are advised to unblock rendering.
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
fetch('./register', { method: 'post', headers: { 'content-type': 'application/json' }, body: json.stringify({ subscription: subscription }), }); then the globaleventhandlers.onclick function on the subscribe button is defined: document.getelementbyid('doit').onclick = function() { const payload = document.getelementbyid('notification-payload').value; const delay = document.getelementbyid('notification-delay').value; const tt...
...l = document.getelementbyid('notification-ttl').value; fetch('./sendnotification', { method: 'post', headers: { 'content-type': 'application/json' }, body: json.stringify({ subscription: subscription, payload: payload, delay: delay, ttl: ttl, }), }); }; when the button is clicked, fetch asks the server to send the notification with the given parameters: payload is the text that to be shown in the notification, delay defines a delay in seconds until the notification will be shown, and ttl is the time-to-live setting that keeps the notification available on the server for a specified amount of time, also defined in seconds.
SVG Core Attributes - SVG: Scalable Vector Graphics
WebSVGAttributeCore
value type: <integer>; animatable: no xml:base specifies a base iri other than the base iri of the document.
... value type: <iri>; animatable: no xml:lang it is a universal attribute allowed in all xml dialects to mark up the natural human language that an element contains.
SVG Event Attributes - SVG: Scalable Vector Graphics
WebSVGAttributeEvents
they specifies some script to run when the event of the given type is dispatched to the element on which the attributes are specified.
... for every event type that the browser supports, svg supports that as an event attribute, following the same requirements as for html event attributes.
exponent - SVG: Scalable Vector Graphics
efs> <lineargradient id="gradient" gradientunits="userspaceonuse" x1="0" y1="0" x2="200" y2="0"> <stop offset="0" stop-color="#ff0000" /> <stop offset="0.5" stop-color="#00ff00" /> <stop offset="1" stop-color="#0000ff" /> </lineargradient> </defs> <filter id="componenttransfer1" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="gamma" exponent="1"/> <fefuncg type="gamma" exponent="1"/> <fefuncb type="gamma" exponent="1"/> </fecomponenttransfer> </filter> <filter id="componenttransfer2" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="gamma" exponent="5"/> <fefuncg type="gamma" exponent="5"/> <fefuncb type="gamma" exponent="5"/> </fecomponenttrans...
... <rect x="0" y="0" width="200" height="200" fill="url(#gradient)" style="filter: url(#componenttransfer1);" /> <rect x="0" y="0" width="200" height="200" fill="url(#gradient)" style="filter: url(#componenttransfer2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 1 animatable yes <number> if the type attribute of the component element is set to gamma, this value specifies the exponent of the gamma function specifications specification status comment filter effects module level 1the definition of 'exponent' in that specification.
intercept - SVG: Scalable Vector Graphics
the intercept attribute defines the intercept of the linear function of color component transfers when the type attribute is set to linear.
...efs> <lineargradient id="gradient" gradientunits="userspaceonuse" x1="0" y1="0" x2="200" y2="0"> <stop offset="0" stop-color="#ff0000" /> <stop offset="0.5" stop-color="#00ff00" /> <stop offset="1" stop-color="#0000ff" /> </lineargradient> </defs> <filter id="componenttransfer1" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="linear" intercept="0"/> <fefuncg type="linear" intercept="0"/> <fefuncb type="linear" intercept="0"/> </fecomponenttransfer> </filter> <filter id="componenttransfer2" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="linear" intercept="0.3"/> <fefuncg type="linear" intercept="0.1"/> <fefuncb type="linear" intercept="0.8"/> ...
panose-1 - SVG: Scalable Vector Graphics
panose-1 is an industry standard truetype font classification and matching technology.
... the panose system consists of a set of ten numbers that categorize the key attributes of a latin typeface, a classification procedure for creating those numbers, and mapper software that determines the closest possible font match given a set of typefaces.
<animateTransform> - SVG: Scalable Vector Graphics
usage context categoriesanimation elementpermitted contentany number of the following elements, in any order:descriptive elements example <svg width="120" height="120" viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <polygon points="60,30 90,90 30,90"> <animatetransform attributename="transform" attributetype="xml" type="rotate" from="0 60 70" to="360 60 70" dur="10s" repeatcount="indefinite"/> </polygon> </svg> live sample attributes global attributes conditional processing attributes » core attributes » animation event attributes » xlink attributes » a...
...nimation attribute target attributes » animation timing attributes » animation value attributes » animation addition attributes » externalresourcesrequired specific attributes by from to type dom interface this element implements the svganimatetransformelement interface.
<feTurbulence> - SVG: Scalable Vector Graphics
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes basefrequency numoctaves seed stitchtiles type dom interface this element implements the svgfeturbulenceelement interface.
... example <svg width="200" height="200" viewbox="0 0 220 220" xmlns="http://www.w3.org/2000/svg"> <filter id="displacementfilter"> <feturbulence type="turbulence" basefrequency="0.05" numoctaves="2" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50" xchannelselector="r" ychannelselector="g"/> </filter> <circle cx="100" cy="100" r="100" style="filter: url(#displacementfilter)"/> </svg> specifications specification status comment filter effects module level 1the definition of '<feturbulence>' in that specification.
<path> - SVG: Scalable Vector Graphics
WebSVGElementpath
value type: <string> ; default value: ''; animatable: yes pathlength this attribute lets authors specify the total length for the path, in user units.
... value type: <number> ; default value: none; animatable: yes 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, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcoun...
<polygon> - SVG: Scalable Vector Graphics
WebSVGElementpolygon
value type: <number>+ ; default value: ""; animatable: yes pathlength this attribute lets specify the total length for the path, in user units.
... value type: <number> ; default value: none; animatable: yes 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, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcoun...
<polyline> - SVG: Scalable Vector Graphics
WebSVGElementpolyline
e of a polyline with the default fill --> <polyline points="0,100 50,25 50,75 100,0" /> <!-- example of the same polyline shape with stroke and no fill --> <polyline points="100,100 150,25 150,75 200,0" fill="none" stroke="black" /> </svg> attributes points this attribute defines the list of points (pairs of x,y absolute coordinates) required to draw the polyline value type: <number>+ ; default value: ""; animatable: yes pathlength this attribute lets specify the total length for the path, in user units.
... value type: <number> ; default value: none; animatable: yes 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, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcoun...
<set> - SVG: Scalable Vector Graphics
WebSVGElementset
it supports all attribute types, including those that cannot reasonably be interpolated, such as string and boolean values.
... value type: <anything>; default value: none; animatable: no animation attributes animation timing attributes begin, dur, end, min, max, restart, repeatcount, repeatdur, fill other animation attributes most notably: attributename animation event attributes most notably: onbegin, onend, onrepeat global attributes core attributes most notably: id styling attributes class, style event attribu...
Basic shapes - SVG: Scalable Vector Graphics
note: a rectangle is a type of polygon, so a polygon can be used to create a <rect/> element in cases where you need a little more flexibility.
...basically any of the other types of shapes, bezier curves, quadratic curves, and many more.
Gradients in SVG - SVG: Scalable Vector Graphics
there are two types of gradients: linear and radial.
...class="stop1" offset="0%"/> <stop class="stop2" offset="50%"/> <stop class="stop3" offset="100%"/> </lineargradient> <lineargradient id="gradient2" x1="0" x2="0" y1="0" y2="1"> <stop offset="0%" stop-color="red"/> <stop offset="50%" stop-color="black" stop-opacity="0"/> <stop offset="100%" stop-color="blue"/> </lineargradient> <style type="text/css"><![cdata[ #rect1 { fill: url(#gradient1); } .stop1 { stop-color: red; } .stop2 { stop-color: black; stop-opacity: 0; } .stop3 { stop-color: blue; } ]]></style> </defs> <rect id="rect1" x="10" y="10" rx="15" ry="15" width="100" height="100"/> <rect x="10" y="120" rx="15" ry="15" width="100" height="100" fill="url(#gradient2)"/> </svg> scree...
XPath snippets - XPath
context.ownerdocument : document); resolver = resolver || null; context = context || doc; result = doc.evaluate(expr, context, resolver, xpathresult.ordered_node_snapshot_type, null); for(i = 0; i < result.snapshotlength; i++) { a[i] = result.snapshotitem(i); } return a; } getxpathforelement the following function allows one to pass an element and an xml document to find a unique string xpath expression leading back to that element.
... example: defining a getxpathforelement​​() utility function function getxpathforelement(el, xml) { var xpath = ''; var pos, tempitem2; while(el !== xml.documentelement) { pos = 0; tempitem2 = el; while(tempitem2) { if (tempitem2.nodetype === 1 && tempitem2.nodename === el.nodename) { // if it is element_node of the same name pos += 1; } tempitem2 = tempitem2.previoussibling; } xpath = "*[name()='"+el.nodename+"' and namespace-uri()='"+(el.namespaceuri===null?'':el.namespaceuri)+"']["+pos+']'+'/'+xpath; el = el.parentnode; } xpath = '/*'+"[name()='"+xml.documentelement.nodename+"' and namespace-uri()='"+(el.namespaceuri===null?'':el.namespaceuri)+"']"+'/'+xpath; xpath = xpath.replace(/\/$/, ''); return xpath; } resources xpath forum discussion...
PI Parameters - XSLT: Extensible Stylesheet Language Transformations
<?xslt-param name="color" value="blue"?> <?xslt-param name="size" select="2"?> <?xml-stylesheet type="text/xsl" href="style.xsl"?> note that these pis have no effect when transformation is done using the xsltprocessor object in javascript.
...the datatype will always bestring.
Compiling a New C/C++ Module to WebAssembly - WebAssembly
add a <button> element as shown below, just above the first opening <script type='text/javascript'> tag.
... <button class="mybutton">run myfunction</button> now add the following code at the end of the first <script> element: document.queryselector('.mybutton') .addeventlistener('click', function() { alert('check console'); var result = module.ccall( 'myfunction', // name of c function null, // return type null, // argument types null // arguments ); }); this illustrates how ccall() is used to call the exported function.
WebAssembly
webassembly is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as c/c++, c# and rust with a compilation target so that they can run on the web.
... webassembly.table() a webassembly.table object is a resizable typed array of opaque values, like function references, that are accessed by an instance.
Window: deviceproximity event - Archive of obsolete content
bubbles no cancelable no interface deviceproximityevent target defaultview (window) default action none event handler property window.ondeviceproximity specification proximity sensor other properties property type description value read only double (float) the measured proximity of the distant device (distance in centimetres).
Window: userproximity event - Archive of obsolete content
other properties property type description near read only boolean the current user proximity state.
Content Scripts - Archive of obsolete content
for example, consider a page that adds a variable foo to the window object using a page script: <!doctype html"> <html> <head> <script> window.foo = "hello from page script" </script> </head> </html> another script loaded into the page after this script will be able to access foo.
Content Processes - Archive of obsolete content
accessing the dom the global for the content sandbox has the window object as its prototype.
Modules - Archive of obsolete content
the object it passed to the loadsubscript function is an ordinary object, which has the global object of the loading script as its prototype.
hotkeys - Archive of obsolete content
parameters options : object required options: name type combo string any function key: "f1, f2, ..., f24" or key combination in the format of 'modifier-key': "accel-s" "meta-shift-i" "control-alt-d" all hotkeys require at least one modifier as well as the key.
notifications - Archive of obsolete content
parameters options : object optional options: name type title string a string to display as the message's title.
simple-storage - Archive of obsolete content
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.
url - Archive of obsolete content
properties mimetype the mime type of the data.
content/symbiont - Archive of obsolete content
parameters options : object optional options: name type frame object the host application frame in which the page is loaded.
frame/hidden-frame - Archive of obsolete content
parameters options : object required options: name type onready function,array functions to call when the frame is ready to load content.
frame/utils - Archive of obsolete content
parameters document : nsidomdocument options : object optional options: name type type string string that defines access type of the document loaded into it.
lang/functional - Archive of obsolete content
let { chain } = require("sdk/lang/functional"); function person (age) { this.age = age; } person.prototype.happybirthday = chain(function () this.age++); let person = new person(30); person .happybirthday() .happybirthday() .happybirthday() console.log(person.age); // 33 parameters fn : function the function that will be wrapped by the chain function.
net/url - Archive of obsolete content
options : object optional options: name type sync boolean if this option is set to true, the promise returned will be resolved synchronously.
places/history - Archive of obsolete content
options : object optional options: name type count number the number of bookmark items to return.
preferences/event-target - Archive of obsolete content
globals constructor prefstarget(options) parameters options : object required options: name type branchname string by default this is "", the root.
util/object - Archive of obsolete content
let { merge } = require("sdk/util/object"); var a = { jetpacks: "are yes", foo: 10 } var b = merge(a, { foo: 5, bar: 6 }, { foo: 50, location: "sf" }); b === a // true b.jetpacks // "are yes" b.foo // 50 b.bar // 6 b.location // "sf" // merge also translates property descriptors var c = { "type": "addon" }; var d = {}; object.defineproperty(d, "name", { value: "jetpacks", configurable: false }); merge(c, d); var props = object.getownpropertydescriptor(c, "name"); console.log(props.configurable); // true parameters source : object the object that other properties are merged into.
Low-Level APIs - Archive of obsolete content
lang/type functions for working with type detection.
Release notes - Archive of obsolete content
firefox 28 highlights added wildcard event type "*".
cfx to jpm - Archive of obsolete content
add-on ids need to be one of two types: a guid or a string that includes an "@" symbol.
jpm-mobile - Archive of obsolete content
after that you can install jpm just as you would any other npm package: npm install jpm-mobile -g depending on your setup, you might need to run this as an administrator: sudo npm install jpm-mobile -g at the command prompt, type: jpm-mobile you should see a screen summarizing the available jpm-mobile commands.
jpm - Archive of obsolete content
le to add it to your path permanently (as the file .profile is executed every time a new terminal is opened): export path="$home/node_modules/.bin/:$path" installing jpm from git alternatively, you can also get the latest version of jpm using git: git clone https://github.com/mozilla-jetpack/jpm.git cd jpm npm install npm link after installing jpm after installation, at the command prompt, type: jpm you should see a screen summarizing the available jpm commands.
package.json - Archive of obsolete content
preferences an array of json objects that use the following keys: name,type, value, title, and description.
Creating annotations - Archive of obsolete content
annotation editor html the html is very simple: <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>annotation</title> <style type="text/css" media="all"> body { font: 100% arial, helvetica, sans-serif; background-color: #f5f5f5; } textarea { width: 180px; height: 180px; margin: 10px; paddin...
Displaying annotations - Archive of obsolete content
annotation panel html <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>annotation</title> <style media="all" type="text/css"> body { font: 100% arial, helvetica, sans-serif; background-color: #f5f5f5; } div { text-align:left; } </style> </head> <bo...
Implementing the widget - Archive of obsolete content
now from the annotator directory type cfx run.
Overview - Archive of obsolete content
navigate to it and type cfx init.
Storing annotations - Archive of obsolete content
annotation list html and css here's the html for the annotation list: <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>saved annotations</title> <link rel="stylesheet" type="text/css" href="annotation-list.css" /> </head> <body> <div id="annotation-list"> </div> <div id="template"> <div class="annotation-details"> <a class="url"></a> <div class="selection-text"></div> <div class="annotation-text"></div> </div> </div> </body> </html> here's t...
Using XPCOM without chrome - Archive of obsolete content
eed to import ci and the xpcomutils const { class } = require("sdk/core/heritage"); const { unknown } = require('sdk/platform/xpcom'); const { placesutils } = require("resource://gre/modules/placesutils.jsm"); let bmlistener = class({ extends: unknown, interfaces: [ "nsinavbookmarkobserver" ], //this event most often handles all events onitemchanged: function(bid, prop, an, nv, lm, type, parentid, aguid, aparentguid) { console.log("onitemchanged", "bid: "+bid, "property: "+prop, "isanno: "+an, "new value: "+nv, "lastmod: "+lm, "type: "+type, "parentid:"+parentid, "aguid:"+aguid);0 // code to handle the event here } }); //we just have a class, but need an object.
Using third-party modules (jpm) - Archive of obsolete content
in your add-on code, you can require() modules by passing a path to the module starting from, but not including "node_modules": var menuitems = require("menuitem"); details create a new directory called, for example, "my-menuitem", navigate to it, type "jpm init" and accept all the defaults: mkdir my-menuitem cd my-menuitem jpm init install the menuitem package from npm: npm install menuitem --save this will install the package in the current directory, under a directory called "node_modules".
Autocomplete - Archive of obsolete content
first, declare a panel with the "autocomplete" type, like so: <panel id="popup_autocomplete" type="autocomplete" noautofocus="true" /> now set the autocompletepopup attribute of your <browser> element to the id of the panel you just declared: <browser id="my_browser" ...
JS XPCOM - Archive of obsolete content
components.utils.import("resource://gre/modules/services.jsm"); components.utils.import("resource://gre/modules/xpcomutils.jsm"); const cc = components.classes; const ci = components.interfaces; function abouthandler() {} abouthandler.prototype = { newchannel: function(uri) { var channel = services.io.newchannel("chrome://mystuff/content/mystuff.xul", null, null); channel.originaluri = uri; return channel; }, geturiflags: function(uri) { // do not return ci.nsiaboutmodule.uri_safe_for_untrusted_content unless // you make sure to set a non-system principal in newchannel.
Post data to window - Archive of obsolete content
createinstance(ci.nsimimeinputstream); postdata.addheader("content-type", "application/x-www-form-urlencoded"); postdata.addcontentlength = true; postdata.setdata(stringstream); // postdata is ready to be used as apostdata argument ...
Scrollbar - Archive of obsolete content
example xul window: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="samplewindow" width="320" height="240" xmlns="http://www.mozilla.org/keymaster/gat...re.is.only.xul"> <hbox flex="1"> <browser type="content" src="http://mozilla.org" flex="1"/> <scrollbar orient="vertical"/> </hbox> </window> ...
Tree - Archive of obsolete content
view.iscontaineropen(i)) treeview.toggleopenstate(i); } to collapse all tree nodes just change the condition: var treeview = tree.treeboxobject.view; for (var i = 0; i < treeview.rowcount; i++) { if (treeview.iscontainer(i) && treeview.iscontaineropen(i)) treeview.toggleopenstate(i); } getting the text from the selected row assuming the given <tree>: <tree id="my-tree" seltype="single" onselect="ontreeselected()"> use the following javascript: function ontreeselected(){ var tree = document.getelementbyid("my-tree"); var cellindex = 0; var celltext = tree.view.getcelltext(tree.currentindex, tree.columns.getcolumnat(cellindex)); alert(celltext); } getting the tree item from the focused row assuming <tree id="my-tree">, you can use the following to get...
View Source for XUL Applications - Archive of obsolete content
importing gviewsourceutils xul applications wanting to show the source code for documents should import the viewsourceutils.js script instead of attempting to open the viewsource.xul window themselves: <script type="application/javascript" src="chrome://global/content/viewsourceutils.js"/> viewsourceutils.js exposes a gviewsourceutils global into the scope of the window that imports that script.
Windows - Archive of obsolete content
/this open a pop-up window that could be "blocked" client-side //the following code generate an error as describe in the following warning box var wm = components.classes["@mozilla.org/appshell/window-mediator;1"] .getservice(components.interfaces.nsiwindowmediator); var newwindow = wm.getmostrecentwindow("navigator:browser"); var b = newwindow.gbrowser; the code generate a typeerror from firefox console.
Common Pitfalls - Archive of obsolete content
it's something the user typed in the url bar).
Communication between HTML and your extension - Archive of obsolete content
some of the events only apply to certain types of elements so i included trying to modify the result of the ajax request to be of the appropriate element type (img, which supports "onload," rather than span, which doesn't, for example).
Custom about: URLs - Archive of obsolete content
} createinstance(outer, iid) { if (outer) { throw cr.ns_error_no_aggregation; } return new this.component(); } register() { cm.registerfactory(this.component.classid, this.component.classdescription, this.component.contractid, this); } unregister() { cm.unregisterfactory(this.component.prototype.classid, this); } } instantiation firefox 4+ now in the startup procedure of your bootstrapped addon make sure to do register the factory, for example: let factory; function startup(adata, areason) { // ...
Default Preferences - Archive of obsolete content
ferences using the pref() function: pref("name", "value") example: pref('extensions.defaultprefs.example.int', 1); pref('extensions.defaultprefs.example.float', 0.1); pref('extensions.defaultprefs.example.string', 'fadf'); pref('extensions.defaultprefs.example.bool', true); notice that unlike when you're reading preferences, writing default preferences uses the same function no matter the data type of the preference.
Deploying a Plugin as an Extension - Archive of obsolete content
also, supply mimetype and fileextents, without these your plugin won't work.
Developing add-ons - Archive of obsolete content
there are three primary types of add-on: extensions, plugins, and themes.
Installing Extensions and Themes From Web Pages - Archive of obsolete content
web script example <script type="application/javascript"> <!-- function install (aevent) { for (var a = aevent.target; a.href === undefined;) a = a.parentnode; var params = { "foo": { url: aevent.target.href, iconurl: aevent.target.getattribute("iconurl"), hash: aevent.target.getattribute("hash"), tostring: function () { return this.url; } } }; installtrigger.install(params); return false; } //--> </script> <a href="http://www.examp...
Jetpack Processes - Archive of obsolete content
note: the above statement is not currently true, as js-ctypes is now provided to jetpack processes as of bug 588563.
Listening to events in Firefox extensions - Archive of obsolete content
types of events there are multiple types of events that application and extension authors can use to receive notifications from <xul:browser> and <xul:tabbrowser> elements to hear about changes relating to loads of the content contained within them.
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
note that you don't need to promise a flat string if you already have an ns(c)(auto)string type, since they are already flat.
Adding Events and Commands - Archive of obsolete content
commands the command element is a specialized type of broadcaster, meant to be used with the oncommand event.
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
ue, true); document.getelementbyid("mymenu").dispatchevent(event); // fake a mouse click var mouseevent = document.createevent("mouseevents"); event.initmouseevent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); document.getelementbyid("mylabel").dispatchevent(mouseevent); please see the corresponding documentation on how to use and initialize particular event types.
Appendix F: Monitoring DOM changes - Archive of obsolete content
*/ if ('mozcsskeyframerule' in window || 'csskeyframerule' in window) { var watchnodes = function watchnodes(selector, callback, doc) { const event = watchnodes.prefix + (watchnodes._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) ' ' ...
Local Storage - Archive of obsolete content
localdir.create(ci.nsifile.directory_type, 0774); } return localdir; }, profd is a special identifier for the profile directory that exists so that you don't need to figure out its location.
Observer Notifications - Archive of obsolete content
this is because the first parameter of the observe method is typed as nsisupports (the generic interface, as seen before), therefore its properties and methods cannot be accessed unless the correct interface is set to it.
Useful Mozilla Community Sites - Archive of obsolete content
it allows you to upload, search and download all types of add-ons for mozilla applications.
Overlay extensions - Archive of obsolete content
the privileged javascript apis described here can still be used in these newer types of add-ons.
Setting up an extension development environment - Archive of obsolete content
accessing firefox development preferences to change preference settings in firefox or seamonkey, type about:config in the location bar.
Tabbed browser - Archive of obsolete content
var url = "https://developer.mozilla.org"; var tab = gbrowser.addtab(null, {relatedtocurrent: true}); gsessionstore.settabstate(tab, json.stringify({ entries: [ { title: url } ], usertypedvalue: url, usertypedclear: 2, lastaccessed: tab.lastaccessed, index: 1, hidden: false, attributes: {}, image: null })); reusing tabs rather than open a new browser or new tab each and every time one is needed, it is good practice to try to re-use an existing tab which already displays the desired url--if one is already open.
Add-ons - Archive of obsolete content
these type of extensions have many advantages for both users and developers compared to the old xpinstall/-style extensions.
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
i've been manually writing sample code for my own design prototypes for 4 or 5 years now.
Creating a dynamic status bar extension - Archive of obsolete content
write the xul file we need a slightly more complicated xul file this time, in order to add a reference to the javascript code that will do the real work: <?xml version="1.0" encoding="utf-8"?> <!doctype overlay> <overlay id="stockwatcher-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://stockwatcher/content/stockwatcher.js"/> <!-- firefox --> <statusbar id="status-bar"> <statusbarpanel id="stockwatcher" label="loading..." tooltiptext="current value" onclick="stockwatcher.refreshinformation()" />...
chargingchange - Archive of obsolete content
property type description batterymanager.charging boolean the system's battery charging status.
chargingtimechange - Archive of obsolete content
property type description batterymanager.chargingtime double (float) the remaining time in seconds until the system's battery is fully charged.
dischargingtimechange - Archive of obsolete content
property type description batterymanager.dischargingtime double (float) the remaining time in seconds until the system's battery is completely discharged and the system is about to be suspended.
levelchange - Archive of obsolete content
property type description batterymanager.level double (float) the system's battery charging level scaled from 0 to 1.0.
Localizing an extension - Archive of obsolete content
to options.xul, we add this line: <!doctype window system "chrome://stockwatcher2/locale/options.dtd"> we add a similar line to the stockwatcher.xul file: <!doctype overlay system "chrome://stockwatcher2/locale/stockwatcher2.dtd"> in larger applications you might need to use entities from several locale files in a single xul file.
cert_override.txt - Archive of obsolete content
domainname:port : port 443 for https (ssl) hash algorithm oid sha1-256: oid.2.16.840.1.101.3.4.2.1 (most used) sha-384: oid.2.16.840.1.101.3.4.2.2 sha-512: oid.2.16.840.1.101.3.4.2.3 certificate fingerprint using previous hash algorithm one or more characters for override type: m : allow mismatches in the hostname u : allow untrusted certs (whether it's self signed cert or a missing or invalid issuer cert) t : allow errors in the validity time, for example, for expired or not yet valid certs certificate's serial number and the issuer name as a base64 encoded string ...
Creating a Web based tone generator - Archive of obsolete content
<!doctype html> <html> <head> <title>javascript audio write example</title> </head> <body> <input type="text" size="4" id="freq" value="440"><label for="hz">hz</label> <button onclick="start()">play</button> <button onclick="stop()">stop</button> <script type="text/javascript"> function audiodatadestination(samplerate, readfn) { // initialize the audio output.
Structure of an installable bundle - Archive of obsolete content
s/libmyplugin.dylib because xpt files are not platform-specific, any associated xpt files would go in the generic components directory: /components/myplugin.xpt if an extension has non-binary platform-specific code (such as code which uses the windows registry from script), it can also use just the operating system identifier as a platform-subdirectory: /platform/winnt/components/registerdoctype.js when platform-specific jar files are used, each platform directory should have its own chrome.manifest file: chrome.manifest chrome/mytheme-base.jar platform/darwin/chrome.manifest platform/darwin/chrome/mytheme-mac.jar platform/winnt/chrome.manifest platform/winnt/chrome/mytheme-win.jar the app/extension loader processes the base directory first, followed by the applicable platform direc...
Enabling the behavior - retrieving tinderbox status - Archive of obsolete content
we use new to create a new instance of it, set the instance's onload property to updatetinderboxstatus(), the function we want to execute when the document finishes loading, call its open method with the type of http request we want to make and the url of the document to retrieve, and then call its send method to send the request.
Enabling the behavior - updating the status periodically - Archive of obsolete content
<!-- navigator --> <script type="application/javascript" src="chrome://navigator/content/browser.js"/> <script type="application/javascript" src="chrome://navigator/content/navigator.js"/> <script type="application/javascript" src="chrome://navigator/content/navigatordd.js"/> <script type="application/javascript" src="chrome://navigator/content/sessionhistoryui.js"/> <script type="application/javascript...
Making it into a dynamic overlay and packaging it up for distribution - Archive of obsolete content
we need to change some urls in the copy of tinderstatusoverlay.xul to point to the new locations the files will be in when they get installed via the xpi: <?xml version="1.0"?> <?xml-stylesheet href="chrome://tinderstatus/content/tinderstatus.css" type="text/css"?> <overlay id="tinderstatusoverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://tinderstatus/content/tinderstatus.js" /> <statusbar id="status-bar"> <statusbarpanel class="statusbarpanel-iconic" id="tinderbox-status" insertbefore="offline-status" status="none"...
Specifying the appearance - Archive of obsolete content
of stylesheets that govern its appearance, and we don't want to have to add these rules to each set (and have our extension break when a new set gets installed), so we'll put this stylesheet in a file called tinderstatus.css in the same directory as navigator.xul and reference it at the top of that file right under the global stylesheet reference: <?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?> <?xml-stylesheet href="chrome://navigator/content/tinderstatus.css" type="text/css"?> our css rules use the list-style-image property to define an image to appear when our status bar panel, identified by its id attribute, has a given value for its status attribute.
Creating a Release Tag - Archive of obsolete content
-type d \!
In-Depth - Archive of obsolete content
select that one and it lists a bunch of -x-image-region-left type styles in chrome://navigator/skin/.
Error Console - Archive of obsolete content
types of errors error usually a syntax error that prevents the program from compiling.
Documentation for BiDi Mozilla - Archive of obsolete content
improvements to lists with hebrew and arabic list-style-type summary of new classes class name xpcom interface (if applicable) implementation comments nsibidi intl\unicharutil\public\nsibidi.h intl\unicharutil\src\nsbidiimp.cpp implementation of the unicode bidi algorithm nsiubidiutils intl\unicharutil\public\nsiubidiutils.h intl\unicharutil\src\nsbidiutilsimp.cpp utilities for bidi processing, including: character classification symmetric swappin...
Repackaging Firefox - Archive of obsolete content
however, it's still recommended that you look through this tutorial, as it contains tips specific for creating extensions of this type, and there are a few options that you will need to set to ensure a smooth upgrade path for users.
Help Viewer - Archive of obsolete content
help viewer project page articles & tutorials creating a help content pack task-oriented, as opposed to spec-type stuff like the link below will be other resources content pack specification a technical description of it, meant primarily to solidify the idea of exactly what constitutes a content pack ...
Hidden prefs - Archive of obsolete content
the default (defined in mailnews.js) is: pref("mail.addr_book.mapit_url.format", "http://www.mapquest.com/maps/map.adp...st&zipcode=@zi"); addressbook quick search query pref ("mail.addr_book.quicksearchquery.format" ) the format for this pref is: @v == the escaped value typed in the quick search bar in the addressbook every occurance of @v will be replaced.
Basics - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
Page modifications - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
Content - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
Extenders - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
Libraries - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
First run - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
Enabling Experimental Jetpack Features - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
Me - Archive of obsolete content
ArchiveMozillaJetpackMetaMe
note: this page documents the jetpack prototype, which is no longer under active development.
Meta - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
Jetpack Snippets - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
File access - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
Simple Storage - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
Storage - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
Clipboard Test - Archive of obsolete content
features can get and set the clipboard in various flavors of data type.
System information - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
System - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
Notifications - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
Panel - Archive of obsolete content
ArchiveMozillaJetpackUIPanel
note: this page documents the jetpack prototype, which is no longer under active development.
Selection - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
Tabs - Archive of obsolete content
ArchiveMozillaJetpackUITabs
note: this page documents the jetpack prototype, which is no longer under active development.
slideBar - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
UI - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
Litmus tests - Archive of obsolete content
smoke tests there are types of litmus tests.
Makefile.mozextension.2 - Archive of obsolete content
r>$(project_author)</creator> <contributor>here is a place for you who helped me</contributor> <homepageurl>http://$(project).mozdev.org/</homepageurl> <optionsurl>chrome://$(project)/content/settings.xul</optionsurl> <abouturl>chrome://$(project)/content/about.xul</abouturl> <iconurl>chrome://$(project)/skin/mainicon.png</iconurl> <updateurl>http://$(project).mozdev.org/update.rdf</updateurl> <type>2</type> <targetapplication> <description> <id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</id> <minversion>2.0</minversion> <maxversion>9.0</maxversion> </description> </targetapplication> </description> </rdf> endef export install_rdf install.rdf: @echo generating $(project)/install.rdf @echo "$$install_rdf" > $(project)/install.rdf ###### define overlay_xul <overlay id="$...
Mozilla Application Framework in Detail - Archive of obsolete content
other features of xpcom: xpidl, a language for defining interfaces in a language-neutral way and the xpidl compiler can create header files, binary type libraries, documentation, and even generate stub c++ code for your component implementations.
Mozilla Crypto FAQ - Archive of obsolete content
export regulations were in essence a licensing scheme designed to impede or prohibit certain types of speech (e.g., publishing cryptographic source code in electronic form), and were therefore unconstitutional under the first amendment to the u.s.
Overview of how downloads work - Archive of obsolete content
one way is to encounter a file with an unknown content type, the other is to choose "save link target as" from the context menu of a link.
Plug-n-Hack Phase1 - Archive of obsolete content
this can cause the browser to inspect the manifest and register the tool by firing a customevent with the type configuresectool and a properties object which specifies the url of the tool manifest.
Installer - Archive of obsolete content
one interesting side effect is that after this change, you can select a link to a .webapp file in a web page and you get it run by prism - in ie this runs anywhere, but this won't work in firefox unless the webapp is being issued with an appropriate mime type on the server: application/x-webapp works (see an example ).
Hacking wiki - Archive of obsolete content
for anonymous access use: svn co http://svn.mozilla.org/projects/deve...lla.org/trunk/ to see the skins properly, you'll need to also check out <tt>mozilla-org/css</tt> to get the css files needed: export cvsroot=:pserver:anonymous@cvs-mirror.mozilla.org:/www cvs login cvs co mozilla-org/css (when prompted to enter a password, type <tt>anonymous</tt>) setting up copy the contents of the <tt>trunk</tt> folder and the <tt>css</tt> folder (note: the folder itself) into the <tt>www</tt> directory on your server.
Remote XUL - Archive of obsolete content
the remote xul manager extension lets you manage this whitelist, which is maintained using nsipermissionmanager, by creating entries of type "allowxulxbl", like this: components.classes["@mozilla.org/permissionmanager;1"] .getservice(components.interfaces.nsipermissionmanager) .add(uri, 'allowxulxbl', components.interfaces.nsipermissionmanager.allow_action); see using remote xul.
Space Manager High Level Design - Archive of obsolete content
the band of available space is searched (with nsblockreflowstate::getavailablespace); the float frame that is get from the passed nsfloatcache argument is reflowed and its rect is retrieved with getrect; the floats margins are added; check if the float can be placed in the actual band: if not advance to the next band; check the float type and if it can be added to the space manager; align the float to its containing block top if rule css2/9.5.1/4 is not respected; add the float using nsspacemanager::addrectregion compare the area that the float used to occupy with the area that it now occupies: if different, record the vertically affected interval using nsspacemanager::includeindamage use case 3: space manager is used to find...
String Quick Reference - Archive of obsolete content
med_literal_string(widestring, "some string"); callwidefunction(widestring); // use widestring again, but need a const prunichar* callwidewithflatstring(widestring.get()); // inline the string with ns_literal_string callwidefunction(ns_literal_string("another string")); converting literal strings to string objects what: converting from const prunichar*/const char* to the appropriate string type why: avoid making extra copies of strings, just to convert between types!
String Rosetta Stone - Archive of obsolete content
find a substring nsstring findinreadable(const nsastring& pattern, nsastring::const_iterator start, nsastring::const_iterator end, nsstringcomparator& acomparator = nsdefaultstringcomparator()) std::string size_type find(const basic_string& s, size_type pos = 0) const size_type find(const chart* s, size_type pos, size_type n) const size_type find(const chart* s, size_type pos = 0) const size_type find(chart c, size_type pos = 0) const qstring int qstring::indexof ( const qstring & str, int from = 0, qt::casesensitivity cs = qt::casesensitive ) const format a printf style string nsstring appendprintf() std::string n/a qstring qstring & qstring::sprintf ( const char * cformat, ...
Supporting private browsing mode - Archive of obsolete content
function privatebrowsinglistener() { this.init(); } privatebrowsinglistener.prototype = { _os: null, _inprivatebrowsing: false, // whether we are in private browsing mode _watcher: null, // the watcher object init : function () { this._inited = true; this._os = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); this._os.addobserver(this, "private-browsing", false); this._os.
Table Cellmap - Archive of obsolete content
79 // this union relies on the assumption that an object (not primitive type) does 80 // not start on an odd bit boundary.
Table Layout Strategy - Archive of obsolete content
for a given width type the maximum wins.
Running Tamarin acceptance tests - Archive of obsolete content
adb is used to access your android device and can run both direct and shell-type commands.
Tamarin build documentation - Archive of obsolete content
a prototype self-hosting ecmascript edition 4 compiler, esc, is provided with tamarin but it is not yet capable of bootstrapping itself or building applications.
Tamarin mercurial commit hook - Archive of obsolete content
the hook is located in the tamarin-redux repository in the file utils/hooks/tamarin-commit-hook.py this is a simple mercurial hook that checks the following filetypes ('.cpp', '.h', '.as', '.abs', '.py') for the following: tabs anywhere in the line trailing whitespace windows line endings (\r\n) "mark_security_change" - looks for this text and warns user as security changes should not be checked into the public tamarin-redux repository.
Treehydra Manual - Archive of obsolete content
treehydra provides the following callbacks to analysis scripts: process_tree_decl, process_tree, process_tree_type, and process_cp_pre_genericize.
Treehydra - Archive of obsolete content
for description of node types used in treehydra see tree.def and cp-tree.def in the gcc sources.
URIs and URLs - Archive of obsolete content
resources are identified by uri "uniform resource identifier" (taken from rfc 2396): uniform uniformity provides several benefits: it allows different types of resource identifiers to be used in the same context, even when the mechanisms used to access those resources may differ; it allows uniform semantic interpretation of common syntactic conventions across different types of resource identifiers; it allows introduction of new types of resource identifiers without interfering with the way that existing identifiers are used; and, it allows the identifiers to be reused in many different context...
Uriloader - Archive of obsolete content
overview of a uri load up though dispatch to a content handler helper application tech talk mime type determination in mozilla overview of how downloads work ...
Using addresses of stack variables with NSPR threads on win16 - Archive of obsolete content
the simplest demonstration of the problem is as follows: typedef struct shareddata { prlock *ml; prcondvar *cv; print32 counter; } shareddata; static void forkedthread(void *arg) { shareddata *shared = (shareddata*)arg; while (--shared->counter > 0) pr_waitcondvar(shared->cv, pr_interval_no_timeout); return; } /* forkedthread */ printn main(printn argc, char **argv) { prthread *thread; shareddata shared; shared...
Using cross commit - Archive of obsolete content
otherwise cross-commit will end up waiting forever for you to type a cvs checkin message in an editor that it never shows you!
When To Use ifdefs - Archive of obsolete content
types of ifdef there are two major types of ifdef: preprocessor ifdefs and makefile ifdefs.
Binding Attachment and Detachment - Archive of obsolete content
input[type="checkbox"] { -moz-binding: url("http://www.mozilla.org/xbl/htmlbindings.xml#checkbox"); } bindings attached through css will only remain on the bound element as long as the element continues to match the style rule.
Mac stub installer - Archive of obsolete content
then add the componentx into the appropriate setup types so the installer module installs when users select the setup types you choose it to be in.
registerChrome - Archive of obsolete content
method of install object syntax int registerchrome( switch, srcdir, xpipath); parameters the registerchrome method has the following parameters: switch switch is the chrome switch indicating what type of file is being registered.
Return Codes - Archive of obsolete content
registry key has been denied key_does_not_exist -242 registry key does not exist value_does_not_exist -243 registry value does not exist invalid_signature -260 the signature used in the xpi is not valid invalid_hash -261 the hash used in the xpi is not valid invalid_hash_type -262 the has used in the xpi is not of a valid type out_of_memory -299 insufficient memory for operation gestalt_unknown_error -5550 gestalt_invalid_argument -5551 ...
browserid - Archive of obsolete content
« xul reference home browserid type: string the id of the browser element to which the findbar is attached.
findnextaccesskey - Archive of obsolete content
« xul reference home findnextaccesskey type: string the access key for the "find next" toolbar button in the findbar.
findpreviousaccesskey - Archive of obsolete content
« xul reference home findpreviousaccesskey type: string the access key for the "find previous" toolbar button in the findbar.
highlightaccesskey - Archive of obsolete content
« xul reference home highlightaccesskey type: string the access key for the "highlight" toolbar button in the findbar.
highlightnonmatches - Archive of obsolete content
« xul reference home highlightnonmatches new in thunderbird 3 requires seamonkey 2.0 type: boolean if true, then the autocomplete field will be highlighted when no match has been found.
matchcaseaccesskey - Archive of obsolete content
« xul reference home matchcaseaccesskey type: string the access key for the "match case" checkbox in the findbar.
movetoclick - Archive of obsolete content
« xul reference home movetoclick type: boolean if true, clicking the slide area of the scale moves the thumb directly to that position.
norestorefocus - Archive of obsolete content
« xul reference home norestorefocus type: boolean if false, the default value, then when the panel is hidden, the keyboard focus will be restored to whatever had the focus before the panel was opened.
progressmeter.max - Archive of obsolete content
« xul reference home max type: integer the maximum value that progressmeter may have.
treelines - Archive of obsolete content
« xul reference home treelines type: boolean when set to true, lines are drawn connecting the lines in the tree; when false, the lines are not drawn.
accelerated - Archive of obsolete content
« xul reference homeaccelerated type: booleanset this attribute to true to allow hardware layer managers to accelerate the window.
acceltext - Archive of obsolete content
« xul reference home acceltext type: string text that appears beside the menu label to indicate the shortcut key (accelerator key) to use to invoke the command.
accessible - Archive of obsolete content
« xul reference home accessible type: nsiaccessible returns the accessibility object for the element.
accesskey - Archive of obsolete content
« xul reference home attribute of: button, checkbox, caption, description, label, listitem, menu, menuitem, menulist, tab, radio, toolbarbutton, textbox accesskey type: character this should be set to a character that is used as a shortcut key.
activetitlebarcolor - Archive of obsolete content
« xul reference home activetitlebarcolor type: color string specify background color of the window's titlebar when it is active (foreground).
afterselected - Archive of obsolete content
« xul reference home afterselected type: boolean this is set to true if the tab is immediately after the currently selected tab.
align - Archive of obsolete content
« xul reference home align type: one of the values below the align attribute specifies how child elements of the box are aligned, when the size of the box is larger than the total size of the children.
allowevents - Archive of obsolete content
« xul reference home allowevents type: boolean if true, events are passed to children of the element.
allownegativeassertions - Archive of obsolete content
« xul reference home allownegativeassertions type: boolean valid on any element that has a datasources attribute.
alternatingbackground - Archive of obsolete content
« xul reference home alternatingbackground obsolete since gecko 2.0 type: boolean if true, the background of the tree's rows will alternate between two colors.
alwaysopenpopup - Archive of obsolete content
« xul reference home alwaysopenpopup obsolete since gecko 1.9.1 type: boolean note: applies to: thunderbird and seamonkeyif true, the autocomplete popup will be displayed even when there are no matches.
attribute - Archive of obsolete content
« xul reference home attribute type: attribute name the attribute that the observer is observing.
autoFillAfterMatch - Archive of obsolete content
« xul reference home autofillaftermatch obsolete since gecko 1.9.1 type: boolean if set to true, the entire text of the best match will be displayed at the end of the input.
autocompleteenabled - Archive of obsolete content
« xul reference home autocompleteenabled type: boolean set to true to enable autocomplete of fields.
autocompletepopup - Archive of obsolete content
« xul reference home autocompletepopup type: id the id of a popup element used to hold autocomplete results for the element.
autocompletesearch - Archive of obsolete content
« xul reference home autocompletesearch new in thunderbird 2requires seamonkey 1.1 type: space-separated list of values a space-separated list of search component names, each of which implements the nsiautocompletesearch interface.
autocompletesearchparam - Archive of obsolete content
« xul reference home autocompletesearchparam new in thunderbird 3 requires seamonkey 1.1 type: string a string which is passed to the search component.
autofill - Archive of obsolete content
« xul reference home autofill new in thunderbird 3 requires seamonkey 2.0 type: boolean if set to true, the best match will be filled into the textbox as the user types.
autoscroll - Archive of obsolete content
« xul reference home autoscroll type: boolean set to false to disable autoscroll for this browser.
backdrag - Archive of obsolete content
« xul reference home backdrag type: boolean setting the backdrag attribute on a xul panel lets the user move the panel by clicking and dragging anywhere on its background area.
beforeselected - Archive of obsolete content
« xul reference home beforeselected type: boolean this is set to true if the tab is immediately before the currently selected tab.
bottom - Archive of obsolete content
« xul reference home bottom type: string (representing an integer) for elements placed directly within a stack, specifies the pixel position of the bottom edge of the element relative to the bottom edge of the stack.
buttonaccesskeyaccept - Archive of obsolete content
« xul reference home buttonaccesskeyaccept type: string the access key to use for the "accept" button.
buttonaccesskeycancel - Archive of obsolete content
« xul reference home buttonaccesskeycancel type: string the access key to use for the "cancel" button.
buttonaccesskeydisclosure - Archive of obsolete content
« xul reference home buttonaccesskeydisclosure type: string the access key to use for the "disclosure" button.
buttonaccesskeyextra1 - Archive of obsolete content
« xul reference home buttonaccesskeyextra1 type: string the access key to use for the first extra button.
buttonaccesskeyextra2 - Archive of obsolete content
« xul reference home buttonaccesskeyextra2 type: string the access key to use for the second extra button.
buttonaccesskeyhelp - Archive of obsolete content
« xul reference home buttonaccesskeyhelp type: string the access key to use for the "help" button.
buttonalign - Archive of obsolete content
« xul reference home buttonalign type: string the value of the align attribute for the box containing the buttons.
buttondir - Archive of obsolete content
« xul reference home buttondir type: string the value of the dir attribute for the box containing the buttons.
buttondisabledaccept - Archive of obsolete content
« xul reference home buttondisabledaccept type: boolean if true, the accept button is disabled.
buttonlabelaccept - Archive of obsolete content
« xul reference home buttonlabelaccept type: string the label to appear on the "accept" button.
buttonlabelcancel - Archive of obsolete content
« xul reference home buttonlabelcancel type: string the label to appear on the "cancel" button.
buttonlabeldisclosure - Archive of obsolete content
« xul reference home buttonlabeldisclosure type: string the label to appear on the "disclosure" button.
buttonlabelextra1 - Archive of obsolete content
« xul reference home buttonlabelextra1 type: string the label to appear on the first extra button.
buttonlabelextra2 - Archive of obsolete content
« xul reference home buttonlabelextra2 type: string the label to appear on the second extra button.
buttonlabelhelp - Archive of obsolete content
« xul reference home buttonlabelhelp type: string the label to appear on the "help" button.
buttonorient - Archive of obsolete content
« xul reference home buttonorient type: string the value of the orient attribute for the box containing the buttons.
buttonpack - Archive of obsolete content
« xul reference home buttonpack type: string the value of the pack attribute for the box containing the buttons.
buttons - Archive of obsolete content
« xul reference home buttons type: comma-separated list of the values below a comma-separated list of buttons to appear in the dialog box.
checkbox.src - Archive of obsolete content
« xul reference home src type: uri set this to an uri pointing to an image to appear in the checkbox.
chromemargin - Archive of obsolete content
« xul reference home chromemargin type: margin string controls the amount of chrome that should be visible on each side of the window.
class - Archive of obsolete content
« xul reference home class type: string the style class of the element.
clicktoscroll - Archive of obsolete content
« xul reference home clicktoscroll type: boolean clicktoscroll, if true, the arrows must be clicked to scroll the scrollbox content.
close - Archive of obsolete content
« xul reference home close type: boolean if the panel has a titlebar, set the panel's close attribute to true to have a close button appear on the titlebar.
closebutton - Archive of obsolete content
« xul reference home closebutton obsolete since gecko 1.9.2 type: boolean if this attribute is set to true, the tabs row will have a "new tab" button and "close" button on the ends.
closemenu - Archive of obsolete content
« xul reference home closemenu type: one of the values below indicates if the menu closes when the menuitem is activated.
coalesceduplicatearcs - Archive of obsolete content
« xul reference home coalesceduplicatearcs type: boolean valid on any element that has a datasources attribute.
collapse - Archive of obsolete content
« xul reference home collapse type: one of the values below determines which side of the splitter is collapsed when its grippy is clicked.
collapsed - Archive of obsolete content
« xul reference home collapsed type: boolean if true, then the element is collapsed and does not appear.
color - Archive of obsolete content
« xul reference home color type: color string the currently selected color.
cols - Archive of obsolete content
ArchiveMozillaXULAttributecols
« xul reference home cols type: integer for multiline textboxes, the number of columns to display.
command - Archive of obsolete content
« xul reference home command type: id set to the id of a command element that is being observed by the element.
commandupdater - Archive of obsolete content
« xul reference home commandupdater type: boolean if true, the commandset is used for updating commands.
completedefaultindex - Archive of obsolete content
« xul reference home completedefaultindex new in thunderbird 3 requires seamonkey 2.0 type: boolean if true, the best match value will be filled into the textbox as the user types.
completeselectedindex - Archive of obsolete content
« xul reference home completeselectedindex type: boolean if true, the text in the text field will be autocompleted as the user selects from the popup list.
panel.consumeoutsideclicks - Archive of obsolete content
« xul reference home consumeoutsideclicks type: boolean controls whether or not the event that caused the popup to be automatically dismissed (or "rolled up") should be consumed or be dispatched as a normal event.
container - Archive of obsolete content
« xul reference home container type: boolean set to true if the element is to act as a container which can have child elements.
containment - Archive of obsolete content
« xul reference home containment type: uri this attribute specifies rdf properties (an rdf predicate) that indicate that a resource is a container.
contentcontextmenu - Archive of obsolete content
« xul reference home contentcontextmenu type: id the id of a menupopup element serving as the context menu for the content area in the tabbrowser.
contenttooltip - Archive of obsolete content
« xul reference home contenttooltip type: id the id of a tooltip element to be used for the content area in the tabbrowser.
context - Archive of obsolete content
« xul reference home context type: id should be set to the value of the id of the popup element that should appear when the user context-clicks on the element.
contextmenu - Archive of obsolete content
« xul reference home contextmenu type: id alternate name for the context attribute, but also has a corresponding script property contextmenu.
control - Archive of obsolete content
« xul reference home control type: id this attribute specifies the id of the element with which the label is associated.
crop - Archive of obsolete content
ArchiveMozillaXULAttributecrop
« xul reference home crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute.
curpos - Archive of obsolete content
« xul reference home curpos type: integer the current position of the scrollbar, which ranges from 0 to the value of the maxpos attribute.
current - Archive of obsolete content
« xul reference home current type: boolean this attribute will be set to true if the listitem is the current item.
currentset - Archive of obsolete content
« xul reference home currentset not in seamonkey 1.x type: comma-separated string the current set of displayed items on the toolbar.
customindex - Archive of obsolete content
« xul reference home customindex not in seamonkey 1.x type: integer this value is the index of the toolbar in the list of the custom toolbars.
customizable - Archive of obsolete content
« xul reference home customizable not in seamonkey 1.x type: boolean set this attribute to true on toolbars that can be customized.
cycler - Archive of obsolete content
« xul reference home cycler type: boolean if true, then the column is a cycler column.
datasources - Archive of obsolete content
« xul reference home datasources type: space separated list of datasource uris a space-separated list of datasources that an element's template will use for content generation.
datepicker.value - Archive of obsolete content
« xul reference home value type: string the initial value of the datepicker in the form yyyy-mm-dd.
decimalplaces - Archive of obsolete content
« xul reference home decimalplaces type: integer the number of decimal places to display.
default - Archive of obsolete content
« xul reference home default type: boolean if true, the tooltip is used as the default popup for displaying tooltips in the window.
defaultButton - Archive of obsolete content
« xul reference home defaultbutton type: string normally this attribute should not be set, but if it is, it specifies the default button in the dialog.
defaultset - Archive of obsolete content
« xul reference home defaultset not in seamonkey 1.x type: comma-separated list of item ids the default set of displayed items on the toolbar.
description - Archive of obsolete content
« xul reference home description type: string descriptive text to appear in addition to the dialog title.
dir - Archive of obsolete content
ArchiveMozillaXULAttributedir
« xul reference home dir type: one of the values below the direction in which the child elements of the element are placed.
disableautocomplete - Archive of obsolete content
« xul reference home disableautocomplete new in thunderbird 3requires seamonkey 2.0 type: boolean if true, the autocomplete behavior will be disabled.
disableKeyNavigation - Archive of obsolete content
« xul reference home disablekeynavigation type: boolean if this attribute is not used, the user can navigate to specific items within the element by pressing keys corresponding to letters in the item's label.
disableautoselect - Archive of obsolete content
« xul reference home disableautoselect type: boolean if this attribute is true or omitted, the selected item on the menu will update to match what the user entered in the textbox.
disablechrome - Archive of obsolete content
« xul reference home disablechrome type: boolean set this attribute to true to disable chrome in the window.
disableclose - Archive of obsolete content
« xul reference home disableclose type: boolean if this attribute is true the close button will be disabled.
disabled - Archive of obsolete content
« xul reference home disabled type: boolean indicates whether the element is disabled or not.
disablefastfind - Archive of obsolete content
« xul reference homedisablefastfindtype: booleanput disablefastfind="true" on the root element of a xul document, which is intended to be loaded in a tab, to disable the find bar for the tab with this document.
disableglobalhistory - Archive of obsolete content
« xul reference home disableglobalhistory type: boolean disables global history for the docshell attached to the browser while keeping session history active.
disablehistory - Archive of obsolete content
« xul reference home disablehistory type: boolean disables both session and global history for the docshell attached to the browser.
disablesecurity - Archive of obsolete content
« xul reference home disablesecurity type: boolean set this attribute to true to disable the security ui for this browser.
dragging - Archive of obsolete content
« xul reference home dragging type: boolean this attribute will be set to true if the column is being dragged.
drawintitlebar - Archive of obsolete content
« xul reference home drawintitlebar type: boolean if this attribute is true, the top of the window's content area will begin at the top edge of the title bar, instead of below the title bar.
droppedLinkHandler - Archive of obsolete content
« xul reference home droppedlinkhandler type: function this function is called when links are dropped to the browser element, with the following arguments.
editable - Archive of obsolete content
« xul reference home editable type: boolean indicates that the value of the menulist can be modified by typing directly into the value field.
element - Archive of obsolete content
« xul reference home element type: id the id of the broadcaster element that the observer is observing.
empty - Archive of obsolete content
« xul reference home empty type: boolean set to true if the element is a container that contains no children.
emptytext - Archive of obsolete content
« xul reference home emptytext deprecated since gecko 2 type: string a string that appears in the textbox when it has no value.
enableColumnDrag - Archive of obsolete content
« xul reference home enablecolumndrag type: boolean when set to true, the user may drag the column headers around to change the order in which they are displayed.
enablehistory - Archive of obsolete content
enablehistory new in thunderbird 1requires seamonkey 2.0 type: boolean if true, an arrow button will appear on the end of the textbox which, when pressed, will open a dropdown menu of all available results.
equalsize - Archive of obsolete content
« xul reference home equalsize type: one of the values below this attribute can be used to make the children of the element equal in size.
eventnode - Archive of obsolete content
« xul reference home eventnode type: one of the values below indicates where keyboard navigation events are listened to.
events - Archive of obsolete content
« xul reference home events type: comma-separated list a comma-separated list of event names that the command updater will update upon.
expr - Archive of obsolete content
ArchiveMozillaXULAttributeexpr
« xul reference home expr type: string for xml queries, an xpath expression which returns results.
fadein - Archive of obsolete content
« xul reference home fadein type: boolean this attribute is set to true if the tab is fading in or out.
first-tab - Archive of obsolete content
« xul reference home first-tab type: boolean this attribute will be set to true for the first tab.
firstdayofweek - Archive of obsolete content
« xul reference home firstdayofweek type: integer which day of the week to display as the first day in the grid.
firstpage - Archive of obsolete content
« xul reference home firstpage type: boolean true if the wizard is on the first page.
fixed - Archive of obsolete content
« xul reference home fixed type: boolean if true, the size of the column in the tree cannot be adjusted by the user.
flags - Archive of obsolete content
« xul reference home flags type: space-separated list of the values below a set of flags used for miscellaneous purposes.
flex - Archive of obsolete content
ArchiveMozillaXULAttributeflex
« xul reference home flex type: string (representing an integer) indicates the flexibility of the element, which indicates how an element's container distributes remaining empty space among its children.
focused - Archive of obsolete content
« xul reference home focused type: boolean this attribute is true if the element is focused.
forcecomplete - Archive of obsolete content
« xul reference home forcecomplete new in thunderbird 3requires seamonkey 2.0 type: boolean if true, the textbox will be filled in with the best match when it loses the focus.
fullscreenbutton - Archive of obsolete content
« xul reference home fullscreenbutton type: boolean set this attribute to true to display a button in the window chrome to allow the user to switch the window into full screen mode.
grippyhidden - Archive of obsolete content
« xul reference home grippyhidden seamonkey only type: boolean when set to true, the grippy will be hidden.
grippytooltiptext - Archive of obsolete content
« xul reference home grippytooltiptext seamonkey only type: string the text to appear on the tooltip for the toolbar's grippy when the toolbar is collapsed.
group - Archive of obsolete content
« xul reference home group type: string group name buttons with type="radio" and the same value for their group attribute are put into the same group.
handleCtrlTab - Archive of obsolete content
« xul reference home 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.
height - Archive of obsolete content
« xul reference home height type: string (representing an integer) the preferred height of the element in pixels.
helpURI - Archive of obsolete content
« xul reference home helpuri type: uri the uri of the help page associated with a preference panel.
hidden - Archive of obsolete content
« xul reference home hidden type: boolean if set to true, the element is not displayed.
hidechrome - Archive of obsolete content
« xul reference home hidechrome type: boolean set this attribute to true to have the chrome including the titlebar hidden.
hidecolumnpicker - Archive of obsolete content
« xul reference home hidecolumnpicker type: boolean when set to false, a drop-down will appear in the upper right corner of the tree, which the user may use to show and hide columns.
hideheader - Archive of obsolete content
« xul reference home hideheader type: boolean set this to true to indicate that the tree column header should be displayed without any column header styling.
hideseconds - Archive of obsolete content
« xul reference home hideseconds type: boolean indicates whether to show the seconds field.
hidespinbuttons - Archive of obsolete content
« xul reference home hidespinbuttons type: boolean if true, the number box does not have arrow buttons next to it to allow the user to adjust the value.
homepage - Archive of obsolete content
« xul reference home homepage type: url this attribute allows you to set a homepage for the browser element.
href - Archive of obsolete content
ArchiveMozillaXULAttributehref
« xul reference home href type: string defines a url to open when this element is clicked.
icon - Archive of obsolete content
ArchiveMozillaXULAttributeicon
« xul reference home icon mozilla 1.8 type: string this attribute should be used to set the usage for common buttons.
iconsize - Archive of obsolete content
« xul reference home iconsize type: string indicates whether the toolbar should display large icons or small icons; this should be the string "large" or "small", respectively.
id - Archive of obsolete content
ArchiveMozillaXULAttributeid
« xul reference home id type: unique id a unique identifier so that you can identify the element with.
iframe.transparent - Archive of obsolete content
« xul reference hometransparenttype: one of the values belowset the background of an iframe as transparent.transparentthis results in the iframe's background being transparent.
ignoreblurwhilesearching - Archive of obsolete content
« xul reference home ignoreblurwhilesearching new in thunderbird 3requires seamonkey 2.0 type: boolean if true, blur events are ignored while searching, which means that the autocomplete popup will not disappear.
ignorecase - Archive of obsolete content
« xul reference home ignorecase type: boolean set to true to indicate that the case does not matter when making comparisons.
ignoreincolumnpicker - Archive of obsolete content
« xul reference home ignoreincolumnpicker type: boolean if true, the column does not appear in the column picker.
ignorekeys - Archive of obsolete content
« xul reference home ignorekeys type: boolean if true, keyboard navigation between items in the popup is disabled.
image.onload - Archive of obsolete content
« xul reference home image.onload type: script code this event handler will be called on the image element when the image has finished loading.
image - Archive of obsolete content
« xul reference home image type: uri the uri of the image to appear on the element.
inactivetitlebarcolor - Archive of obsolete content
« xul reference home inactivetitlebarcolor type: color string specify background color of the window's titlebar when it is inactive (background).
increment - Archive of obsolete content
« xul reference home increment type: integer the amount by which the curpos (for scroll bars) or value (for number boxes and scale) attribute changes when the arrows are clicked(or scales are dragged).
index - Archive of obsolete content
« xul reference home index type: integer the index within the sql statement of the parameter.
inputtooltiptext - Archive of obsolete content
« xul reference home inputtooltiptext type: string the tooltip text for the textbox.
insertafter - Archive of obsolete content
« xul reference home insertafter type: id when an element is in an overlay, the insertafter attribute specifies the id of the element in the base window that the element should appear after.
insertbefore - Archive of obsolete content
« xul reference home insertbefore type: id when an element is in an overlay, the insertbefore attribute specifies the id of the element in the base window that the element should appear before.
instantApply - Archive of obsolete content
« xul reference home instantapply type: boolean if true, the preference will be changed as soon as the user interface is modified.
inverted - Archive of obsolete content
« xul reference home inverted type: boolean for boolean preferences, if this attribute is set to true, it indicates that the value of the preference is the reverse of the user interface element attached to it.
iscontainer - Archive of obsolete content
« xul reference home iscontainer type: boolean indicates whether rules match based on containment.
isempty - Archive of obsolete content
« xul reference home isempty type: boolean indicates whether rules match based on emptyness.
key - Archive of obsolete content
ArchiveMozillaXULAttributekey
« xul reference home key type: character the character that must be pressed.
keycode - Archive of obsolete content
« xul reference home keycode type: string key code for keys that do not have displayable characters, such as the enter key or function keys, use this attribute instead of the key attribute.
keytext - Archive of obsolete content
« xul reference home keytext type: string a label for the keyboard shortcut.
label - Archive of obsolete content
« xul reference home label type: string the label that will appear on the element.
label.value - Archive of obsolete content
« xul reference home value type: string the text to be used for the label.
last-tab - Archive of obsolete content
« xul reference home last-tab type: boolean this attribute will be set to true for the last tab.
lastSelected - Archive of obsolete content
« xul reference home lastselected type: string set this to the id of the last selected pane.
lastpage - Archive of obsolete content
« xul reference home lastpage type: boolean true if the wizard is on the last page.
left - Archive of obsolete content
ArchiveMozillaXULAttributeleft
« xul reference home left type: string (representing an integer) for elements placed directly within a stack, specifies the pixel position of the left edge of the element relative to the left edge of the stack.
lightweightthemes - Archive of obsolete content
« xul reference home lightweightthemes type: boolean true if the window supports lightweight themes, otherwise false.
lightweightthemesfooter - Archive of obsolete content
« xul reference home lightweightthemesfooter type: id specifies the id of an element to which a lightweight theme's footer image will be applied.
linkedpanel - Archive of obsolete content
« xul reference home linkedpanel type: id the id of the linked tabpanel element that will be displayed when the tab is selected.
max - Archive of obsolete content
ArchiveMozillaXULAttributemax
« xul reference home type: integer the maximum value that the scale or number box may be set to.
maxheight - Archive of obsolete content
« xul reference home maxheight type: string (representing an integer) the maximum height of the element.
maxlength - Archive of obsolete content
« xul reference home maxlength type: integer the maximum number of characters that the textbox allows to be entered.
maxpos - Archive of obsolete content
« xul reference home maxpos type: integer the maximum position of the scrollbar.
maxrows - Archive of obsolete content
« xul reference home maxrows type: integer the number of rows to show in the results list at a time.
maxwidth - Archive of obsolete content
« xul reference home maxwidth type: string (representing an integer) the maximum width of the element.
member - Archive of obsolete content
« xul reference home member type: string may optionally be set to the variable to use as the member variable.
menu - Archive of obsolete content
ArchiveMozillaXULAttributemenu
« xul reference home menu type: id alternate name for the popup attribute, but also has a corresponding script property 'menu'.
menuactive - Archive of obsolete content
« xul reference home menuactive type: boolean this attribute is set on an item in a menu when it is being hovered over.
menuitem.key - Archive of obsolete content
« xul reference home key type: id set to the id of a key element whose key shortcut is displayed in the menuitem.
min - Archive of obsolete content
ArchiveMozillaXULAttributemin
« xul reference home min type: integer the minimum value the control's value may take.
minresultsforpopup - Archive of obsolete content
« xul reference home minresultsforpopup new in thunderbird 3requires seamonkey 2.0 type: integer the minimum number of results that must be returned for the popup to be displayed.
minheight - Archive of obsolete content
« xul reference home minheight type: string (representing an integer) the minimum height of the element.
minwidth - Archive of obsolete content
« xul reference home minwidth type: string (representing an integer) the minimum width of the element.
modifiers - Archive of obsolete content
« xul reference home modifiers type: space-separated list of the values below a list of modifier keys that should be pressed to invoke the keyboard shortcut.
mousethrough - Archive of obsolete content
« xul reference home mousethrough type: one of the values below determines whether mouse events are passed to the element or not.
multiline - Archive of obsolete content
« xul reference home multiline type: boolean if true, the textbox displays multiple lines.
multiple - Archive of obsolete content
« xul reference home multiple type: boolean set to true to indicate that the value contains multiple values separated by commas.
negate - Archive of obsolete content
« xul reference home negate type: boolean set to true to indicate that the comparison should be reversed.
newlines - Archive of obsolete content
« xul reference home newlines type: one of the values below how the text box handles pastes with newlines in them.
next - Archive of obsolete content
ArchiveMozillaXULAttributenext
« xul reference home next type: id set to the pageid of the next wizardpage after this one.
noautofocus - Archive of obsolete content
« xul reference home noautofocus type: boolean if false, the default value, the currently focused element will be unfocused whenever the popup is opened or closed.
noautohide - Archive of obsolete content
« xul reference home noautohide type: boolean if this attribute is set to false or omitted, the tooltip will automatically disappear after a few seconds.
noinitialfocus - Archive of obsolete content
« xul reference homenoinitialfocustype: booleanif false, the default value, the element is considered when determining which element should be initially focused in a dialog.
nomatch - Archive of obsolete content
« xul reference home nomatch type: boolean this attribute will be set to true if the last search resulted in no matches.
object - Archive of obsolete content
« xul reference home object type: string the object of the element.
observes - Archive of obsolete content
« xul reference home observes type: id set to an id of a broadcaster element that is being observed by the element.
onbeforeaccept - Archive of obsolete content
« xul reference home onbeforeaccept type: script code the code in this attribute is called when the ok button is pressed or the acceptdialog method is called.
onbookmarkgroup - Archive of obsolete content
« xul reference home onbookmarkgroup not in firefox type: script code this code executes when the user chooses the "bookmark this group of tabs" command.
onclick - Archive of obsolete content
« xul reference home onclick type: script code this event handler is called when the object is clicked.
onclosetab - Archive of obsolete content
« xul reference home onclosetab type: script code this script will be called when the close tab button is clicked.
oncommand - Archive of obsolete content
« xul reference home oncommand type: script code this event handler is called when the command is activated.
oncommandupdate - Archive of obsolete content
« xul reference home oncommandupdate type: script code this event occurs when a command update occurs.
onerror - Archive of obsolete content
« xul reference home onerror type: script code this event is sent to an image element when an error occurs loading the image.
onerrorcommand - Archive of obsolete content
« xul reference home onerrorcommand type: script code this event handler is called when an error occurs when selecting a result from the popup.
oninput - Archive of obsolete content
« xul reference home oninput type: script code this event is sent when a user enters text in a textbox.
onnewtab - Archive of obsolete content
« xul reference home onnewtab not in firefox type: script code this script will be called when the new tab button is clicked.
onpaneload - Archive of obsolete content
« xul reference home onpaneload type: script code code defined here is called when the pane has been loaded, much like the load event for a window.
onpopuphidden - Archive of obsolete content
« xul reference home onpopuphidden type: script code this event is sent to a popup after it has been hidden.
onpopuphiding - Archive of obsolete content
« xul reference home onpopuphiding type: script code this event is sent to a popup when it is about to be hidden.
onpopupshowing - Archive of obsolete content
« xul reference home onpopupshowing type: script code this event is sent to a popup just before it is opened.
onpopupshown - Archive of obsolete content
« xul reference home onpopupshown type: script code this event is sent to a popup after it has been opened, much like the onload event is sent to a window when it is opened.
onsearchbegin - Archive of obsolete content
« xul reference home onsearchbegin type: script code this event handler is called when the autocomplete search begins.
onsearchcomplete - Archive of obsolete content
« xul reference home onsearchcomplete new in thunderbird 3requires seamonkey 2.0 type: script code this event handler is called when the autocomplete search is finished and results are available.
ontextcommand - Archive of obsolete content
« xul reference home ontextcommand obsolete since gecko 1.9.1 type: script code note: applies to: thunderbird, seamonkeythis event handler is called when a result is selected for the textbox.
ontextentered - Archive of obsolete content
« xul reference home ontextentered new in thunderbird 3requires seamonkey 2.0 type: script code this event handler is called when a result is selected for the textbox.
ontextrevert - Archive of obsolete content
« xul reference home ontextrevert obsolete since gecko 1.9.1 type: script code note: applies to: thunderbird, seamonkey this event handler is called when the user presses escape to revert the textbox to its original uncompleted value.
ontextreverted - Archive of obsolete content
« xul reference home ontextreverted new in thunderbird 3requires seamonkey 2.0 type: script code this event handler is called when the user presses escape to revert the textbox to its original uncompleted value.
open - Archive of obsolete content
ArchiveMozillaXULAttributeopen
« xul reference home open type: boolean for the menu type buttons, the open attribute is set to true when the menu is open.
ordinal - Archive of obsolete content
« xul reference home ordinal type: string (representing an integer) an integer which specifies the position of the element within its parent.
orient - Archive of obsolete content
« xul reference home orient type: one of the values below used to specify whether the children of the element are oriented horizontally or vertically.
pack - Archive of obsolete content
ArchiveMozillaXULAttributepack
« xul reference home pack type: one of the values below the pack attribute specifies where child elements of the box are placed when the box is larger that the size of the children.
pageid - Archive of obsolete content
« xul reference home pageid type: id this attribute should be set to a string that identifies the page's identifer in the wizard.
pageincrement - Archive of obsolete content
« xul reference home 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.
pagestep - Archive of obsolete content
« xul reference home pagestep type: integer the index of the current page.
panel.fade - Archive of obsolete content
« xul reference homefadetype: one of the values belowthe fade attribute, which may only be used with arrow panels, lets you set up a panel that will automatically fade away after a short time.
panel.flip - Archive of obsolete content
« xul reference home flip type: string normally, when a popup opens near the edge of the screen, it flips over to open on the opposite side of the anchor, so that it doesn't extend off the screen.
panel.ignorekeys - Archive of obsolete content
« xul reference home ignorekeys type: boolean if false, the default value, the escape key may be used to close the panel.
panel.label - Archive of obsolete content
« xul reference home label type: string for panels with titlebars, the label on the titlebar.
panel.level - Archive of obsolete content
« xul reference home level type: one of the values below specifies whether the panel appears on top of all windows, or just on top of the window the panel is in.
panel.noautohide - Archive of obsolete content
« xul reference home noautohide type: boolean if false, the default value, the panel will be hidden when the user clicks outside the panel or switches focus to another application.
parent - Archive of obsolete content
« xul reference home parent type: element tag name if set, the rule will only match the corresponding tag.
pending - Archive of obsolete content
« xul reference home pending type: boolean this attribute is set to true if the tab is currently in the process of being restored by the session store service.
persist - Archive of obsolete content
« xul reference home persist type: space-separated list of attribute names a space-separated list of attributes that are maintained when the window is closed.
persistence - Archive of obsolete content
« xul reference home persistence type: integer the persistence may be set to a non-zero value so that the notificationbox's removetransientnotifications method does not remove them.
phase - Archive of obsolete content
« xul reference home phase type: string the event phase where the handler is invoked.
pickertooltiptext - Archive of obsolete content
« xul reference home pickertooltiptext type: string the text for the tooltip on the column picker.
pinned - Archive of obsolete content
« xul reference home pinned type: boolean this attribute is set to true if the tab has been pinned (that is, if it's an app tab).
placeholder - Archive of obsolete content
« xul reference home placeholder type: string a string that appears in the textbox when it has no value.
popup.left - Archive of obsolete content
« xul reference home left type: integer overrides the horizontal position of the popup specified by the showpopup method.
popup - Archive of obsolete content
« xul reference home popup type: id should be set to the value of the id of the popup element that should appear when the user clicks on the element.
popup.position - Archive of obsolete content
« xul reference home position type: string the position attribute determines where the popup appears relative to the element the user clicked to invoke the popup.
popup.top - Archive of obsolete content
« xul reference home top type: integer overrides the vertical position of the popup specified by the showpopup method.
popupalign - Archive of obsolete content
« xul reference homepopupaligntype: one of the values belowpopupalign is an optional attribute for specifying which side of the popup content should be attached to the popupanchor.
popupanchor - Archive of obsolete content
« xul reference homepopupanchortype: one of the values belowpopupanchor is an optional attribute for specifying where popup content should be anchored on the element.noneno anchortopleftanchor to the top left cornertoprightanchor to the top right cornerbottomleftanchor to the bottom left cornerbottomrightanchor to the bottom right cornersyntax<element popupanchor="none | topleft | topright | bottomleft | bottomright" /> example<element id="edit-context" popup="editor-popup" popupanchor="topleft" popupalign="bottomright" /> notesthe popupanchor attribute can be used to specify that the popup content should come up anchored to one of the four corners of the content object (e.g., the button popping up the content).
position - Archive of obsolete content
« xul reference home position type: string (representing an integer) when an element is in an overlay, the position is an index where the child is inserted.
predicate - Archive of obsolete content
« xul reference home predicate type: uri the predicate or property to match.
preference-editable - Archive of obsolete content
« xul reference home preference-editable mozilla 1.8 type: boolean if true, the element may be used as one that modifies a preference in a prefwindow.
preference.name - Archive of obsolete content
« xul reference home name type: string the name of the preference to change.
preference - Archive of obsolete content
« xul reference home preference type: id connects the element to a corresponding preference.
prefpane.selected - Archive of obsolete content
« xul reference home selected type: boolean this attribute will be set to true for the currently selected prefpane.
prefpane.src - Archive of obsolete content
« xul reference home src type: uri the uri of the overlay contents of preference pane.
prefwindow.onload - Archive of obsolete content
« xul reference home prefwindow.onload type: script code when a window finishes loading, it calls this event handler on the prefwindow element.
primary - Archive of obsolete content
« xul reference home primary type: boolean if set to true, the treecol will have indentation and twisties drawn to the left of it to indicate the hierarchy level of the rows.
priority - Archive of obsolete content
« xul reference home priority type: integer numeric value that specifies the order in which the notifications appear.
progressmeter.mode - Archive of obsolete content
« xul reference home mode type: one of the values below a determinedprogressmeter is used in cases where you know how long an operation will take.
progressmeter.value - Archive of obsolete content
« xul reference home value type: integer an integer ranging from 0 to the maximum value that indicates the progress.
properties - Archive of obsolete content
« xul reference home properties type: space-separated list of property names sets the properties of the element, which can be used to style the element.
query.name - Archive of obsolete content
« xul reference home name type: string the name of a parameter within the sql statement.
readonly - Archive of obsolete content
« xul reference home readonly type: boolean if set to true, then the user cannot change the value of the element.
ref - Archive of obsolete content
ArchiveMozillaXULAttributeref
« xul reference home ref type: uri for template-generated elements, this attribute is used to specify the root rdf node where content generation begins.
rel - Archive of obsolete content
ArchiveMozillaXULAttributerel
« xul reference home rel type: one of the values below the type of comparison to perform.
removeelement - Archive of obsolete content
« xul reference home removeelement type: id when placed on an element in an overlay, it indicates that the element in the base file should be removed from the window.
reserved - Archive of obsolete content
« xul reference home reserved type: string this attribute applies to a command element.
resizeafter - Archive of obsolete content
« xul reference home resizeafter type: one of the values below this attribute indicates which element to the right or below the splitter should be resized when the splitter is repositioned.
resizebefore - Archive of obsolete content
« xul reference home resizebefore type: one of the values below this attribute indicates which element to the left or above the splitter should be resized when the splitter is repositioned.
resizer.dir - Archive of obsolete content
« xul reference home dir type: one of the values below the direction that the window is resized.
resizer.element - Archive of obsolete content
« xul reference home element type: element to resize the id of the element that should be resized by the resizer.
right - Archive of obsolete content
« xul reference home right type: string (representing an integer) for elements placed directly within a stack, specifies the pixel position of the right edge of the element relative to the right edge of the stack.
rows - Archive of obsolete content
ArchiveMozillaXULAttributerows
« xul reference home rows type: integer the number of rows to display in the element.
screenX - Archive of obsolete content
« xul reference home screenx type: integer the horizontal position at which the window appears on the screen.
screenY - Archive of obsolete content
« xul reference home screeny type: integer the vertical position at which the window appears on the screen.
script.src - Archive of obsolete content
« xul reference home src type: uri the uri of the script.
searchlabel - Archive of obsolete content
« xul reference home searchlabel type: string text used for 'find-as-you-type' (fayt) searching.
selected - Archive of obsolete content
« xul reference home selected type: boolean indicates whether the element is selected or not.
selectedIndex - Archive of obsolete content
« xul reference home selectedindex type: integer gets and sets the index of the currently selected panel.
separator.orient - Archive of obsolete content
« xul reference home orient type: one of the values below used to specify whether the separator is a horizontal or vertical separator.
setfocus - Archive of obsolete content
« xul reference home setfocus type: boolean if true or omitted, the focus will be given to the first element in the corresponding tabpanel when the tabs are navigated via the keyboard.
showcommentcolumn - Archive of obsolete content
« xul reference home showcommentcolumn new in thunderbird 3requires seamonkey 2.0 type: boolean if true, a comment column appears in the popup.
showcaret - Archive of obsolete content
« xul reference home showcaret type: boolean whether or not to cause a typing caret to be visible in the content area.
showimagecolumn - Archive of obsolete content
« xul reference home showimagecolumn type: boolean if true, an image column appears in the popup.
showpopup - Archive of obsolete content
« xul reference home showpopup type: boolean note: applies to: thunderbird, seamonkeyif true, the popup will be shown.
size - Archive of obsolete content
ArchiveMozillaXULAttributesize
« xul reference home size type: integer the number of characters that can be displayed in the textbox.
sizemode - Archive of obsolete content
« xul reference home sizemode type: one of the values below the state of the window.
sizetopopup - Archive of obsolete content
« xul reference home sizetopopup type: one of the values below indicates how the menu width and the menupopup width are determined.
smoothscroll - Archive of obsolete content
« xul reference home smoothscroll type: boolean true initially enables smooth scrolling for the corresponding arrowscrollbox, false disables it.
sort - Archive of obsolete content
ArchiveMozillaXULAttributesort
« xul reference home sort type: uri or xml attribute set this to a rdf property or xml attribute to have the data in the column sorted based on that property.
sortActive - Archive of obsolete content
« xul reference home sortactive type: boolean this should be set to true for the column which should be sorted by default.
sortDirection - Archive of obsolete content
« xul reference home sortdirection type: one of the values below set this attribute to set the direction that template-generated content is sorted.
sortResource - Archive of obsolete content
« xul reference home sortresource type: uri for template-generated content, this specifies the sort key, if you would like the content to be sorted.
sortResource2 - Archive of obsolete content
« xul reference home sortresource2 type: uri the value of this attribute is the uri of an rdf predicate that serves as a secondary key for sorted content.
src - Archive of obsolete content
ArchiveMozillaXULAttributesrc
« xul reference home src type: uri the uri of the content to appear in the element.
state - Archive of obsolete content
« xul reference home state type: one of the values below indicates whether the splitter has collapsed content or not.
statedatasource - Archive of obsolete content
« xul reference home statedatasource type: uri chrome xul may specify an rdf datasource to use to store tree state information.
statusbar - Archive of obsolete content
« xul reference home 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.
statustext - Archive of obsolete content
« xul reference home statustext type: string used to set the text that appears on the status bar when the user moves the mouse over the element.
stringbundle.src - Archive of obsolete content
« xul reference home src type: uri the uri of the property file that contains the localized strings.
style - Archive of obsolete content
« xul reference home style type: css inline style css style rules to be applied to the element.
subject - Archive of obsolete content
« xul reference home subject type: string the subject of the element.
substate - Archive of obsolete content
« xul reference home substate type: one of the values below on splitters which have state="collapsed" and collapse="both", determines which direction the splitter is actually collapsed in.
suppressonselect - Archive of obsolete content
« xul reference home suppressonselect type: boolean if this attribute is not specified, a select event is fired whenever an item is selected, either by the user or by calling one of the select methods.
tab.selected - Archive of obsolete content
« xul reference home selected type: boolean this attribute is set to true if the tab is selected by default.
tabscrolling - Archive of obsolete content
« xul reference home tabscrolling new in thunderbird 3requires seamonkey 2.0 type: boolean if true, the user may cycle through the results list by pressing the tab key.
tabindex - Archive of obsolete content
« xul reference home tabindex type: integer the tab order of the element.
tabmodalPromptShowing - Archive of obsolete content
« xul reference home tabmodalpromptshowing type: integer the number of tab modal prompts currently attached to the current tab.
tabs.onselect - Archive of obsolete content
« xul reference home onselect type: script code this event is sent to the tabs element when this tab is changed.
targets - Archive of obsolete content
« xul reference home targets type: comma-separated list of element ids a comma-separated list of element ids that the command updater will update upon.
template.container - Archive of obsolete content
« xul reference home container type: string may optionally be set to the variable to use as the container or reference variable.
template - Archive of obsolete content
« xul reference home template type: id for template generated elements, this attribute may optionally be placed on the root node (the element with the datasources attribute) to refer to a template that exists elsewhere in the xul code.
textbox.autoFill - Archive of obsolete content
« xul reference home autofill obsolete since gecko 1.9.1 type: boolean note: applies to: thunderbird and seamonkeyif set to true, the best match will be filled into the textbox as the user types.
textbox.crop - Archive of obsolete content
« xul reference home crop type: boolean this attribute is not used and is only provided for compatibility with the menulist element.
textbox.disableAutocomplete - Archive of obsolete content
« xul reference home disableautocomplete obsolete since gecko 1.9.1 type: boolean if true, the autocomplete behavior will be disabled.
textbox.disablehistory - Archive of obsolete content
« xul reference home disablehistory obsolete since gecko 2.0 type: boolean note: applies to: thunderbird and seamonkeyif false, an arrow button will appear on the end of the textbox which will open a dropdown menu of all available results.
textbox.empty - Archive of obsolete content
« xul reference home empty type: boolean presence of this attribute indicates that the emptytext is now being displayed.
textbox.forceComplete - Archive of obsolete content
« xul reference home forcecomplete obsolete since gecko 1.9.1 type: boolean if true, the textbox will be filled in with the best match when it loses the focus.
textbox.ignoreBlurWhileSearching - Archive of obsolete content
« xul reference home ignoreblurwhilesearching obsolete since gecko 1.9.1 type: boolean if true, blur events are ignored while searching, which means that the autocomplete popup will not disappear.
textbox.label - Archive of obsolete content
« xul reference home label type: string if present and not empty, this will be exposed to screen readers through the label property.
textbox.min - Archive of obsolete content
« xul reference home min type: integer the minimum value the textbox's value may take.
textbox.minResultsForPopup - Archive of obsolete content
« xul reference home minresultsforpopup obsolete since gecko 1.9.1 type: integer the minimum number of results that must be returned for the popup to be displayed.
textbox.onblur - Archive of obsolete content
« xul reference home onblur type: script code this event is sent when a textbox loses keyboard focus.
textbox.onchange - Archive of obsolete content
« xul reference home onchange type: script code this event is sent when the value of the textbox is changed.
textbox.onfocus - Archive of obsolete content
« xul reference home onfocus type: script code this event is sent when a textbox receives keyboard focus.
textbox.showCommentColumn - Archive of obsolete content
« xul reference home showcommentcolumn obsolete since gecko 1.9.1 type: boolean if true, a comment column appears in the popup.
textbox.tabScrolling - Archive of obsolete content
« xul reference home tabscrolling obsolete since gecko 1.9.1 type: boolean if true, the user may cycle through the results list by pressing the tab key.
textbox.value - Archive of obsolete content
« xul reference home value type: string the default value entered in a textbox.
textnode.value - Archive of obsolete content
« xul reference home value type: uri the text value to display.
timepicker.increment - Archive of obsolete content
« xul reference home increment type: integer indicates the number of minutes to skip each time the arrows are pressed.
timepicker.value - Archive of obsolete content
« xul reference home value type: string the initial value of the timepicker in either the form hh:mm:ss or hh:mm.
title - Archive of obsolete content
« xul reference home title type: string the text to appear in the title bar of the window.
titlebar - Archive of obsolete content
« xul reference home titlebar type: string set the panel's titlebar attribute to the value normal to display a panel with a titlebar.
toolbar.mode - Archive of obsolete content
« xul reference home mode not in seamonkey 1.x type: one of the values below how the toolbarbuttons on the toolbar are displayed.
toolbarbutton.title - Archive of obsolete content
« xul reference home title type: string this functionality only applies when toolbarbutton is used in the customize toolbar dialog.
toolbarname - Archive of obsolete content
« xul reference home toolbarname not in seamonkey 1.x type: string the name of the toolbar, which is listed on the show/hide toolbars menu.
tooltip - Archive of obsolete content
« xul reference home tooltip type: id should be set to the value of the id of the tooltip or panel element that should be used as a tooltip window when the mouse hovers over the element for a moment.
tooltiptext - Archive of obsolete content
« xul reference home tooltiptext type: string used to set the text which appears in the tooltip when the user moves the mouse over the element.
tooltiptextnew - Archive of obsolete content
« xul reference home 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.
top - Archive of obsolete content
ArchiveMozillaXULAttributetop
« xul reference home top type: string (representing an integer) for elements placed directly within a stack, specifies the pixel position of the top edge of the element relative to the top edge of the stack.
tree.editable - Archive of obsolete content
« xul reference home editable type: boolean indicates that the cells of the tree may be edited.
tree.onselect - Archive of obsolete content
« xul reference home onselect type: script code this event is sent to a tree when a row is selected, or whenever the selection changes.
treecell.editable - Archive of obsolete content
« xul reference home editable type: boolean allows the contents of individual cells in the column to be changed, especially useful when <treecol type="checkbox">.
treecell.mode - Archive of obsolete content
« xul reference home mode type: one of the values below for columns that are progress meters, this determines the type of progress meter to use.
treecell.src - Archive of obsolete content
« xul reference home src type: uri set this to the uri of an image to appear in the tree cell.
treecol.editable - Archive of obsolete content
« xul reference home editable type: boolean allows the contents of cells in the column to be changed, especially useful when type="checkbox".
treecol.src - Archive of obsolete content
« xul reference home src type: uri set this attribute to have the treecol element use an image for the header instead of a label.
treecol.width - Archive of obsolete content
« xul reference home width type: string (representing an integer) the preferred width of the tree column.
onunload - Archive of obsolete content
« xul reference home onunload type: script code closing the window calls this event handler on the prefwindow element.
unread - Archive of obsolete content
« xul reference home unread type: boolean this attribute is set to true if the tab is unread; that is, either it has not yet been selected during the current session, or has changed since the last time it was selected.
uri - Archive of obsolete content
ArchiveMozillaXULAttributeuri
« xul reference home uri type: string for template-generated content, the attribute should be placed on the element where content generation should begin.
userAction - Archive of obsolete content
« xul reference home useraction type: one of the values below this attribute will be set to the action the user is currently performing.
validate - Archive of obsolete content
« xul reference home validate type: one of the values below this attribute indicates whether to load the image from the cache or not.
value - Archive of obsolete content
« xul reference home value type: string the string attribute allows you to associate a data value with an element.
var - Archive of obsolete content
ArchiveMozillaXULAttributevar
« xul reference home 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".
visuallyselected - Archive of obsolete content
« xul reference home visuallyselected type: boolean new in firefox 40.
wait-cursor - Archive of obsolete content
« xul reference home wait-cursor type: boolean set this attribute to true to have the cursor switch to a waiting cursor while the mouse is hovering over the element.
where.subject - Archive of obsolete content
« xul reference home subject type: string the variable or string to compare.
where.value - Archive of obsolete content
« xul reference home value type: string the value to compare.
width - Archive of obsolete content
« xul reference home width type: string (representing an integer) the preferred width of the element.
wrap - Archive of obsolete content
ArchiveMozillaXULAttributewrap
« xul reference home wrap type: string set this attribute to the value off to disable word wrapping in the textbox.
wraparound - Archive of obsolete content
« xul reference home wraparound type: boolean if true, the value of the number box will wrap around when the maximum or minimum value is exceeded.
Deprecated and defunct markup - Archive of obsolete content
--neil 03 march 2011 <bulletinboard> (made to support left/top styles, but <stack> can now do as well) <gripper> (inside of <scrollbar><thumb>; not to be used by itself) <listboxbody> (internal use only; part of xbl for <listbox>) <menubutton> (experiment in combining buttons and menus; use <button type> instead) <nativescrollbar> (displayed a native scrollbar; had been for mac only with native themes on) <outliner> (former name for <tree>; <listbox> had been "<tree>") <popup> (use menupopup) <package> (no longer present but in older documentation) <scrollbarbutton> (button at end of scrollbar; had been only within larger <scrollbar>) so, not deprecated, but internal use only?
Reading from Files - Archive of obsolete content
this method handles all the different types of end of line characters and combinations, so you do not need to worry about platform specific conventions.
International characters in XUL JavaScript - Archive of obsolete content
if the script file is loaded via http, the http header can contain a character encoding declaration as part of the content-type header, for example: content-type: application/javascript; charset=utf-8 if no charset parameter is specified, the same rules as above apply.
addTabsProgressListener - Archive of obsolete content
« xul reference home addtabsprogresslistener( listener ) return type: no return value add a progress listener to the browser which will monitor loaded documents in all tabs in the tabbed browser.
onFindAgainCommand - Archive of obsolete content
« xul reference home onfindagaincommand( findprevious ) return type: no return value call this method to handle your application's "find next" and "find previous" commands.
open - Archive of obsolete content
ArchiveMozillaXULMethodOpen
« xul reference home open( mode ) return type: no return value opens the findbar using the specified mode, which should be one of find_normal, find_typeahead, or find_links.
removeTabsProgressListener - Archive of obsolete content
« xul reference home removetabsprogresslistener( listener ) return type: no return value removes a progress listener to the browser which has been monitoring all tabs.
swapDocShells - Archive of obsolete content
« xul reference home swapdocshells( otherbrowser ) return type: no return value swaps the content, history and current state of this browser with another browser.
toggleHighlight - Archive of obsolete content
« xul reference home togglehighlight( highlight ) return type: no return value turns highlighting of text matching the search term on and off; specify false to disable highlighting or true to enable it.
acceptDialog - Archive of obsolete content
« xul reference home acceptdialog() return type: no return value accepts the dialog and closes it, similar to pressing the ok button.
addItemToSelection - Archive of obsolete content
« xul reference home additemtoselection( item ) return type: no return value selects the given item, without deselecting any other items that are already selected.
addPane - Archive of obsolete content
ArchiveMozillaXULMethodaddPane
« xul reference home addpane( prefpane ) return type: no return value append a prefpane to a list of panes.
addProgressListener - Archive of obsolete content
« xul reference home addprogresslistener( listener ) return type: no return value add a progress listener to the browser which will monitor loaded documents.
addSession - Archive of obsolete content
« xul reference home addsession( session ) obsolete since gecko 26 return type: nsiautocompletesession adds a new session object to the autocomplete widget.
addTab - Archive of obsolete content
ArchiveMozillaXULMethodaddTab
}) return type: tab element opens a new tab that loads a page with the specified url.
advance - Archive of obsolete content
ArchiveMozillaXULMethodadvance
« xul reference home advance( pageid ) return type: no return value call this method to go to the next page.
advanceSelectedTab - Archive of obsolete content
« xul reference home advanceselectedtab( dir, wrap ) return type: no return value if the argument dir is set to 1, the currently selected tab changes to the next tab.
appendCustomToolbar - Archive of obsolete content
« xul reference home appendcustomtoolbar( name, currentset ) firefox only return type: element adds a custom toolbar to the toolbox with the given name.
appendGroup - Archive of obsolete content
« xul reference home appendgroup( group ) return type: no return value not in firefox add several new tabs to the end of the existing tabs.
appendItem - Archive of obsolete content
« xul reference home appenditem( label, value ) return type: element creates a new item and adds it to the end of the existing list of items.
blur - Archive of obsolete content
ArchiveMozillaXULMethodblur
« xul reference home blur() return type: no return value if the focus is on the element, it is removed.
cancel - Archive of obsolete content
ArchiveMozillaXULMethodcancel
« xul reference home cancel() return type: no return value call this method to cancel and close the wizard.
cancelDialog - Archive of obsolete content
« xul reference home canceldialog() return type: no return value cancels the dialog and closes it, similar to pressing the cancel button.
centerWindowOnScreen - Archive of obsolete content
« xul reference home centerwindowonscreen() return type: no return value centers the dialog on the screen.
checkAdjacentElement - Archive of obsolete content
« xul reference home checkadjacentelement( dir ) return type: no return value deselects the currently selected radio button in the group and selects the one adjacent to it.
clearResults - Archive of obsolete content
« xul reference home clearresults() return type: ???
clearSelection - Archive of obsolete content
« xul reference home clearselection() return type: no return value deselects all of the items.
click - Archive of obsolete content
ArchiveMozillaXULMethodclick
« xul reference home click() return type: no return value calls the onclick handler for the element.
close - Archive of obsolete content
ArchiveMozillaXULMethodclose
« xul reference home close() return type: no return value closes the notification or findbar and removes it from its enclosing notificationbox or findbar.
collapseToolbar - Archive of obsolete content
« xul reference home collapsetoolbar( toolbar ) not in firefox return type: no return value collapse the given toolbar which should be contained within the toolbox.
contains - Archive of obsolete content
« xul reference home contains( item ) return type: boolean returns true if the menulist contains the specified menuitem as one of its items.
decrease - Archive of obsolete content
« xul reference home method of: scale textbox decrease() return type: no return value decreases the value of the scale or number box by the increment.
decreasePage - Archive of obsolete content
« xul reference home method of: scale decreasepage() return type: no return value decreases the value of the scale by the pageincrement.
doCommand - Archive of obsolete content
« xul reference home docommand() return type: no return value executes the command event for the element.
ensureElementIsVisible - Archive of obsolete content
« xul reference home ensureelementisvisible( element ) return type: no return value if the specified element is not currently visible to the user, the displayed items are scrolled so that it is.
ensureIndexIsVisible - Archive of obsolete content
« xul reference home ensureindexisvisible( index ) return type: no return value if the item at the specified index is not currently visible to the user the displayed items are scrolled so that it is.
ensureSelectedElementIsVisible - Archive of obsolete content
« xul reference home ensureselectedelementisvisible() return type: no return value if the currently selected element in the list box is not currently visible to the user, the list box view is scrolled so that it is.
expandToolbar - Archive of obsolete content
« xul reference home expandtoolbar( toolbar ) not in firefox return type: no return value expand the given toolbar which should be contained in the toolbox.
extra1 - Archive of obsolete content
ArchiveMozillaXULMethodextra1
« xul reference home extra1() return type: no return value call this method to simulate clicking the extra1 button.
extra2 - Archive of obsolete content
ArchiveMozillaXULMethodextra2
« xul reference home extra2() return type: no return value call this method to simulate clicking the extra2 button.
focus - Archive of obsolete content
ArchiveMozillaXULMethodfocus
« xul reference home focus() return type: no return value assigns the focus to the element, if it can accept the focus.
getBrowserAtIndex - Archive of obsolete content
« xul reference home getbrowseratindex( index ) return type: browser element returns a browser at the specified tab index.
getBrowserForDocument - Archive of obsolete content
« xul reference home getbrowserfordocument( document ) return type: browser element returns a browser for the specified document.
getBrowserForTab - Archive of obsolete content
« xul reference home getbrowserfortab( tab ) return type: browser element returns a browser for the specified tab element.
getBrowserIndexForDocument - Archive of obsolete content
« xul reference home getbrowserindexfordocument( document ) return type: integer returns the index of the browser for the specified document in the tabbrowser the method was invoked on.
getButton - Archive of obsolete content
« xul reference home getbutton( type ) return type: button element returns the button element in the dialog corresponding to the given type.
getDefaultSession - Archive of obsolete content
« xul reference home getdefaultsession return type: session name returns the name of the first session with available results.
getEditor - Archive of obsolete content
« xul reference home geteditor( window ) return type: nsieditor returns the editing interface for the editor which contains numerous methods for manipulating the document.
getElementsByAttribute - Archive of obsolete content
« xul reference home getelementsbyattribute( attrib, value ) return type: dom nodelist returns a nodelist of all the child elements of the element that have the attribute given by the first argument set to the value given by the second argument.
getElementsByAttributeNS - Archive of obsolete content
« xul reference home getelementsbyattributens(ns, attrib, value ) return type: dom nodelist returns an array of all the child elements of the element that have the attribute namespace given by the first argument, the attribute name given by the second argument, and the value given by the third argument.
getFormattedString - Archive of obsolete content
« xul reference home getformattedstring( key, strarray ) return type: string looks up the format string for the given key name in the string bundle and returns a formatted copy where each occurrence of %s (uppercase) is replaced by each successive element in the supplied array.
getHTMLEditor - Archive of obsolete content
« xul reference home gethtmleditor( window ) return type: nsihtmleditor returns the html editing interface for the editor which contains methods for manipulating an html document.
getIcon - Archive of obsolete content
ArchiveMozillaXULMethodgetIcon
« xul reference home geticon( atab ) return type: string returns the url of the specified tab's favicon.
getIndexOfFirstVisibleRow - Archive of obsolete content
« xul reference home getindexoffirstvisiblerow() return type: integer returns the index of the first displayed row.
getIndexOfItem - Archive of obsolete content
« xul reference home getindexofitem( item ) return type: integer returns the zero-based position of the specified item.
getItemAtIndex - Archive of obsolete content
« xul reference home getitematindex( index ) return type: element returns the element that is at the specified index.
getNextItem - Archive of obsolete content
« xul reference home getnextitem( startitem, delta ) return type: element this method returns the item a given distance (delta) after the specified startitem, or null if no such item exists.
getNotificationBox - Archive of obsolete content
« xul reference home getnotificationbox( browser ) return type: notificationbox element returns a notificationbox for the specified browser element.
getNotificationWithValue - Archive of obsolete content
« xul reference home getnotificationwithvalue( value ) return type: notification element retrieve the notification with a particular value.
getNumberOfVisibleRows - Archive of obsolete content
« xul reference home getnumberofvisiblerows() return type: integer returns the number of rows that are currently visible to the user.
getPageById - Archive of obsolete content
« xul reference home getpagebyid( pageid ) return type: wizardpage element returns the wizardpage element corresponding to the specified pageid.
getPreviousItem - Archive of obsolete content
« xul reference home getpreviousitem( startitem, delta ) return type: element this method returns the item a given distance (delta) before the specified startitem, or null if no such item exists.
getResultValueAt - Archive of obsolete content
« xul reference home getresultvalueat( index ) return type: result value returns the result value at the specified index.
getRowCount - Archive of obsolete content
« xul reference home getrowcount() return type: integer returns the total number of rows in the element, regardless of how many rows are displayed.
getSearchAt - Archive of obsolete content
« xul reference home getsearchat( index ) return type: string returns the search component with the given index.
getSelectedItem - Archive of obsolete content
« xul reference home getselecteditem( index ) return type: element when multiple items are selected, you can retrieve each selected item using this method.
getSessionResultAt - Archive of obsolete content
« xul reference home getsessionresultat( session, index ) obsolete since gecko 26 return type: result item returns the result item at the specified index for the specified session.
getSessionStatusAt - Archive of obsolete content
« xul reference home getsessionstatusat( index ) obsolete since gecko 26 return type: any value listed in nsiautocompletestatus returns the status for the session object with the given index.
getSessionValueAt - Archive of obsolete content
« xul reference home getsessionvalueat( session, index ) return type: result value returns the result value at the specified index for a specific session.
getString - Archive of obsolete content
« xul reference home getstring( key ) return type: string returns the string with the given key name from the string bundle.
getTabForBrowser - Archive of obsolete content
« xul reference home gettabforbrowser( browser ) return type: tab returns the xul tab which contains the specified browser.
getTabModalPromptBox - Archive of obsolete content
« xul reference home gettabmodalpromptbox( browser ) return type: object returns an object that manages tab-modal prompts for the specified browser.
goBack - Archive of obsolete content
ArchiveMozillaXULMethodgoBack
« xul reference home goback() return type: no return value go back one page in the history.
goBackGroup - Archive of obsolete content
« xul reference home gobackgroup() not in firefox return type: no return value returns to the previous group of tabs.
goDown - Archive of obsolete content
ArchiveMozillaXULMethodgoDown
« xul reference home godown() return type: no return value move the selection down by one item.
goForward - Archive of obsolete content
« xul reference home goforward() return type: no return value go forward one page in the history.
goForwardGroup - Archive of obsolete content
« xul reference home goforwardgroup() not in firefox return type: no return value go forward to the next group of tabs.
goHome - Archive of obsolete content
ArchiveMozillaXULMethodgoHome
« xul reference home gohome() return type: no return value load the user's home page into the browser.
goTo - Archive of obsolete content
ArchiveMozillaXULMethodgoTo
« xul reference home goto( pageid ) return type: no return value this method is used to change which page is currently displayed, specified by the pageid argument.
goUp - Archive of obsolete content
ArchiveMozillaXULMethodgoUp
« xul reference home goup() return type: no return value move the selection up by one item.
gotoIndex - Archive of obsolete content
« xul reference home gotoindex( index ) return type: no return value navigate to the page in the history with the given index.
hasUserValue - Archive of obsolete content
« xul reference home hasuservalue() return type: boolean returns true if the preference has been changed from its default value.
hidePopup - Archive of obsolete content
« xul reference home method of: popup, menupopup, tooltip hidepopup() return type: no return value closes the popup immediately.
increase - Archive of obsolete content
« xul reference home method of: scale textbox increase() return type: no return value increases the value of the scale or number box by the increment.
increasePage - Archive of obsolete content
« xul reference home method of: scale increasepage() return type: no return value increases the value of the scale by the page increment.
insertItem - Archive of obsolete content
« xul reference home insertitem( id, beforenode, wrapper, beforepermanent ) not in seamonkey 1.x return type: element add an item with the given id to the toolbar.
insertItemAt - Archive of obsolete content
« xul reference home insertitemat( index, label, value ) return type: element this method creates a new item and inserts it at the specified position.
invertSelection - Archive of obsolete content
« xul reference home invertselection() return type: no return value reverses the selected state of all items.
loadGroup - Archive of obsolete content
« xul reference home loadgroup( group ) not in firefox return type: the first tab loads a group of pages into multiple tabs.
loadOneTab - Archive of obsolete content
}) return type: tab element opens a new tab that loads a page with the specified url.
loadTabs - Archive of obsolete content
« xul reference home loadtabs( uris, loadinbackground, replace ) loadtabs( uris, params ) return type: no return value loads a set of uris, specified by the array uris, into tabs.
loadURI - Archive of obsolete content
ArchiveMozillaXULMethodloadURI
(this one has no post data parameter, see loaduriwithflags for a version that does) loaduri( uri, referrer, charset ) return type: no return value load a url into the document, with the given referrer and character set.
loadURIWithFlags - Archive of obsolete content
« xul reference home loaduriwithflags( uri, flags, referrer, charset, postdata ) return type: no return value load a url into the document, with the specified load flags, the given referrer, character set, and post data.
menulist.appendItem - Archive of obsolete content
« xul reference home appenditem( label, value, description ) return type: element creates a new menuitem element and adds it to the end of the menulist.
menulist.select - Archive of obsolete content
« xul reference home select() return type: no return value select all the text in the menulist's textbox.
moveByOffset - Archive of obsolete content
« xul reference home movebyoffset( offset , isselecting, isselectingrange) return type: no return value if offset is positive, adjusts the focused item forward by that many items.
moveTabTo - Archive of obsolete content
« xul reference home movetabto(tab, index) return type: tab element tries to moves an existing tab to a given index.
moveTo - Archive of obsolete content
ArchiveMozillaXULMethodmoveTo
« xul reference home moveto( x, y ) return type: no return value moves the popup to a new location defined by screen coordinates (and not client coordinates).
moveToAlertPosition - Archive of obsolete content
« xul reference home movetoalertposition() return type: no return value moves and resizes the dialog to a position and size suitable for an alert box.
onSearchComplete - Archive of obsolete content
« xul reference home onsearchcomplete() return type: no return value calls the onsearchcomplete event handler.
onTextEntered - Archive of obsolete content
« xul reference home ontextentered() return type: event result calls the ontextentered event handler.
onTextReverted - Archive of obsolete content
« xul reference home ontextreverted() return type: event result calls the ontextreverted event handler.
openPopupAtScreen - Archive of obsolete content
« xul reference home openpopupatscreen( x, y, iscontextmenu ) return type: no return value open the popup at a specific screen position specified by x and y.
pinTab - Archive of obsolete content
ArchiveMozillaXULMethodpinTab
« xul reference home pintab( tabelement ) return type: no return value pins the specified tab element as an app tab.
preferenceForElement - Archive of obsolete content
« xul reference home preferenceforelement( uielement ) return type: preference element returns the preference element to which a user interface element is attached.
reload - Archive of obsolete content
ArchiveMozillaXULMethodreload
« xul reference home reload() return type: no return value reloads the document in the browser element on which you call this method.
reloadAllTabs - Archive of obsolete content
« xul reference home reloadalltabs() return type: no return value reloads the contents of all the tabs.
reloadTab - Archive of obsolete content
« xul reference home reloadtab( tab ) return type: no return value reloads the contents of a specific tab.
reloadWithFlags - Archive of obsolete content
« xul reference home reloadwithflags( flags ) return type: no return value reloads the document in the browser with the given load flags.
removeAllItems - Archive of obsolete content
« xul reference home removeallitems() return type: no return value removes all of the items in the menu.
removeAllNotifications - Archive of obsolete content
« xul reference home removeallnotifications( immediate ) return type: no return value remove all notifications.
removeAllTabsBut - Archive of obsolete content
« xul reference home removealltabsbut( tabelement ) return type: no return value removes all of the tab panels except for the one corresponding to the specified tab.
removeCurrentNotification - Archive of obsolete content
« xul reference home removecurrentnotification() return type: no return value remove the current notification.
removeCurrentTab - Archive of obsolete content
« xul reference home removecurrenttab() return type: tab element removes the currently displayed tab page.
removeItemAt - Archive of obsolete content
« xul reference home removeitemat( index ) return type: element removes the child item in the element at the specified index.
removeItemFromSelection - Archive of obsolete content
« xul reference home removeitemfromselection( item ) return type: no return value deselects the specified item without deselecting other items.
removeNotification - Archive of obsolete content
« xul reference home removenotification( item ) return type: element remove a notification, displaying the next one if the removed item is the current one.
removeProgressListener - Archive of obsolete content
« xul reference home removeprogresslistener( listener ) return type: no return value remove a nsiwebprogresslistener from the browser.
removeSession - Archive of obsolete content
« xul reference home removesession( session ) obsolete since gecko 26 return type: void removes a session object from the autocomplete widget.
removeTab - Archive of obsolete content
« xul reference home removetab( tabelement ) return type: no return value removes a specific tabbed page corresponding to the given tab element.
removeTransientNotifications - Archive of obsolete content
« xul reference home removetransientnotifications( ) return type: no return value remove only those notifications that have a persistence value of zero, and decrements by one the persistence value of those that have a non-zero value.
replaceGroup - Archive of obsolete content
« xul reference home replacegroup( group ) not in firefox return type: array of session history objects replaces existing tabs with a new set.
reset - Archive of obsolete content
ArchiveMozillaXULMethodreset
« xul reference home reset() return type: no return value resets the preference to its default value.
rewind - Archive of obsolete content
ArchiveMozillaXULMethodrewind
« xul reference home rewind() return type: no return value call this method to go back a page.
scrollByIndex - Archive of obsolete content
« xul reference home scrollbyindex( lines ) return type: no return value scrolls the contents of the arrowscrollbox by a certain number of lines.
scrollByPixels - Archive of obsolete content
« xul reference home scrollbypixels( pixels ) return type: no return value scrolls the contents of the arrowscrollbox by a certain number of pixels.
scrollToIndex - Archive of obsolete content
« xul reference home scrolltoindex( index ) return type: no return value scrolls the element to the specified index.
select - Archive of obsolete content
ArchiveMozillaXULMethodselect
« xul reference home select() return type: no return value selects all the text in the textbox.
selectAll - Archive of obsolete content
« xul reference home selectall() return type: no return value selects all of the items.
selectItem - Archive of obsolete content
« xul reference home selectitem( item ) return type: no return value deselects all of the currently selected items and selects the given item.
selectItemRange - Archive of obsolete content
« xul reference home selectitemrange( startitem, enditem ) return type: no return value selects the items between the two items given as arguments, including the start and end items.
selectTabAtIndex - Archive of obsolete content
« xul reference home selecttabatindex( index, event ) return type: no return value selects the tab at the given index.
setIcon - Archive of obsolete content
ArchiveMozillaXULMethodsetIcon
« xul reference home seticon( atab, auri ) return type: no return value sets the specified tab's favicon to the image specified by auri.
setSelectionRange - Archive of obsolete content
« xul reference home setselectionrange( start, end ) return type: no return value sets the selected portion of the textbox, where the start argument is the index of the first character to select and the end argument is the index of the character after the selection.
showOnlyTheseTabs - Archive of obsolete content
« xul reference home showonlythesetabs( atabs ) return type: no return value makes all tabs in the atabs array visible, and all other tabs hidden.
showPane - Archive of obsolete content
« xul reference home showpane( prefpane ) return type: no return value switch to a particular pane.
sizeTo - Archive of obsolete content
ArchiveMozillaXULMethodsizeTo
« xul reference home sizeto( width, height ) return type: no return value changes the current size of the popup to the new width and height.
startEditing - Archive of obsolete content
« xul reference home startediting( row, column ) return type: no return value activates user editing of the given cell, which is specified by row index number and the nsitreecolumn in which it is located.
stop - Archive of obsolete content
ArchiveMozillaXULMethodstop
« xul reference home stop() return type: no return value equivalent to pressing the stop button, this method stops the currently loading document.
stopEditing - Archive of obsolete content
« xul reference home stopediting( shouldaccept ) return type: no return value stops editing the cell currently being edited.
syncSessions - Archive of obsolete content
« xul reference home syncsessions( autocompleteelement ) obsolete since gecko 26 return type: void copy the sessions from another autocomplete element.
timedSelect - Archive of obsolete content
« xul reference home timedselect( item, timeout ) return type: no return value selects the item specified by the argument item after the number of milliseconds given by the timeout argument.
toggleItemSelection - Archive of obsolete content
« xul reference home toggleitemselection( item ) return type: no return value if the specified item is selected, it is deselected.
unpinTab - Archive of obsolete content
« xul reference home unpintab( tabelement ) return type: no return value unpins the specified tab element, making it no longer an app tab.
Namespaces - Archive of obsolete content
any element type or attribute name in an xml namespace can be uniquely identified by its xml namespace and its "local name".
Floating Panels - Archive of obsolete content
a floating panel may contain any type of element.
PopupEvents - Archive of obsolete content
however, this technique can be applied to any type of popup.
Tooltips - Archive of obsolete content
the tooltip element tooltips are displayed using a tooltip element, which is a type of popup, but is styled to look different.
browser - Archive of obsolete content
« xul reference browser type: browser element lets you set and get the browser in which the findbar is located.
flexGroup - Archive of obsolete content
« xul referenceflexgrouptype: integergets and sets the value of the flexgroup attribute.
hasUserValue - Archive of obsolete content
« xul reference hasuservalue type: boolean true if the preference has been changed from its default value.
highlightNonMatches - Archive of obsolete content
« xul reference highlightnonmatches new in thunderbird 1 requires seamonkey 1.0 type: boolean gets and sets the value of the highlightnonmatches attribute.
searchButton - Archive of obsolete content
« xul reference searchbutton type: boolean gets and sets the value of the searchbutton attribute.
accessKey - Archive of obsolete content
« xul reference accesskey type: character gets and sets the value of the accesskey attribute.
accessible - Archive of obsolete content
« xul reference accessible type: nsiaccessible returns the accessibility object for the element.
align - Archive of obsolete content
ArchiveMozillaXULPropertyalign
« xul reference align type: string gets and sets the value of the align attribute.
allNotifications - Archive of obsolete content
« xul reference allnotifications type: nodelist nodelist of all notifications.
allowEvents - Archive of obsolete content
« xul reference allowevents type: boolean gets and sets the value of the allowevents attribute.
alwaysOpenPopup - Archive of obsolete content
« xul reference alwaysopenpopup obsolete since gecko 1.9.1 type: boolean gets and sets the value of the alwaysopenpopup attribute.
amIndicator - Archive of obsolete content
« xul reference amindicator type: string the string value displayed for hours between midnight and noon, defaulting to am.
anchorNode - Archive of obsolete content
« xul reference anchornode type: nsidomelement this read-only property holds the dom node that was specified as the anchor when opening the popup.
appLocale - Archive of obsolete content
« xul reference applocale obsolete since gecko 1.9.1 type: nsilocale returns the xpcom object which holds information about the user's locale.
autoCheck - Archive of obsolete content
« xul reference autocheck type: boolean gets and sets the value of the autocheck attribute.
autoFill - Archive of obsolete content
« xul reference autofill type: boolean gets and sets the value of the autofill (or autofill) attribute.
autoFillAfterMatch - Archive of obsolete content
« xul reference autofillaftermatch obsolete since gecko 1.9.1 type: boolean gets and sets the value of the autofillaftermatch attribute.
boxObject - Archive of obsolete content
« xul reference boxobject type: nsiboxobject this property is available for elements that are derived from boxes, which is most displayable xul elements.
browser.preferences - Archive of obsolete content
« xul reference preferences type: nsiprefservice this read-only property contains an nsipref object for getting and setting user preferences.
browsers - Archive of obsolete content
« xul reference browsers type: nodelist of browser elements holds a list of the browser elements inside the tabbrowser.
builder - Archive of obsolete content
« xul reference builder type: nsixultemplatebuilder for content generated from a template, this is the xpcom object that is responsible for generating the content.
builderView - Archive of obsolete content
« xul reference builderview type: nsixultreebuilder a reference to the tree builder which constructed the tree data.
buttons - Archive of obsolete content
« xul reference buttons type: comma-separated list of the values below a comma-separated list of buttons to appear on the dialog box.
canAdvance - Archive of obsolete content
« xul reference canadvance type: boolean this property is set to true if the user can press the next button to go to the next page.
canGoBack - Archive of obsolete content
« xul reference 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 - Archive of obsolete content
« xul reference cangoforward type: boolean this read-only property is true if there is a page to go forward to in the session history and the forward button should be enabled.
canRewind - Archive of obsolete content
« xul reference canrewind type: boolean this property is set to true if the user can press the back button to go to the previous page.
checkState - Archive of obsolete content
« xul reference checkstate type: integer, values 0, 1, or 2 gets and sets the value of the checkstate attribute.
checked - Archive of obsolete content
« xul reference checked type: boolean gets and sets the value of the checked attribute.
child - Archive of obsolete content
ArchiveMozillaXULPropertychild
« xul reference child type: ?
children - Archive of obsolete content
« xul reference children type: array of elements returns the list of items in the richlistbox.
className - Archive of obsolete content
« xul reference classname type: string gets and sets the value of the class attribute.
clickSelectsAll - Archive of obsolete content
« xul reference clickselectsall type: boolean if set to true, the contents of the textbox are selected when focused; otherwise, the cursor is left unchanged.
collapsed - Archive of obsolete content
« xul reference collapsed type: boolean gets and sets the value of the collapsed attribute.
color - Archive of obsolete content
ArchiveMozillaXULPropertycolor
« xul reference color type: color string the currently selected color.
colorpicker.open - Archive of obsolete content
« xul reference open type: boolean returns true if the popup for a button-type colorpicker is open.
columns - Archive of obsolete content
« xul reference columns type: nsitreecolumns returns the columns for the tree as an nsitreecolumns object.
command - Archive of obsolete content
« xul reference command type: element id gets and sets the value of the command attribute.
commandManager - Archive of obsolete content
« xul reference commandmanager type: nsicommandmanager the command manager handles operations on the editor.
completeDefaultIndex - Archive of obsolete content
« xul reference completedefaultindex new in thunderbird 3requires seamonkey 2.0 type: boolean gets and sets the value of the completedefaultindex attribute.
container - Archive of obsolete content
« xul reference container type: ?
contentDocument - Archive of obsolete content
« xul reference contentdocument type: document this read-only property contains the document object in the element.
contentPrincipal - Archive of obsolete content
« xul reference contentprincipal type: nsiprincipal this read-only property contains the principal for the content loaded in the browser, which provides security context information.
contentTitle - Archive of obsolete content
« xul reference contenttitle type: string this read-only property contains the title of the document object in the browser.
contentView - Archive of obsolete content
« xul reference contentview type: nsitreecontentview for trees built with a content builder - that is, those that do not have flags set -- the contentview will be a reference to the nsitreecontentview for the tree.
contentViewerEdit - Archive of obsolete content
« xul reference contentvieweredit type: nsicontentvieweredit this read-only property contains the nsicontentvieweredit which handles clipboard operations on the document.
contentViewerFile - Archive of obsolete content
« xul reference contentviewerfile type: nsicontentviewerfile reference to the nsicontentviewerfile interface for the document.
contentWindow - Archive of obsolete content
« xul reference contentwindow type: todo use the contentwindow.wrappedjsobject to obtain a dom(html) window object ...
contextMenu - Archive of obsolete content
« xul reference contextmenu type: popup element id gets and sets the value of the contextmenu attribute.
control - Archive of obsolete content
« xul reference control type: element id gets and sets the value of the control attribute.
controller - Archive of obsolete content
« xul reference controller type: nsiautocompletecontroller returns the controller for the auto complete element.
controllers - Archive of obsolete content
« xul reference controllers type: nsicontrollers a controllers list attached to the element.
crop - Archive of obsolete content
ArchiveMozillaXULPropertycrop
« xul reference crop type: string gets and sets the value of the crop attribute.
current - Archive of obsolete content
« xul reference current type: boolean gets and sets the value of the current attribute.
currentItem - Archive of obsolete content
« xul reference currentitem type: listitem element returns the currently focused item in the list box, which is only useful in a multiple selection list box.
currentNotification - Archive of obsolete content
« xul reference currentnotification type: notification element the currently displayed notification element or null.
currentPage - Archive of obsolete content
« xul reference currentpage type: wizardpage element this property returns the wizardpage element that is currently displayed.
currentPane - Archive of obsolete content
« xul reference currentpane type: prefpane element reference to the currently displayed pane.
currentSet - Archive of obsolete content
« xul reference currentset not in seamonkey 1.x type: comma-separated list of strings holds a comma-separated list of the ids of the items currently on the toolbar.
currentURI - Archive of obsolete content
« xul reference currenturi type: nsiuri this read-only property contains the currently loaded url.
customToolbarCount - Archive of obsolete content
« xul reference customtoolbarcount firefox only type: integer the number of custom toolbars currently within the toolbox.
database - Archive of obsolete content
« xul reference database type: nsirdfcompositedatasource returns the composite datasource created when all the datasources of an element are combined.
datasources - Archive of obsolete content
« xul reference datasources type: space-separated list of datasource uris gets and sets the value of the datasources attribute.
date - Archive of obsolete content
ArchiveMozillaXULPropertydate
« xul reference date type: integer the currently selected date of the month from 1 to 31.
dateLeadingZero - Archive of obsolete content
« xul reference 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 - Archive of obsolete content
« xul reference datevalue type: date the date that is currently entered or selected in the datepicker as a date object.
datepicker.open - Archive of obsolete content
« xul reference open type: boolean for popup type datepickers, specifies whether the popup is open.
datepicker.value - Archive of obsolete content
« xul reference value type: string the currently selected date in the form yyyy-mm-dd.
decimalPlaces - Archive of obsolete content
« xul reference decimalplaces type: integer gets and sets the value of the decimalplaces attribute.
decimalSymbol - Archive of obsolete content
« xul reference decimalsymbol type: string the character used for the decimal place indicator.
deck.selectedPanel - Archive of obsolete content
selectedpanel type: element holds a reference to the currently selected panel within a deck element.
defaultButton - Archive of obsolete content
« xul reference defaultbutton type: string normally this attribute should not be set, but if it is, it specifies the default button in the dialog.
defaultValue - Archive of obsolete content
« xul reference defaultvalue type: string gets and sets the the default value in a textbox.
description - Archive of obsolete content
« xul reference description type: string set to the description of the currently selected menuitem.
dir - Archive of obsolete content
ArchiveMozillaXULPropertydir
« xul reference dir type: string gets and sets the value of the dir attribute.
disableAutocomplete - Archive of obsolete content
« xul reference disableautocomplete type: boolean gets and sets the value of the disableautocomplete (or disableautocomplete) attribute.
disableKeyNavigation - Archive of obsolete content
« xul reference disablekeynavigation type: boolean gets or sets the value of the disablekeynavigation attribute.
disableautoselect - Archive of obsolete content
« xul reference disableautoselect type: boolean gets and sets the value of the disableautoselect attribute.
disabled - Archive of obsolete content
« xul reference disabled type: boolean gets and sets the value of the disabled attribute.
docShell - Archive of obsolete content
« xul reference docshell type: nsidocshell this read-only property contains the nsidocshell object for the document.
documentCharsetInfo - Archive of obsolete content
« xul reference 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.
editable - Archive of obsolete content
« xul reference editable type: boolean returns true if the element is editable.
editingColumn - Archive of obsolete content
« xul reference editingcolumn type: nsitreecolumn the column of the tree cell currently being edited, or null if there is no cell being edited.
editingRow - Archive of obsolete content
« xul reference editingrow type: integer the row index of the tree cell currently being edited, or -1 if there is no cell currently being edited.
editingSession - Archive of obsolete content
« xul reference editingsession type: nsieditingsession the editing session for the editor which is used to initialize the editor.
editor - Archive of obsolete content
« xul reference editor type: nsieditor a reference to the nsieditor for editable text.
emptyText - Archive of obsolete content
« xul reference emptytext deprecated since gecko 2 type: string gets and sets a string that appears in the textbox when it has no value.
enableColumnDrag - Archive of obsolete content
« xul reference enablecolumndrag type: boolean when set to true, the user may drag the column headers around to change the order in which they are displayed.
eventNode - Archive of obsolete content
« xul reference eventnode type: eventtarget indicates the node where keyboard navigation events listener is set up.
externalToolbars - Archive of obsolete content
« xul reference externaltoolbars type: array of elements an array of external toolbars; that is, toolbar elements that should be considered to be members of this toolbox, even if they are not actually children of the toolbox.
firstOrdinalColumn - Archive of obsolete content
« xul reference firstordinalcolumn type: treecol element a reference to the first treecol element, which or may not be the first column displayed in the tree.
firstPermanentChild - Archive of obsolete content
« xul reference firstpermanentchild not in seamonkey 1.x type: element the first permanent child of the toolbar.
flex - Archive of obsolete content
ArchiveMozillaXULPropertyflex
« xul reference flex type: integer gets and sets the value of the flex attribute.
focused - Archive of obsolete content
« xul reference focused type: boolean gets and sets the value of the focused attribute.
focusedItem - Archive of obsolete content
« xul reference focuseditem type: radio element holds the currently focused item in the radiogroup, which may or may not be the same as the selected item.
forceComplete - Archive of obsolete content
« xul reference forcecomplete type: boolean gets and sets the value of the forcecomplete (or forcecomplete) attribute.
group - Archive of obsolete content
ArchiveMozillaXULPropertygroup
« xul reference group type: string group name gets and sets the value of the group attribute.
handleCtrlPageUpDown - Archive of obsolete content
« xul reference handlectrlpageupdown type: boolean gets and sets the value of the handlectrlpageupdown attribute.
handleCtrlTab - Archive of obsolete content
« xul reference handlectrltab type: boolean gets and sets the value of the handlectrltab attibute.
height - Archive of obsolete content
« xul reference height type: integer gets and sets the value of the height attribute.
hidden - Archive of obsolete content
« xul reference hidden type: boolean gets and sets the value of the hidden attribute.
hideSeconds - Archive of obsolete content
« xul reference hideseconds type: boolean indicates whether the seconds field is visible or not.
homePage - Archive of obsolete content
« xul reference homepage type: string home page url this property holds the value of the user's home page setting.
hour - Archive of obsolete content
ArchiveMozillaXULPropertyhour
« xul reference hour type: integer the currently selected hour from 0 to 23.
hourLeadingZero - Archive of obsolete content
« xul reference hourleadingzero type: boolean a read only value indicating whether a leading zero should be displayed before the hour when it is less than 10.
id - Archive of obsolete content
ArchiveMozillaXULPropertyid
« xul reference id type: element id, must be unique in the window gets and sets the value of the id attribute.
ignoreBlurWhileSearching - Archive of obsolete content
« xul reference ignoreblurwhilesearching type: boolean gets and sets the value of the ignoreblurwhilesearching (or ignoreblurwhilesearching) attribute.
image - Archive of obsolete content
ArchiveMozillaXULPropertyimage
« xul reference image type: image url gets and sets the value of the image attribute.
increment - Archive of obsolete content
« xul reference increment type: integer gets and sets the value of the increment attribute.
inputField - Archive of obsolete content
« xul reference inputfield type: textbox element in mozilla, the xul textbox is implemented as a wrapper around an html input element.
instantApply - Archive of obsolete content
« xul referenceinstantapplytype: booleanyou can set this attribute to true to make the preference apply instantly, even when the global setting is not to use instant apply.
inverted - Archive of obsolete content
« xul reference inverted type: boolean gets and sets the value of the inverted attribute.
is24HourClock - Archive of obsolete content
« xul reference is24hourclock type: boolean a read only value indicating whether a 12-hour or 24-hour clock is used to display times.
isPM - Archive of obsolete content
ArchiveMozillaXULPropertyisPM
« xul reference ispm type: boolean if false, the hour is between 0 and 11, and if true, the hour is 12 or greater.
isSearching - Archive of obsolete content
« xul reference issearching type: boolean this property is set to true while a search is occuring.
isWaiting - Archive of obsolete content
« xul reference iswaiting type: boolean this property is set to true during the period while waiting for the timeout between the time when a user has pressed a key and a search is performed.
itemCount - Archive of obsolete content
« xul reference itemcount type: integer read only property holding the number of child items.
label - Archive of obsolete content
ArchiveMozillaXULPropertylabel
« xul reference label type: string gets and sets the value of the label attribute.
labelElement - Archive of obsolete content
« xul reference labelelement type: label element the label element associated with the control.
lastPermanentChild - Archive of obsolete content
« xul reference lastpermanentchild not in seamonkey 1.x type: element the last permanent child of the toolbar.
lastSelected - Archive of obsolete content
« xul reference lastselected type: string set this to the id of the last selected pane.
left - Archive of obsolete content
ArchiveMozillaXULPropertyleft
« xul reference left type: integer gets and sets the value of the left attribute.
linkedPanel - Archive of obsolete content
« xul reference linkedpanel type: id of a tabpanel element gets and sets the value of the linkedpanel attribute.
listBoxObject - Archive of obsolete content
« xul reference listboxobject type: nsilistboxobject the nsilistboxobject behind the list box.
locked - Archive of obsolete content
« xul reference locked type: boolean if true, the preference has been locked and disabled in the system configuration, preventing the value from being changed.
markupDocumentViewer - Archive of obsolete content
« xul reference markupdocumentviewer type: nsimarkupdocumentviewer this read-only property contains the nsimarkupdocumentviewer which is responsible for drawing the document.
max - Archive of obsolete content
ArchiveMozillaXULPropertymax
« xul reference max type: integer gets and sets the value of the max attribute.
maxHeight - Archive of obsolete content
« xul reference maxheight type: integer gets and sets the value of the maxheight attribute.
maxLength - Archive of obsolete content
« xul reference maxlength type: integer the maximum number of characters that the textbox allows to be entered.
maxRows - Archive of obsolete content
« xul reference maxrows type: integer gets and sets the value of the maxrows attribute.
maxWidth - Archive of obsolete content
« xul reference maxwidth type: integer gets and sets the value of the maxwidth attribute.
menu.open - Archive of obsolete content
« xul reference open type: boolean this property will be set to true when the menu is open.
menu - Archive of obsolete content
ArchiveMozillaXULPropertymenu
« xul reference menu type: popup element id gets and sets the value of the menu attribute.
menuBoxObject - Archive of obsolete content
« xul reference menuboxobject type: nsimenuboxobject a reference to the nsimenuboxobject which implements the menu.
menuitem.control - Archive of obsolete content
« xul reference control type: menu element returns the enclosing menu that the item is inside, if any, or null if there is no enclosing menu.
menulist.image - Archive of obsolete content
« xul reference image type: image url the image associated with the currently selected item.
menulist.inputField - Archive of obsolete content
« xul reference inputfield type: textbox element a reference to the textbox element used for editable menu lists.
menupopup - Archive of obsolete content
« xul reference menupopup type: menupopup element a reference to the menupopup used by the menu or menulist.
min - Archive of obsolete content
ArchiveMozillaXULPropertymin
« xul reference min type: integer gets and sets the value of the min attribute.
minHeight - Archive of obsolete content
« xul reference minheight type: integer gets and sets the value of the minheight attribute.
minResultsForPopup - Archive of obsolete content
« xul reference minresultsforpopup type: integer gets and sets the value of the minresultsforpopup (or minresultsforpopup) attribute.
minWidth - Archive of obsolete content
« xul reference minwidth type: integer gets and sets the value of the minwidth attribute.
minute - Archive of obsolete content
« xul reference minute type: integer the currently selected minute from 0 to 59.
minuteLeadingZero - Archive of obsolete content
« xul reference minuteleadingzero type: boolean a read only value indicating whether a leading zero should be displayed before the minute when it is less than 10.
mode - Archive of obsolete content
ArchiveMozillaXULPropertymode
« xul reference mode type: string gets and sets the value of the mode attribute.
month - Archive of obsolete content
ArchiveMozillaXULPropertymonth
« xul reference month type: integer the currently selected month from 0 to 11.
monthLeadingZero - Archive of obsolete content
« xul reference monthleadingzero type: boolean a read only value indicating whether a leading zero should be displayed before the month when it is less than 10.
name - Archive of obsolete content
ArchiveMozillaXULPropertyname
« xul reference name type: string the name of the preference to change.
next - Archive of obsolete content
ArchiveMozillaXULPropertynext
« xul reference next type: string wizardpage id set to the pageid of the next page after this one.
noMatch - Archive of obsolete content
« xul reference nomatch type: boolean this property will be set to true if the last search resulted in no matches.
notificationsHidden - Archive of obsolete content
« xul reference notificationshidden type: boolean indicating whether the notification area should be hidden.
object - Archive of obsolete content
« xul reference object type: string the object of the element.
observes - Archive of obsolete content
« xul reference observes type: broadcaster element id gets and sets the value of the observes attribute.
onFirstPage - Archive of obsolete content
« xul reference onfirstpage type: boolean this property is set to true if the user is on the first page, which may or may not be the first index.
onLastPage - Archive of obsolete content
« xul reference onlastpage type: boolean this property is set to true if the user is on the last page of the wizard.
open - Archive of obsolete content
ArchiveMozillaXULPropertyopen
« xul reference open type: boolean gets and sets the value of the open attribute.
ordinal - Archive of obsolete content
« xul reference ordinal type: integer gets and sets the value of the ordinal attribute.
orient - Archive of obsolete content
« xul reference orient type: string gets and sets the value of the orient attribute.
pack - Archive of obsolete content
ArchiveMozillaXULPropertypack
« xul reference pack type: string gets and sets the value of the pack attribute.
pageCount - Archive of obsolete content
« xul reference pagecount type: integer this property holds the number of pages in the wizard.
pageIncrement - Archive of obsolete content
« xul reference pageincrement type: integer gets and sets the value of the pageincrement attribute.
pageIndex - Archive of obsolete content
« xul reference pageindex type: integer this property returns the index of the currently selected page.
pageStep - Archive of obsolete content
« xul reference pagestep type: integer this property returns the number of pages that the user has navigated through so far, meaning that the user would press the back button this many times to go back to the beginning.
pageid - Archive of obsolete content
« xul reference pageid type: string wizardpage id this attribute should be set to a string that identifies the page's identifer in the wizard.
palette - Archive of obsolete content
« xul reference palette firefox only type: element the toolbarpalette within the toolbox.
parentContainer - Archive of obsolete content
« xul reference parentcontainer type: menu element read only property that returns the containing menu element, or null if there isn't a containing menu.
persist - Archive of obsolete content
« xul reference persist type: space-separated list of attribute names gets and sets the value of the persist attribute.
persistence - Archive of obsolete content
« xul reference persistence type: integer gets and sets the value of the persistence attribute.
placeholder - Archive of obsolete content
« xul reference placeholder type: string gets and sets a string that appears in the textbox when it has no value.
pmIndicator - Archive of obsolete content
« xul reference pmindicator type: string the string value displayed for hours between noon and midnight, defaulting to pm.
popup - Archive of obsolete content
ArchiveMozillaXULPropertypopup
« xul reference popup new in thunderbird 14 requires seamonkey 2.11 type: popup element should be set to the popup element that should appear when the user clicks on the textbox.
popupBoxObject - Archive of obsolete content
« xul reference popupboxobject type: nsipopupboxobject this read-only property holds the nsipopupboxobject that implements the popup.
popupOpen - Archive of obsolete content
« xul reference popupopen new in thunderbird 15 requires seamonkey 2.12 type: boolean indicates whether the popup is open or not.
position - Archive of obsolete content
« xul reference position type: string gets and sets the value of the position attribute.
predicate - Archive of obsolete content
« xul reference predicate type: uri the predicate or property to match.
preference.preferences - Archive of obsolete content
« xul reference preferences type: element reference to the containing preferences element.
preferenceElements - Archive of obsolete content
« xul reference preferenceelements type: dom nodelist holds a list of the ui elements in the pane that are attached to preferences.
preferencePanes - Archive of obsolete content
« xul reference preferencepanes type: dom nodelist holds a list of all the prefpane elements in the window.
prefpane.preferences - Archive of obsolete content
« xul reference preferences type: dom nodelist holds a list of the preference elements in the pane.
priority - Archive of obsolete content
« xul reference priority type: string gets and sets the value of the priority attribute.
radio.control - Archive of obsolete content
« xul reference control type: radiogroup element returns the enclosing radiogroup that the radio element is contained within, which may or may not be its direct parent.
radioGroup - Archive of obsolete content
« xul reference radiogroup type: radiogroup element equivalent to the control property.
readOnly - Archive of obsolete content
« xul reference readonly type: boolean if set to true, then the user cannot modify the value of the element.
ref - Archive of obsolete content
ArchiveMozillaXULPropertyref
« xul reference ref type: uri of an rdf resource gets and sets the value of the ref attribute.
resource - Archive of obsolete content
« xul reference resource type: nsirdfresource returns an rdf resource with the value of the element's ref attribute.
resultsPopup - Archive of obsolete content
« xul reference resultspopup type: popup element this property is set to the popup element that displays the results.
richlistitem.label - Archive of obsolete content
« xul reference label type: string gets the concatentation of text from any child label elements.
scrollBoxObject - Archive of obsolete content
« xul reference scrollboxobject type: nsiscrollboxobject the scroll box object implements the nsiscrollboxobject interface, which may be used to retrieve and adjust the scroll position of the list box.
scrollIncrement - Archive of obsolete content
« xul reference scrollincrement type: integer a read only property that lets you retrieve the number of pixels by which scrolling will occur when the arrowscrollbox is clicked.
searchCount - Archive of obsolete content
« xul reference searchcount new in thunderbird 15 requires seamonkey 2.12 type: integer returns the number of search components used.
searchLabel - Archive of obsolete content
« xul reference searchlabel type: string gets and sets the value of the searchlabel attribute.
searchParam - Archive of obsolete content
« xul reference searchparam new in thunderbird 15 requires seamonkey 2.12 type: string gets and sets the value of the autocompletesearchparam attribute.
searchSessions - Archive of obsolete content
« xul reference searchsessions obsolete since gecko 26 type: space-separated list of session names gets the value of the searchsessions attribute.
second - Archive of obsolete content
« xul reference second type: integer the currently selected second from 0 to 59.
secondLeadingZero - Archive of obsolete content
« xul reference secondleadingzero type: boolean a read only value indicating whether a leading zero should be displayed before the second when it is less than 10.
securityUI - Archive of obsolete content
« xul reference securityui type: nsisecurebrowserui the read-only property holds an object which may be used to determine the security level of the loaded document.
selected - Archive of obsolete content
« xul reference selected type: boolean this property's value is true if this element is selected, or false if it is not.
selectedBrowser - Archive of obsolete content
« xul reference selectedbrowser type: browser element this read-only property returns the currently displayed browser element.
selectedCount - Archive of obsolete content
« xul reference selectedcount type: integer returns the number of items that are currently selected.
selectedIndex - Archive of obsolete content
« xul reference selectedindex type: integer returns the index of the currently selected item.
selectedItem - Archive of obsolete content
« xul reference selecteditem type: element holds the currently selected item.
selectedItems - Archive of obsolete content
« xul reference selecteditems type: array of listitems returns an array of the selected items in the list.
selectedPanel - Archive of obsolete content
« xul reference selectedpanel type: element holds a reference to the currently selected panel within a <tabbox> element.
selectedTab - Archive of obsolete content
« xul reference selectedtab type: tab element a reference to the currently selected tab, which will always be one of the tab elements in the tabs element.
selectionEnd - Archive of obsolete content
« xul reference selectionend type: integer get or set the end of the selected portion of the field's text.
selectionStart - Archive of obsolete content
« xul reference selectionstart type: integer get or set the beginning of the selected portion of the field's text.
selstyle - Archive of obsolete content
« xul reference selstyle type: string if set to the value primary, only the label of the primary column will be highlighted when an item in the tree is selected.
sessionCount - Archive of obsolete content
« xul reference sessioncount type: integer holds the number of sessions.
sessionHistory - Archive of obsolete content
« xul reference sessionhistory type: nsishistory this read-only property contains the nsishistory object which holds the session history.
showCommentColumn - Archive of obsolete content
« xul reference showcommentcolumn type: boolean gets and sets the value of the showcommentcolumn (or showcommentcolumn) attribute.
showImageColumn - Archive of obsolete content
« xul reference showimagecolumn type: boolean gets and sets the value of the showimagecolumn attribute.
showPopup - Archive of obsolete content
« xul reference showpopup type: boolean gets and sets the value of the showpopup attribute.
size - Archive of obsolete content
ArchiveMozillaXULPropertysize
« xul reference size type: integer gets and sets the value of the size attribute.
smoothScroll - Archive of obsolete content
« xul reference smoothscroll type: boolean can be set to enable or disable smooth scrolling for the corresponding arrowscrollbox.
spinButtons - Archive of obsolete content
« xul reference spinbuttons type: element the read-only property returns a reference to the spinbuttons element used by the number box.
src - Archive of obsolete content
ArchiveMozillaXULPropertysrc
« xul reference src type: url gets and sets the value of the src attribute.
state - Archive of obsolete content
ArchiveMozillaXULPropertystate
« xul reference state type: string this read only property indicates whether the popup is open or not.
statusText - Archive of obsolete content
« xul reference statustext type: string gets and sets the value of the statustext attribute.
statusbar - Archive of obsolete content
« xul reference statusbar type: id of statusbar element gets and sets the value of the statusbar attribute.
stringBundle - Archive of obsolete content
« xul reference stringbundle type: nsistringbundle returns the xpcom string bundle object which implements nsistringbundle.
strings - Archive of obsolete content
« xul reference strings type: nsisimpleenumerator an enumeration of all of the strings in the string bundle.
style - Archive of obsolete content
ArchiveMozillaXULPropertystyle
« xul reference style type: css inline style gets and sets the value of the style attribute.
subject - Archive of obsolete content
« xul reference subject type: string the subject of the element.
suppressOnSelect - Archive of obsolete content
« xul reference suppressonselect type: boolean gets and sets the value of the suppressonselect attribute.
tab.control - Archive of obsolete content
« xul reference control type: tabs element returns the enclosing tabs element.
tabContainer - Archive of obsolete content
« xul reference tabcontainer type: tabs element returns the tabs element that contains the tabs.
tabIndex - Archive of obsolete content
« xul reference tabindex type: integer gets and sets the value of the tabindex attribute.
tabScrolling - Archive of obsolete content
« xul reference tabscrolling type: boolean gets and sets the value of the tabscrolling (or tabscrolling) attribute.
tabbox - Archive of obsolete content
« xul reference tabbox type: tabbox element returns the tabbox element that contains the tabs.
tabbox.tabs - Archive of obsolete content
« xul reference tabs type: tabs element the tabs element contained within the tabbox.
tabbrowser.tabs - Archive of obsolete content
« xul reference tabs type: array a nodelist containing the tab objects for each tab in the tabbrowser.
tabpanels - Archive of obsolete content
« xul reference tabpanels type: tabpanels element the tabpanels element contained within the tabbox.
tabs - Archive of obsolete content
ArchiveMozillaXULPropertytabs
« xul reference tabs type: tabs element the tabs element that the tab is contained within.
tag - Archive of obsolete content
ArchiveMozillaXULPropertytag
« xul reference tag type: tag name this may be set to a tag name.
textLength - Archive of obsolete content
« xul reference textlength type: integer holds the length of the text entered in the textbox.
textValue - Archive of obsolete content
« xul reference textvalue new in thunderbird 15 requires seamonkey 2.12 type: string returns the content of the textbox.
textbox.label - Archive of obsolete content
« xul reference label type: string sets the label attribute.
textbox.value - Archive of obsolete content
« xul reference value type: string holds the current value of the textbox as a string.
timeout - Archive of obsolete content
« xul reference timeout type: integer gets and sets the value of the timeout attribute.
timepicker.value - Archive of obsolete content
« xul reference value type: string the currently entered time of the form hh:mm:ss.
title - Archive of obsolete content
ArchiveMozillaXULPropertytitle
« xul reference title type: string the title that appears at the top of the wizard.
toolbarName - Archive of obsolete content
« xul reference toolbarname not in seamonkey 1.x type: string the name of the toolbar.
toolbarset - Archive of obsolete content
« xul reference toolbarset firefox only type: element the toolbarset within the toolbox.
toolboxid - Archive of obsolete content
« xul reference toolboxid type: string the id of the toolbox this toolbar is a member of.
tooltip - Archive of obsolete content
« xul reference tooltip type: tooltip element id gets and sets the value of the tooltip attribute.
tooltipText - Archive of obsolete content
« xul reference tooltiptext type: string gets and sets the value of the tooltiptext attribute.
top - Archive of obsolete content
ArchiveMozillaXULPropertytop
« xul reference top type: integer gets and sets the value of the top attribute.
tree.inputField - Archive of obsolete content
« xul reference home inputfield type: textbox element read-only property that holds the textbox that is used for editing.
treeBoxObject - Archive of obsolete content
« xul reference treeboxobject type: nsitreeboxobject the box object is responsible for rendering the tree on the window.
triggerNode - Archive of obsolete content
« xul reference triggernode type: nsidomnode this read-only property holds the dom node that generated the event triggering the opening of the popup.
uri - Archive of obsolete content
ArchiveMozillaXULPropertyuri
« xul reference uri type: ?
userAction - Archive of obsolete content
« xul reference useraction type: string gets and sets the value of the useraction attribute.
value - Archive of obsolete content
ArchiveMozillaXULPropertyvalue
« xul reference value type: string gets and sets the value of the value attribute.
valueNumber - Archive of obsolete content
« xul reference valuenumber type: number in contrast to the value property which holds a string representation, the valuenumber property is a number containing the current value of the number box.
view - Archive of obsolete content
ArchiveMozillaXULPropertyview
« xul reference view type: nsitreeview the view for the tree, which is the object which generates the data to be displayed.
visibleTabs - Archive of obsolete content
« xul reference visibletabs type: array an array containing tab objects for each visible tab in the tabbrowser.
webBrowserFind - Archive of obsolete content
« xul reference webbrowserfind type: nsiwebbrowserfind this read-only property contains an nsiwebbrowserfind object which can be used to search for text in the document.
webNavigation - Archive of obsolete content
« xul reference webnavigation type: nsiwebnavigation this read-only property contains the nsiwebnavigation object for the document.
webProgress - Archive of obsolete content
« xul reference webprogress type: nsiwebprogress this read-only property contains an nsiwebprogress object which is used to monitor the progress of a document loading.
width - Archive of obsolete content
ArchiveMozillaXULPropertywidth
« xul reference width type: integer gets and sets the value of the width attribute.
wizardPages - Archive of obsolete content
« xul reference wizardpages type: dom nodelist of wizardpage elements this property holds the list of wizardpage elements in the wizard.
wrapAround - Archive of obsolete content
« xul reference wraparound type: boolean gets and sets the value of the wraparound attribute.
year - Archive of obsolete content
ArchiveMozillaXULPropertyyear
« xul reference year type: integer the currently selected year from 1 to 9999.
yearLeadingZero - Archive of obsolete content
« xul reference yearleadingzero type: boolean a read only value indicating whether a leading zero should be displayed before the year when it is less than 1000.
Multiple Queries - Archive of obsolete content
this may be used to combine the results from several queries together, or may be used to generate different types of results when recursive iterations.
Rule Compilation - Archive of obsolete content
the exact syntax is dependent on the type of datasource used in the template.
Using Multiple Queries to Generate More Results - Archive of obsolete content
<vbox datasources="people.xml" ref="*" querytype="xml"> <template> <queryset> <query expr="group[@name='male']/*"/> <action> <checkbox uri="?" label="?name"/> </action> </queryset> <queryset> <query expr="group[@name='female']/*"/> <action> <label uri="?" value="?name"/> </action> </queryset> </template> </vbox> « previousnext » ...
XML Assignments - Archive of obsolete content
here is an example: <vbox datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="person"> <assign var="?namelength" expr="string-length(@name)"/> <assign var="?siblings" expr="count(../*) - 1"/> </query> <action> <hbox uri="?" align="center"> <button label="?name"/> <label value="?gender"/> <label value="?namelength"/> <label value="?siblings"/> </hbox> </action> </templ...
Things I've tried to do with XUL - Archive of obsolete content
this is a grab-bag type of faq, with a list of things that should work (hopefully with bug numbers), things that don't work (hopefully with explanations), and workarounds for both of the above.
Creating toolbar buttons (Customize Toolbar Window) - Archive of obsolete content
to attach it to the overlay, put this processing instruction (pi) at the top of the overlay file: <?xml-stylesheet href="chrome://myextension/skin/toolbar-button.css" type="text/css"?> note: the css file with your toolbar styles needs to be included in the overlay file, as you would expect, but also in the chrome.manifest file.
Adding Buttons - Archive of obsolete content
the code to add is shown in red below: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <button id="find-button" label="find"/> <button id="cancel-button" label="cancel"/> </window> you'll notice that the cancel button was added also.
Adding Event Handlers - Archive of obsolete content
when an action occurs that would trigger an event, such as the user moving the mouse, an event object is created corresponding to that event type.
Adding Event Handlers to XBL-defined Elements - Archive of obsolete content
valid event types are those supported by xul and javascript, such as click and focus.
Adding Properties to XBL-defined Elements - Archive of obsolete content
there are three types of items you can add.
Additional Install Features - Archive of obsolete content
otherwise, the number will be an error code which indicates the type of error that occured.
Commands - Archive of obsolete content
you can think of the command element as a type of controller for the command.
Custom Tree Views - Archive of obsolete content
example custom tree source <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window title="tree example" id="tree-window" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="setview();"> <script> //moz 1.8 var treeview = { rowcount : 10000, getcelltext : function(row,column){ if (column.id == "namecol") return "row "+row; else return "february 18"; }, settree: function(treebox){ this.treebox = tre...
Element Positioning - Archive of obsolete content
example 5: source view <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="yesno" title="question" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <hbox> <button label="yes"/> <button label="no"/> </hbox> <hbox align="center"> <button label="maybe"/> <button label="perhaps"/> </hbox> </window> you can also use the style properties -moz-box-pack and -moz-box-align i...
Install Scripts - Archive of obsolete content
it takes two arguments, the first is the type of chrome to register (content, skin or locale).
Manipulating Lists - Archive of obsolete content
method of deleting the selected items properly: example 4 : source view <script> function deleteselection(){ var list = document.getelementbyid('thelist'); var count = list.selectedcount; while (count--){ var item = list.selecteditems[0]; list.removeitemat(list.getindexofitem(item)); } } </script> <button label="delete" oncommand="deleteselection();"/> <listbox id="thelist" seltype="multiple"> <listitem label="cheddar"/> <listitem label="cheshire"/> <listitem label="edam"/> <listitem label="gouda"/> <listitem label="havartie"/> </listbox> inside the while loop we first get the selecteditem at index 0.
Stack Positioning - Archive of obsolete content
here, all three children are buttons, but the elements do not have to be same type.
Tabboxes - Archive of obsolete content
</description> <spacer style="height: 10px"/> <groupbox orient="horizontal"> <caption label="search criteria"/> <menulist id="searchtype"> <menupopup> <menuitem label="name"/> <menuitem label="size"/> <menuitem label="date modified"/> </menupopup> </menulist> <spacer style="width: 10px;"/> <menulist id="searchmode"> <menupopup> <menuitem label="is"/> <menuitem label="is not"/> </menupopup> </menulist> <spacer style="hei...
Toolbars - Archive of obsolete content
adding a toolbar like a number of elements, xul toolbars are a type of box.
Tree Selection - Archive of obsolete content
if you add the seltype attribute to the tree, set to the value single, the user may only select one row at a time.
Trees and Templates - Archive of obsolete content
multiple rules can be used to indicate different content for different types of data.
Using Spacers - Archive of obsolete content
for now, just know that the window element is a type of box.
XPCOM Interfaces - Archive of obsolete content
the third parameter is the bookmark type which will normally be 0 and the last parameter is the character encoding of the document being bookmarked, which may be null.
XUL Tutorial - Archive of obsolete content
ata skins and locales adding style sheets styling a tree modifying the default skin creating a skin skinning xul files by hand localization property files bindings introduction to xbl anonymous content xbl attribute inheritance adding properties adding methods adding event handlers xbl inheritance creating reusable content using css and xbl xbl example specialized window types features of a window creating dialogs open and save dialogs creating a wizard more wizards overlays cross package overlays installation creating an installer install scripts additional install features this xul tutorial was originally created by neil deakin.
Urlbar-icons - Archive of obsolete content
(the url bar is also known as the address bar and the navigation bar.) example the default contents of browser.xul: <hbox id="urlbar-icons"> <button be="" chromedir="ltr" class="urlbar-icon" click="" for="" id="safebrowsing-urlbar-icon" img="" level="safe" might="" onclick="godocommand('safebrowsing-show-warning');" page="" style="-moz-user-focus:" tooltiptext="this" type="menu"> <img class="urlbar-icon" id="star-button" onclick="placesstarbutton.onclick(event);" /> <img address="" chromedir="ltr" class="urlbar-icon" id="go-button" in="" location="" onclick="handleurlbarcommand(event);" p="" the="" to="" tooltiptext="go" /> </button> </hbox> ...
XUL Changes for Firefox 1.5 - Archive of obsolete content
these windows are special types of dialogs which support several panels, each of which may be contained in the same file or a separate file.
XULBrowserWindow - Archive of obsolete content
method overview boolean hidechromeforlocation(in string alocation); attributes attribute type description incontentwhitelist string[] an array of url strings for which chrome is automatically hidden.
XUL Template Primer - Bindings - Archive of obsolete content
<?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin" type="text/css"?> <window xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" align="vertical"> <vbox datasources="friends.rdf" ref="urn:root"> <template> <rule> <conditions> <content uri="?uri"/> <triple subject="?uri" predicate="http://home.netscape.com/nc-rdf#friends" ...
XUL Coding Style Guidelines - Archive of obsolete content
it could contain xul specific element types for ui controls, html4 markups for content data, and even javascript for user event handling.
XUL Event Propagation - Archive of obsolete content
the widget hierarchy consider the following xul file: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="events" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" oncommand="alert('window handler')"> <vbox> <vbox style="background-color: lightgrey;" oncommand="alert('box handler')"> <menu class="menu" label="file" oncommand="alert('menu handler')"> <menupopup> <menuitem oncommand="alert('new...
action - Archive of obsolete content
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheigh...
bbox - Archive of obsolete content
ArchiveMozillaXULbbox
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
box - Archive of obsolete content
ArchiveMozillaXULbox
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
broadcaster - Archive of obsolete content
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
broadcasterset - Archive of obsolete content
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
clicktoscroll - Archive of obsolete content
« xul reference home clicktoscroll type: boolean if true, the up or down arrow(s) must be clicked to scroll the content.
column - Archive of obsolete content
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
columns - Archive of obsolete content
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
conditions - Archive of obsolete content
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
XUL:Property:flexGroup - Archive of obsolete content
« xul reference flexgroup type: integer gets and sets the value of the flexgroup attribute ...
grippy - Archive of obsolete content
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
hbox - Archive of obsolete content
ArchiveMozillaXULhbox
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
keyset - Archive of obsolete content
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 disabled type: boolean indicates whether the element is disabled or not.
listcol - Archive of obsolete content
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
listcols - Archive of obsolete content
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
page - Archive of obsolete content
ArchiveMozillaXULpage
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
popupset - Archive of obsolete content
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
progressmeter.max - Archive of obsolete content
« xul reference home max type: integer the maximum value that the progressmeter may reach.
queryset - Archive of obsolete content
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
row - Archive of obsolete content
ArchiveMozillaXULrow
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
rows - Archive of obsolete content
ArchiveMozillaXULrows
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
scrollbox - Archive of obsolete content
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
scrollcorner - Archive of obsolete content
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
spacer - Archive of obsolete content
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
stack - Archive of obsolete content
ArchiveMozillaXULstack
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
stringbundleset - Archive of obsolete content
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
tabpanel - Archive of obsolete content
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
titlebar - Archive of obsolete content
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 note: the allowevents attribute did not work for title bars prior to firefox 3.
toolbargrippy - Archive of obsolete content
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessible type: nsiaccessible returns the accessibility object for the element.
toolbaritem - Archive of obsolete content
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
toolbarpalette - Archive of obsolete content
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
toolbarset - Archive of obsolete content
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight...
vbox - Archive of obsolete content
ArchiveMozillaXULvbox
from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
XULRunner 1.9.2 Release Notes - Archive of obsolete content
type sudo rm /var/db/receipts/org.mozilla.xulrunner.* installing xul applications xul applications can be obtained from various sources, and are typically packaged as a zip archive with the extension .xulapp or .xpi.
Creating a Windows Inno Setup installer for XULRunner applications - Archive of obsolete content
_started_with_xulrunner appupdatesurl=http://developer.mozilla.org/en/docs/getting_started_with_xulrunner defaultdirname={pf}\my app defaultgroupname=my app allownoicons=yes outputdir=..\build\output outputbasefilename=myapp-1.0-win32 ; setupiconfile= compression=lzma solidcompression=yes [languages] name: english; messagesfile: compiler:default.isl [components] name: main; description: my app; types: full compact custom; flags: fixed name: runtime; description: xul runner runtime; types: full custom [tasks] name: desktopicon; description: {cm:createdesktopicon}; groupdescription: {cm:additionalicons}; flags: unchecked name: quicklaunchicon; description: {cm:createquicklaunchicon}; groupdescription: {cm:additionalicons}; flags: unchecked [files] source: c:\develop\xulrunnerinstaller\myapp\...
Specifying Startup Chrome Window - Archive of obsolete content
an application wishing to have only one main window should set the toolkit.singletonwindowtype preference and specify the windowtype attribute on the main application window.
What XULRunner Provides - Archive of obsolete content
the following features are either already implemented or planned: gecko features xpcom networking gecko rendering engine dom editing and transaction support (no ui) cryptography xbl (xbl2 planned) xul svg xslt xml extras (xmlhttprequest, domparser, etc.) web services (soap) auto-update support (not yet complete) type ahead find toolbar history implementation (the places implementation in the 1.9 cycle) accessibility support ipc services for communication between gecko-based apps (not yet complete) storage/sqlite interfaces user interface features the following user interface is supplied by xulrunner, and may be overridden by embedders under certain circumstances: apis and user interface for instal...
mozilla.dev.platform FAQ - Archive of obsolete content
a: have the browser.chromeurl preference - this should be a xul document containing a <browser type="content-primary"> element in which the popup window's content should get loaded.
Mozprofile - Archive of obsolete content
example: from mozprofile import firefoxprofile # create new profile to pass to mozmill/mozrunner profile = firefoxprofile(addons=["adblock.xpi"]) setting preferences preferences can be set in several ways: using the api: you can pass preferences in to the profile class's constructor: obj = firefoxprofile(preferences=[("accessibility.typeaheadfind.flashbar", 0)]) using a json blob file: mozprofile --preferences myprefs.json using a .ini file: mozprofile --preferences myprefs.ini via the command line: mozprofile --pref key:value --pref key:value [...] when setting preferences from an .ini file or the --pref switch, the value will be interpolated as an integer or a boolean (true/false) if possible.
reftest opportunities files - Archive of obsolete content
rmelem http://dbaron.org/css/test/sec010303 http://dbaron.org/css/test/sec0302 http://dbaron.org/css/test/sec0302_xml http://dbaron.org/css/test/parsing http://dbaron.org/css/test/parsing2 http://dbaron.org/css/test/parsing4 http://dbaron.org/css/test/parsing5 http://dbaron.org/css/test/parsing6 http://dbaron.org/css/test/sec040102 http://dbaron.org/css/test/casesens http://dbaron.org/css/test/xmltypesel http://dbaron.org/css/test/unitless http://dbaron.org/css/test/exunit http://dbaron.org/css/test/emunit http://dbaron.org/css/test/sec040310 http://dbaron.org/css/test/parsing3 http://dbaron.org/css/test/selector_confusion http://dbaron.org/css/test/univsel http://dbaron.org/css/test/childsel http://dbaron.org/css/test/sibsel http://dbaron.org/css/test/attrsel http://dbaron.org/css/test/twocla...
Archived Mozilla and build documentation - Archive of obsolete content
califiletype the califiletype interface provides information about a specific file type.
2006-10-13 - Archive of obsolete content
user questions about a open/saveas bug that already exisits: https://bugzilla.mozilla.org/show_bug.cgi?id=347230 installer for 2.0rc2 ehume gives the developers a thumbs up for the new installer for 2.0rc2 having a textfield where you can type in the installation directory.
2006-10-06 - Archive of obsolete content
peter lairo requested someone who are knowledgeable in w3c standards to confirm if the use of <blockquote type="cite"> is valid w3c code.
2006-11-24 - Archive of obsolete content
gecko 1.9 intl rendering peformance november 20th: boris zbarskyannounced that: we need to create an intl performance page set or multiple intl performance page sets and run at least the pageload tests for all of these pagesets, and preferably also some sort of dhtml tests using pages of the different types.
Extentsions FAQ - Archive of obsolete content
asking for help in knowing the data that is typed into text boxes.
2006-10-27 - Archive of obsolete content
update check failing in firefox 2.0 if add-on type is 8 testing a custom update.rdf file for a langpack using the official version of firefox 2.0 rc 3.
2006-11-17 - Archive of obsolete content
boaz invites your comments xulrunner 1.8.0.4 is running a kiosk-type application on linux with 512mb, and there is the appearance of a significant memory leak.
2006-09-29 - Archive of obsolete content
discussions file: vs resource: vs chrome: from a security point of view boris zbarsky gives a summary the current setup for checkloaduri (which type of security principal can load what) and asks for comments about whether that is the desired behaviour.
2006-12-01 - Archive of obsolete content
discussions nsicontentpolicy and user interaction the proper way to get user confirmation before trying to load certain file types.
2006-11-24 - Archive of obsolete content
filing bugs for prototype implementations discussions about explicitly address bugs in the prototype implementations.
External resources for plugin creation - Archive of obsolete content
feature highlights include thread safety checks, unicode support (with std::wstring), activex support, built-in drawing model negotiation for mac, automatic type conversion (including javascript arrays and objects), advanced security features, and more.
Monitoring plugins - Archive of obsolete content
verservice.removeobserver(this, "experimental-notify-plugin-call"); skeleton observer class below is a skeleton class that you may use to listen to runtime notifications: function pluginobserver() { this.registered = false; this.register(); //takes care of registering this class with observer services as an observer for plugin runtime notifications } pluginwatcherobserver.prototype = { observe: function(subject, topic, data) { if (topic == "experimental-notify-plugin-call") //in case your class is registered to listen to other topics //this gets executed each time a runtime notification arrives // --your code goes here-- } }, //takes care of registering the observer services for the "experimental-notify-plugin-call" topic register: fu...
NPAnyCallbackStruct - Archive of obsolete content
syntax typedef struct { int32 type; } npanycallbackstruct; fields the data structure has the following field: type always contains np_print.
NPEmbedPrint - Archive of obsolete content
syntax typedef struct _npembedprint { npwindow window; void* platformprint; /* platform-specific */ } npembedprint; fields the data structure has the following fields: window the npwindow the plug-in should use for printing.
NPFullPrint - Archive of obsolete content
syntax typedef struct _npfullprint { npbool pluginprinted; /* true: print fullscreen */ npbool printone; /* true: print one copy */ /* to default printer */ void* platformprint; /* platform-specific */ } npfullprint; fields the data structure has the following fields: pluginprinted determines whether the plug-in prints in full-page mode.
NPN_GetURLNotify - Archive of obsolete content
can be of any type, such as http, ftp, news, or mailto.
NPN_GetValue - Archive of obsolete content
the method returns a value of type hwnd.
NPN_IdentifierIsString - Archive of obsolete content
syntax #include <npruntime.h> bool npn_identifierisstring(npidentifier identifier); parameters the function has the following parameter: <tt>identifier</tt> the identifier whose type is to be examined.
NPN_ReleaseVariantValue - Archive of obsolete content
npn_releasevariantvalue() will call npn_releaseobject() on npvariants of type npvarianttype_object, and npn_memfree() on npvariants of type npvarianttype_string.
NPN_SetValue - Archive of obsolete content
although the function prototype has type of value void *, the actual boolean should be placed there, not a pointer to a boolean.
NPP - Archive of obsolete content
syntax typedef struct _npp { void* pdata; /* plug-in private data */ void* ndata; /* mozilla private data */ } npp_t; typedef npp_t* npp; fields the data structure has the following fields: pdata a value, whose definition is up to the plug-in, that the plug-in can use to store a pointer to an internal data structure associated with the instance; this field isn't modified by the browser.
NPP_HandleEvent - Archive of obsolete content
for a list of event types the application is responsible for delivering to the plug-in, see the npevent structure.
NPP_Print - Archive of obsolete content
be sure to cast this to type hdc.
NPP_Write - Archive of obsolete content
this gives you different information depending in the type of stream.
NPPrint - Archive of obsolete content
syntax typedef struct _npprint { uint16 mode; /* np_full or np_embed */ union { npfullprint fullprint; /* if mode is np_full */ npembedprint embedprint; /* if mode is np_embed */ } print; } npprint; fields the data structure has the following fields: mode determines whether plug-in prints in full-page or embedded mode.
NPPrintCallbackStruct - Archive of obsolete content
syntax typedef struct { int32 type; file* fp; } npprintcallbackstruct; fields the data structure has the following fields: type always contains np_print.
NPRect - Archive of obsolete content
syntax typedef struct _nprect { uint16 top; uint16 left; uint16 bottom; uint16 right; } nprect; fields the data structure has the following fields: top, left, bottom, right the top, left, bottom, and right sides of the rectangle.
NPSavedData - Archive of obsolete content
syntax typedef struct _npsaveddata { int32 len; void* buf; } npsaveddata; fields the data structure has the following fields: len length in bytes of the buffer pointed to by buf; set by the plug-in.
NPString - Archive of obsolete content
syntax typedef struct _npstring { const nputf8 *utf8characters; uint32_t utf8length; } npstring; fields the data structure has the following fields: utf8characters an array of the utf-8 characters comprising the string.
NPUTF8 - Archive of obsolete content
syntax typedef char nputf8; description the nputf8 type is used in constructing utf-8 strings for use by the plugin scripting api extension.
NP_Port - Archive of obsolete content
syntax typedef struct np_port { cgrafptr port; /* grafport */ int32 portx; /* position inside the topmost window */ int32 porty; } np_port; fields the data structure has the following fields: port standard mac os port into which the plug-in should draw.
Shipping a plugin as a Toolkit bundle - Archive of obsolete content
plugin packages should only need to package a small set of files in the following structure in the xpi file: install.rdf plugins/ pluginlib.dll plugintypes.xpt the install.rdf file contains an install manifest that describes the plugin to the user.
XEmbed Extension for Mozilla Plugins - Archive of obsolete content
nperror np_initialize(npnetscapefuncs* nstable, nppluginfuncs* pluginfuncs) { nperror err = nperr_no_error; prbool supportsxembed = pr_false; npntoolkittype toolkit = 0; [ code that copies all of the function tables and does ] [ other standard checks ] /* * make sure that the browser supports functionality we care * about.
Proposal - Archive of obsolete content
uses an http "content-type" parameter to hint at an rss feeds disposition type -- to hint at what is being syndicated.
Use Case - Archive of obsolete content
use cases between rss aggregators and rss feeds polling rss feeds figuring out which version of rss 0.91 you have how to handle enclosures http mime type handling use cases between users and rss feeds subscribing to an rss feed ...
title - Archive of obsolete content
netscape rss 0.91 revision 3 example <?xml version="1.0"?> <!doctype rss system "http://my.netscape.com/publish/formats/rss-0.91.dtd"> <rss version="0.91"> <channel> <title>advogato</title> <link>http://www.advogato.org/article/</link> <description>recent advogato articles</description> <language>en-us</language> <image> <link>http://www.advogato.org/</link> <title>advogato</title> ...
.htaccess ( hypertext access ) - Archive of obsolete content
mime types : see correct mime types for further information.
Threats - Archive of obsolete content
this type of impersonation is known as spoofing.
Sunbird Theme Tutorial - Archive of obsolete content
"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="just-testing@example.com" em:name="just testing" em:creator="rod whiteley" em:description="a test theme for sunbird" em:homepageurl="http://developer.mozilla.org/" em:version="0.1" em:internalname="testing" em:type="4" > <em:targetapplication><!-- sunbird --> <description em:id="{718e30fb-e89b-41dd-9da7-e25a45638b28}" em:minversion="0.2.9" em:maxversion="0.4" /> </em:targetapplication> </description> </rdf> in the line that starts <tt>em:id</tt>, paste your identifier between the double-quote characters, replacing the identifier that is there now.
The Basics of Web Services - Archive of obsolete content
introducing xml-rpc xml-rpc is a type of web service and has been around since 1998, though not an official w3c standard, it is widely used.
Create Your Own Firefox Background Theme - Archive of obsolete content
read more about the types of creative common licenses.
UUID - Archive of obsolete content
or you can also type "/query firebot uuid?" in any tab connected to the irc.mozilla.org (or, with chatzilla, "moznet") network.
Using the W3C DOM - Archive of obsolete content
<body> <p>papa's got <span id="dynatext">a lot of nerve</span>!</p> <script type="text/javascript"> // get a reference to the span element var spanel = document.getelementbyid("dynatext"); // detect whether the browser supports textcontent or innertext if (typeof spanel.textcontent == 'string') { spanel.textcontent = 'some gall'; } else if (typeof spanel.innertext == 'string') { spanel.innertext = 'some gall'; // if neither are supported, use other dom methods } else {...
Using workers in extensions - Archive of obsolete content
this worker object has access to js-ctypes, which standard workers do not have.
-moz-binding - Archive of obsolete content
formal definition initial valuenoneapplies toall elements except generated content or pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <url> | none examples .exampleone { -moz-binding: url(http://www.example.org/xbl/htmlbindings.xml#radiobutton); } specifications not part of any standard.
-moz-border-bottom-colors - Archive of obsolete content
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete it does not apply if border-style is dashed or dotted.
-moz-border-left-colors - Archive of obsolete content
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete it does not apply if border-style is dashed or dotted.
-moz-border-right-colors - Archive of obsolete content
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete it does not apply if border-style is dashed or dotted.
-moz-border-top-colors - Archive of obsolete content
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete it does not apply if border-style is dashed or dotted.
-moz-stack-sizing - Archive of obsolete content
(the problem does not affect children moved above or to the left of the stack.) initial valuestretch-to-fitapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values stretch-to-fit the child will influence the stack's size.
-moz-text-blink - Archive of obsolete content
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none produces no blinking.
-moz-window-shadow - Archive of obsolete content
<window>, <panel>inheritednocomputed valueas specifiedanimation typediscrete syntax the -moz-window-shadow property is specified as one of the keyword values listed below.
-ms-block-progression - Archive of obsolete content
initial valuetbapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values tb default.
-ms-content-zoom-chaining - Archive of obsolete content
initial valuenoneapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none the initial value.
-ms-content-zoom-limit-max - Archive of obsolete content
smaller values zoom out.computed valueas specifiedanimation typediscrete syntax values <percentage> the maximum zoom factor.
-ms-content-zoom-limit-min - Archive of obsolete content
smaller values zoom out.computed valueas specifiedanimation typediscrete syntax values <percentage> the minimum zoom factor.
-ms-content-zoom-limit - Archive of obsolete content
smaller values zoom out.computed valueas each of the properties of the shorthand:-ms-content-zoom-limit-max: as specified-ms-content-zoom-limit-min: as specifiedanimation typediscrete syntax the -ms-content-zoom-limit shorthand property is specified as one or both of the following content zoom limit values, in order, separated by spaces.
-ms-content-zooming - Archive of obsolete content
initial valuezoom for the top level element, none for all other elementsapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none the initial value of all elements except the top-level element.
-ms-flow-from - Archive of obsolete content
initial valuenoneapplies tonon-replaced elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none default.
-ms-flow-into - Archive of obsolete content
initial valuenoneapplies toiframe elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none default.
-ms-high-contrast-adjust - Archive of obsolete content
initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values auto indicates the applicable css properties will be adjusted as expected when the system is in high contrast mode.
-ms-hyphenate-limit-chars - Archive of obsolete content
initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values auto corresponds to a value of 5 2 2, indicating a 5-character word limit, 2 characters required before a hyphenation break, and 2 characters required following a hyphenation break.
-ms-hyphenate-limit-lines - Archive of obsolete content
initial valueno-limitapplies toblock container elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values no-limit indicates that hyphenation is not limited based on the number of consecutive hyphenated lines.
-ms-ime-align - Archive of obsolete content
initial valueautoapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete syntax /* keyword values */ -ms-ime-align: auto; -ms-ime-align: after; values auto initial value.
-ms-overflow-style - Archive of obsolete content
initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values auto the initial value.
-ms-scroll-limit-x-max - Archive of obsolete content
initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values auto the maximum value for the scrollleft property is equal to element.scrollwidth.
-ms-scroll-limit-x-min - Archive of obsolete content
initial value0applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values <length> the minimum value for the scrollleft property.
-ms-scroll-limit-y-max - Archive of obsolete content
initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values auto the maximum value for the scrolltop property is equal to element.scrollheight.
-ms-scroll-limit-y-min - Archive of obsolete content
initial value0applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values <length> the minimum value for the scrolltop property.
-ms-scroll-limit - Archive of obsolete content
-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.
-ms-scroll-rails - Archive of obsolete content
initial valuerailedapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none the content moves exactly with the user's finger.
-ms-scroll-translation - Archive of obsolete content
initial valuenoneapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values vertical-to-horizontal vertical to horizontal translation, as described in remarks, will take place when appropriate.
-ms-scrollbar-arrow-color - Archive of obsolete content
initial valuebuttontextapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values <color> the color of the scroll arrows of the scroll bar.
-ms-scrollbar-base-color - Archive of obsolete content
initial valuedepends on user agentapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values <color> the base color of the main elements of a scroll bar.
-ms-scrollbar-face-color - Archive of obsolete content
initial valuethreedfaceapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values <color> the color of the scroll box and scroll arrows.
-ms-scrollbar-highlight-color - Archive of obsolete content
initial valuethreedhighlightapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values <color> the color of the slider tray, the top and left edges of the scroll box, and the scroll arrows of a scroll bar.
-ms-scrollbar-track-color - Archive of obsolete content
initial valuescrollbarapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values <color> the color of the track element.
-ms-text-autospace - Archive of obsolete content
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none no effect takes place; that is, no extra space is added.
-ms-touch-select - Archive of obsolete content
initial valuegrippersapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values grippers the grippers are always on.
-ms-wrap-flow - Archive of obsolete content
initial valueautoapplies toblock-level elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values auto for floated elements, an exclusion is created; for all other elements, an exclusion is not created.
-ms-wrap-margin - Archive of obsolete content
initial value0applies toexclusion elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values <length> the margin size, a non-negative value.
-ms-wrap-through - Archive of obsolete content
initial valuewrapapplies toblock-level elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values wrap the exclusion element inherits its parent node's wrapping context.
::-ms-fill-lower - Archive of obsolete content
a slider control is one possible representation of <input type="range">.
::-ms-fill-upper - Archive of obsolete content
a slider control is one possible representation of <input type="range">.
::-ms-reveal - Archive of obsolete content
the ::-ms-reveal css pseudo-element is a microsoft extension that is used to display a password reveal button for use with a password field created by <input type="password">.
::-ms-thumb - Archive of obsolete content
a slider control is one possible representation of <input type="range">.
::-ms-ticks-after - Archive of obsolete content
a slider control is one possible representation of <input type="range">.
::-ms-ticks-before - Archive of obsolete content
a slider control is one possible representation of <input type="range">.
::-ms-tooltip - Archive of obsolete content
a slider control is one possible representation of <input type="range">.
::-ms-track - Archive of obsolete content
a slider control is one possible representation of <input type="range">.
azimuth - Archive of obsolete content
ArchiveWebCSSazimuth
initial valuecenterapplies toall elementsinheritedyescomputed valuenormalized angleanimation typediscrete syntax <angle> | [ [ left-side | far-left | left | center-left | center | center-right | right | far-right | right-side ] | behind ] | leftwards | rightwards values angle audible source position is described as an angle within the range -360deg to 360deg.
Descendants and Filters - Archive of obsolete content
that is, if there are multiple descendants of the requested type, an xml list is returned, instead of the normal element.
Using JavaScript Generators in Firefox - Archive of obsolete content
you can opt in in html as follows: <script type="text/javascript;version=1.7" src="myscript.js"></script> then your myscript.js file might look like this: // need to stash the generator in a global variable.
Array comprehensions - Archive of obsolete content
for future-facing usages, consider using array.prototype.map, array.prototype.filter, arrow functions, and spread syntax.
Expression closures - Archive of obsolete content
examples a shorthand for binding event listeners: document.addeventlistener('click', function() false, true); using this notation with some of the array functions from javascript 1.6: elems.some(function(elem) elem.type == 'text'); ...
Function.arity - Archive of obsolete content
the arity property used to return the number of arguments expected by the function, however, it no longer exists and has been replaced by the function.prototype.length property.
New in JavaScript 1.5 - Archive of obsolete content
new features in javascript 1.5 number.prototype.toexponential() number.prototype.tofixed() number.prototype.toprecision() const is now a reserved word.
New in JavaScript 1.6 - Archive of obsolete content
array.prototype.indexof() array.prototype.lastindexof() array.prototype.every() array.prototype.filter() array.prototype.foreach() array.prototype.map() array.prototype.some() array generics string generics for each...in changed functionality in javascript 1.6 a bug in which arguments[n] cannot be set if n is greater than the number of formal or actual parameters has been fixed.
New in JavaScript 1.7 - Archive of obsolete content
in html or xul code, use: <script type="application/javascript;version=1.7"></script> when using the javascript shell, you need to set the version you wish to use using the -version 170 switch on the command line or using the version() function: version(170); the features that require the use of the new keywords "yield" and "let" require you to specify version 1.7 because existing code might use those keywords as variable or funct...
New in JavaScript 1.8.1 - Archive of obsolete content
new features in javascript 1.8.1 object.getprototypeof() support for native json string.prototype.trim() string.prototype.trimleft() string.prototype.trimright() changed functionality in javascript 1.8.1 implicit setting of properties in object and array initializers no longer execute setters in javascript.
ECMAScript 5 support in Mozilla - Archive of obsolete content
added in javascript 1.8.1 (gecko 1.9.1, firefox 3.5) native json support object.getprototypeof() method.
Reflect.enumerate() - Archive of obsolete content
exceptions a typeerror, if target is not an object.
JavaClass - Archive of obsolete content
you can pass a javaclass object to a java method which requires an argument of type java.lang.class.
forEach - Archive of obsolete content
jswisher 01 october 2011 <hr> there is some mistype in array.prototype.foreach: kvalue = o[ pk ]; should be kvalue = o[ k ]; <hr> this page has been the target of a revert war, and so write access to it has been restricted.
XForms Group Element - Archive of obsolete content
attributes single-node binding type restrictions the group element can be bound to a node containing data of any type.
XForms Help Element - Archive of obsolete content
type restrictions the help element can be bound to any simple content.
XForms Hint Element - Archive of obsolete content
type restrictions the hint element can be bound to any simple content.
XForms Label Element - Archive of obsolete content
type restrictions the label element can be bound to any simple content.
XForms Message Element - Archive of obsolete content
special level - defines a representation of message element type restrictions the message element can be bound to any simple content.
XForms Range Element - Archive of obsolete content
type restrictions the range element can be bound to a node of type xsd:duration, xsd:date, xsd:time, xsd:datetime, xsd:gyearmonth, xsd:gyear, xsd:gmonthday, xsd:gday, xsd:gmonth, xsd:float, xsd:decimal or xsd:double or any type derived from one of these.
XForms Switch Module - Archive of obsolete content
attributes single-node binding type restrictions the switch element can be bound to a node containing data of any type.
XForms Textarea Element - Archive of obsolete content
type restrictions the textarea element can be bound to a node of type xsd:string or any type derived from it.
Window: devicelight event - Archive of obsolete content
bubbles no cancelable no interface sensorcallback target defaultview (window) other properties property type description value read only double (float) the sensor data for ambient light in lux.
Correctly Using Titles With External Stylesheets - Archive of obsolete content
here are two examples: <link type="text/css" rel="stylesheet" title="basic styles" href="basic.css" /> <link type="text/css" rel="stylesheet" title="fish and boats" href="ocean.css" /> according to the html 4.01 specification, only one of the preferred stylesheets can be used at a time.
Displaying a graphic with audio samples - Archive of obsolete content
<!doctype html> <html> <head> <title>javascript spectrum example</title> </head> <body> <audio id="audio-element" src="revolve.ogg" controls="true" style="width: 512px;"> </audio> <div><canvas id="fft" width="512" height="200"></canvas></div> <img id="mozlogo" style="display:none" src="mozilla2.png"></img> <script> var canvas = document.getelementbyid('fft'), ctx = canvas.getcontext('2d'), channels, rate, framebufferlength, fft; function loadedmetadata() { chann...
Issues Arising From Arbitrary-Element hover - Archive of obsolete content
however, rules of this type are usually seen in conjunction with markup like this: <td class="nav"> <a href="one.html" class="nav">one</a> | <a href="two.html" class="nav">two</a> | <a href="thr.html" class="nav">three</a> | <a href="fou.html" class="nav">four</a> </td> because the enclosing table cell has a class of nav, the vertical-bar characters will turn red when the user moves the mouse pointer anywhere within the t...
Popup Window Controls - Archive of obsolete content
<html> <head> <title>detecting popup controls</title> <script type="text/javascript"> <!-- // attempt to open an unsolicited window var popup = window.open('about:blank', 'popup'); if (!popup) { // the user has suppressed the popup } // --> </script> </head> <body> <!-- your page here --> </body> </html> if your popup window is crucial to the operation of your web site you can notify the user and ask them to add your...
RDF in Fifty Words or Less - Archive of obsolete content
okay, so maybe this is a bit more than fifty words, but the key points are pretty simple (and put into bold text for you manager-types who just want to get straight to the point).
Web Standards - Archive of obsolete content
designing and building with these standards simplifies and lowers the cost of production, while delivering sites that are accessible to more people and more types of internet devices.
XQuery - Archive of obsolete content
notes for developers wishing to access xquery in their own extensions at present, the extension works simply by using liveconnect to work with berkeley db xml's java api (and via a java wrapper class which circumvents liveconnect's current inability to handle some types of java exceptions properly).
Examples - Game development
x-type vertically scrolling space shooter demo.
Introduction to game development for the Web - Game development
typed arrays javascript typed arrays give you access to raw binary data from within javascript; this lets you manipulate gl textures, game data, or anything else, even if it's not in a native javascript format.
Game monetization - Game development
exclusive licenses the exclusive license is a type of license for one publisher — you've built a game and you're selling all the rights to it to a single entity along with the rights to redistribute it — softgames are an example of such a publisher.
Bounding volume collision detection with THREE.js - Game development
// expand three.js sphere to support collision tests vs box3 // we are creating a vector outside the method scope to // avoid spawning a new instance of vector3 on every check three.sphere.__closest = new three.vector3(); three.sphere.prototype.intersectsbox = function (box) { // get box closest point to sphere center by clamping three.sphere.__closest.set(this.center.x, this.center.y, this.center.z); three.sphere.__closest.clamp(box.min, box.max); var distance = this.center.distancetosquared(three.sphere.__closest); return distance < (this.radius * this.radius); }; demos we have prepared some live demos to demon...
3D collision detection - Game development
if you have entities that will be rotating, you can either modify the dimensions of the bounding box so it still wraps the object, or opt to use another bounding geometry type, such as spheres (which are invariant to rotation.) the animated gif below shows a graphic example of an aabb that adapts its size to fit the rotating entity.
Building up a basic demo with PlayCanvas editor - Game development
as you can see, the file contains some boilerplate code already: pc.script.create('boxanimation', function (app) { // creates a new boxanimation instance var boxanimation = function (entity) { this.entity = entity; }; boxanimation.prototype = { // called once after all resources are loaded and before the first update initialize: function () { }, // called every frame, dt is time in seconds since last update update: function (dt) { } }; return boxanimation; }); the most interesting part is the update() function, which is where we can put any code that we want repeated on ever...
Desktop mouse and keyboard controls - Game development
in phaser the buttons you create will take any type of input, whether it's a touch on mobile or a click on desktop.
Mobile touch controls - Game development
an additional advantage of using phaser is that the buttons you create will take any type of input, whether it's a touch on mobile or a click on desktop — the framework sorts this out in the background for you.
Efficient animation for web games - Game development
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.
Square tilemaps implementation: Scrolling maps - Game development
cameras can either be free-form, controlled by the player (such as in strategy games) or follow an object (such as the main character in platform games.) regardless of the type of camera, we would always need information regarding its current position, viewport size, etc.
asm.js - Game development
asm.js has a very predictable perfomance rate because it is limited to an extremely restricted subset of javascript that provides only strictly-typed integers, floats, arithmetic, function calls, and heap accesses.
Create the Canvas and draw on it - Game development
using your favourite text editor, create a new html document, save it as index.html, in a sensible location, and add the following code to it: <!doctype html> <html> <head> <meta charset="utf-8" /> <title>gamedev canvas workshop</title> <style> * { padding: 0; margin: 0; } canvas { background: #eee; display: block; margin: 0 auto; } </style> </head> <body> <canvas id="mycanvas" width="480" height="320"></canvas> <script> // javascript code goes here </script> </body> </html> we have a charset defined, <title> and s...
Track the score and win - Game development
the font definition looks exactly like the one in css — you can set the size and font type in the font() method.
Animations and tweens - Game development
it takes an object containing the chosen parameter's desired ending values (scale takes a scale value, 1 being 100% of size, 0 being 0% of size, etc.), the time of the tween in milliseconds and the type of easing to use for the tween.
Initialize the framework - Game development
using your favourite text editor, create a new html document, save it as index.html, in a sensible location, and add the following code to it: <!doctype html> <html> <head> <meta charset="utf-8" /> <title>gamedev phaser workshop - lesson 01: initialize the framework</title> <style>* { padding: 0; margin: 0; }</style> <script src="js/phaser.min.js"></script> </head> <body> <script> var game = new phaser.game(480, 320, phaser.canvas, null, { preload: preload, create: create, update: update }); function preload() {}...
Player paddle and controls - Game development
in our case the world is the same as the canvas, but for other types of games, like side-scrollers for example, the world will be bigger, and you can tinker with it to create interesting effects.
Tutorials - Game development
this page contains multiple tutorial series that highlight different workflows for effectively creating different types of web games.
Visual JS GE - Game development
the server is based on node.js vs mysql, the client made in four variant on a javascript frameworks for 2d canvas js , three.js , webgl2 vs glmatrix and 2d canvas with matter.js in typescript to complete the stack.
Accessibility tree (AOM) - MDN Web Docs Glossary: Definitions of Web-related terms
additionally, the accessibility tree often contains information on what can be done with an element: a link can be followed, a text input can be typed into, etc.
Breadcrumb - MDN Web Docs Glossary: Definitions of Web-related terms
this type of navigation, if done correctly, helps users know where they are in a site and how they got there.
Browser - MDN Web Docs Glossary: Definitions of Web-related terms
a browser is the most familiar type of user agent.
CORS-safelisted response header - MDN Web Docs Glossary: Definitions of Web-related terms
by default, the safelist includes the following response headers: cache-control content-language content-type expires last-modified pragma examples extending the safelist you can extend the list of cors-safelisted response headers by using the access-control-expose-headers header: access-control-expose-headers: x-custom-header, content-length ...
CSP - MDN Web Docs Glossary: Definitions of Web-related terms
a csp (content security policy) is used to detect and mitigate certain types of website related attacks like xss and data injections.
Card sorting - MDN Web Docs Glossary: Definitions of Web-related terms
card sorting is a simple technique used in information architecture whereby people involved in the design of a website (or other type of product) are invited to write down the content / services / features they feel the product should contain, and then organize those features into categories or groupings.
Class - MDN Web Docs Glossary: Definitions of Web-related terms
prototype-based programming languages (like javascript) using functions as classes in javascript class-based programming on wikipedia object-oriented programming on wikipedia ...
Codec - MDN Web Docs Glossary: Definitions of Web-related terms
learn more general knowledge codec on wikipedia technical reference web video codec guide web audio codec guide guide to media types and formats on the web ...
Compile - MDN Web Docs Glossary: Definitions of Web-related terms
some compilers which translate between similar level languages are called transpilers or cross-compilers, for instance to compile from typescript to javascript.
Dynamic programming language - MDN Web Docs Glossary: Definitions of Web-related terms
for example, in javascript it is possible to change the type of a variable or add new properties or methods to an object while the program is running.
Empty element - MDN Web Docs Glossary: Definitions of Web-related terms
for example, <input type="text"></input> is invalid html.
Entity - MDN Web Docs Glossary: Definitions of Web-related terms
you can also use them in place of other characters that are difficult to type with a standard keyboard.
Falsy - MDN Web Docs Glossary: Definitions of Web-related terms
javascript uses type conversion to coerce any value to a boolean in contexts that require it, such as conditionals and loops.
Fetch directive - MDN Web Docs Glossary: Definitions of Web-related terms
csp fetch directives are used in a content-security-policy header and control locations from which certain resource types may be loaded.
HTTP header - MDN Web Docs Glossary: Definitions of Web-related terms
entity header: headers containing more information about the body of the entity, like its content length or its mime-type.
Houdini - MDN Web Docs Glossary: Definitions of Web-related terms
see also houdini houdini: an introduction cssom css paint api css typed om ...
Inheritance - MDN Web Docs Glossary: Definitions of Web-related terms
learn more learn about it inheritance and the prototype chain ...
Java - MDN Web Docs Glossary: Definitions of Web-related terms
java is statically typed and features a similar syntax to c.
Mutable - MDN Web Docs Glossary: Definitions of Web-related terms
mutable is a type of variable that can be changed.
NaN - MDN Web Docs Glossary: Definitions of Web-related terms
nan (not a number) is a numeric data type that means an undefined value or value that cannot be represented, especially results of floating-point calculations.
Navigation directive - MDN Web Docs Glossary: Definitions of Web-related terms
learn more https://www.w3.org/tr/csp/#directives-navigation other kinds of directives: fetch directive document directive reporting directive block-all-mixed-content upgrade-insecure-requests require-sri-for trusted-types content-security-policy ...
Null - MDN Web Docs Glossary: Definitions of Web-related terms
every object is derived from null value, and therefore typeof operator returns object for it: typeof null === 'object' // true ...
OOP - MDN Web Docs Glossary: Definitions of Web-related terms
it follows a prototype-based model (as opposed to class-based).
Packet - MDN Web Docs Glossary: Definitions of Web-related terms
there are two types of error corrections backward and forward error correction.
Page prediction - MDN Web Docs Glossary: Definitions of Web-related terms
for example, as the user types in the address bar, the browser might send the current text in the address bar to the search engine before the user submits the request.
Parent object - MDN Web Docs Glossary: Definitions of Web-related terms
learn more discussion of inheritance and prototypes in javascript ...
Proxy server - MDN Web Docs Glossary: Definitions of Web-related terms
in general there are two main types of proxy servers: a forward proxy that handles requests from and to anywhere on the internet.
Quaternion - MDN Web Docs Glossary: Definitions of Web-related terms
as such, the type dompoint (or dompointreadonly) is used to store quaternions.
REST - MDN Web Docs Glossary: Definitions of Web-related terms
a document, is transferred with its state and relationships via well-defined, standarized operations and formats or services call themselves restful when they directly modify type of document as opposed to triggering actions somewhere.
RGB - MDN Web Docs Glossary: Definitions of Web-related terms
learn more general knowledge rgb color model on wikipedia learn about it css data type: <color> ...
RTCP (RTP Control Protocol) - MDN Web Docs Glossary: Definitions of Web-related terms
that underlying protocol handles the multiplexing of the data and control packets and may use separate network ports for each type of packet.
Response header - MDN Web Docs Glossary: Definitions of Web-related terms
note that strictly speaking, the content-encoding and content-type headers are entity header: 200 ok access-control-allow-origin: * connection: keep-alive content-encoding: gzip content-type: text/html; charset=utf-8 date: mon, 18 jul 2016 16:06:00 gmt etag: "c561c68d0ba92bbeb8b0f612a9199f722e3a621a" keep-alive: timeout=5, max=997 last-modified: mon, 18 jul 2016 02:36:04 gmt server: apache set-cookie: mykey=myvalue; expires=mon, 17-jul-2017 16:06:00 gmt; max-ag...
Signature - MDN Web Docs Glossary: Definitions of Web-related terms
it may refer to: signature (functions) a function signature (or type signature, or method signature) defines input and output of functions or methods.
State machine - MDN Web Docs Glossary: Definitions of Web-related terms
there are two types of basic state machines: deterministic finite state machine this kind allows only one possible transition for any allowed input.
Static method - MDN Web Docs Glossary: Definitions of Web-related terms
in a web api, a static method is one which is defined by an interface but can be called without instantiating an object of that type first.
String - MDN Web Docs Glossary: Definitions of Web-related terms
learn more general knowledge string (computer science) on wikipedia javascript data types and data structures ...
Synchronous - MDN Web Docs Glossary: Definitions of Web-related terms
many programming commands are also synchronous — for example when you type in a calculation, the environment will return the result to you instantly, unless you program it not to.
Thread - MDN Web Docs Glossary: Definitions of Web-related terms
a special type of worker, called a service worker, can be created which can be left behind by a site—with the user's permission—to run even when the user isn't currently using that site.
Truthy - MDN Web Docs Glossary: Definitions of Web-related terms
javascript uses type coercion in boolean contexts.
WebDAV - MDN Web Docs Glossary: Definitions of Web-related terms
author or creation date) link pages of any media type to related pages create sets of documents and retrieve hierarchical list copy and move webpages lock a document from being edited by more than one person at a time learn more general knowledge webdav on wikipedia technical reference rfc 2518 rfc 3253 rfc 3744 ...
WebIDL - MDN Web Docs Glossary: Definitions of Web-related terms
webidl is the interface description language used to describe the data types, interfaces, methods, properties, and other components which make up a web application programming interface (api).
XLink - MDN Web Docs Glossary: Definitions of Web-related terms
for those who may have found xlink 1.0 cumbersome for regular links, xlink 1.1 drops the need to specify xlink:type="simple" for simple links.
Array - MDN Web Docs Glossary: Definitions of Web-related terms
what an array in javascript looks like: let myarray = [1, 2, 3, 4]; let catnamesarray = ["jacqueline", "sophia", "autumn"]; //arrays in javascript can hold different types of data, as shown above.
caret - MDN Web Docs Glossary: Definitions of Web-related terms
<input type="text"> <input type="password"> <input type="search"> <input type="date">, <input type="time">, <input type="datetime">, and <input type="datetime-local"> <input type="number">, <input type="range"> <input type="email">, <input type="tel">, and <input type="url"> <textarea> any element with its contenteditable attribute set ...
markup - MDN Web Docs Glossary: Definitions of Web-related terms
types of markup language presentational markup: used by traditional word processing sytem with wysiwyg (what you see it is what you get); this is hidden from human authors, users and editors.
undefined - MDN Web Docs Glossary: Definitions of Web-related terms
example var x; //create a variable but assign it no value console.log("x's value is", x) //logs "x's value is undefined" learn more general knowledge undefined value on wikipedia technical reference javascript data types and data structures ...
What is accessibility? - Learn web development
the main types of disability to consider are explained below, along with any special tools they use to access web content (known as assistive technologies, or ats).
Debugging CSS - Learn web development
previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Handling different text directions - Learn web development
previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Overflowing content - Learn web development
previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Attribute selectors - Learn web development
previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Combinators - Learn web development
previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Sizing items in CSS - Learn web development
previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
How CSS works - Learn web development
the browser parses the fetched css, and sorts the different rules by their selector types into different "buckets", e.g.
What is CSS? - Learn web development
browsers are the main type of user agent we think of when talking about css, however, it is not the only one.
Styling text - Learn web development
typesetting a community school homepage in this assessment we'll test your understanding of styling text by getting you to style the text for a community school's homepage.
Learn to style HTML using CSS - Learn web development
this module looks at the cascade and inheritance, all the selector types we have available, units, sizing, styling backgrounds and borders, debugging, and lots more.
How do you make sure your website works properly? - Learn web development
frequent errors the most frequent errors that we find are these: typos in the address we wanted to type http://demozilla.examplehostingprovider.net/ but typed too fast and forgot an “l”: the address cannot be found.
How do you upload your files to a web server? - Learn web development
in the logon type: drop down, choose normal, then fill in your provided username and password in the relevant fields.
What is a web server? - Learn web development
for example, relying on http alone, a server can't remember a password you typed or remember your progress on an incomplete transaction.
What is accessibility? - Learn web development
from a design point of view, we suggest learning about designing for all types of users.
Common questions - Learn web development
how can we design for all types of users?
Example 3 - Learn web development
: 0 0 .4em .4em; box-shadow: 0 .2em .4em rgba(0,0,0,.4); -moz-box-sizing : border-box; box-sizing : border-box; min-width : 100%; max-height: 10em; /* 100px */ overflow-y: auto; overflow-x: hidden; } .select .option { padding: .2em .3em; } .select .highlight { background: #000; color: #ffffff; } javascript content // ------- // // helpers // // ------- // nodelist.prototype.foreach = function (callback) { array.prototype.foreach.call(this, callback); } // -------------------- // // function definitions // // -------------------- // function deactivateselect(select) { if (!select.classlist.contains('active')) return; var optlist = select.queryselector('.optlist'); optlist.classlist.add('hidden'); select.classlist.remove('active'); } function activesele...
Example 4 - Learn web development
: 0 0 .4em .4em; box-shadow: 0 .2em .4em rgba(0,0,0,.4); -moz-box-sizing : border-box; box-sizing : border-box; min-width : 100%; max-height: 10em; /* 100px */ overflow-y: auto; overflow-x: hidden; } .select .option { padding: .2em .3em; } .select .highlight { background: #000; color: #ffffff; } javascript content // ------- // // helpers // // ------- // nodelist.prototype.foreach = function (callback) { array.prototype.foreach.call(this, callback); } // -------------------- // // function definitions // // -------------------- // function deactivateselect(select) { if (!select.classlist.contains('active')) return; var optlist = select.queryselector('.optlist'); optlist.classlist.add('hidden'); select.classlist.remove('active'); } function activesele...
Example 5 - Learn web development
: 0 0 .4em .4em; box-shadow: 0 .2em .4em rgba(0,0,0,.4); -moz-box-sizing : border-box; box-sizing : border-box; min-width : 100%; max-height: 10em; /* 100px */ overflow-y: auto; overflow-x: hidden; } .select .option { padding: .2em .3em; } .select .highlight { background: #000; color: #ffffff; } javascript content // ------- // // helpers // // ------- // nodelist.prototype.foreach = function (callback) { array.prototype.foreach.call(this, callback); } // -------------------- // // function definitions // // -------------------- // function deactivateselect(select) { if (!select.classlist.contains('active')) return; var optlist = select.queryselector('.optlist'); optlist.classlist.add('hidden'); select.classlist.remove('active'); } function activesele...
Test your skills: Form validation - Learn web development
change the type of the "email address" and "phone number" fields to make the browser apply some more specific validation suitable for the data being asked for.
Test your skills: Other controls - Learn web development
associate the list with your text input, so that when you type characters, any of the list options that match the character sequence are given in a dropdown list as autocomplete suggestions.
The web and web standards - Learn web development
libraries and frameworks built on top of javascript that allow you to build certain types of web site much more quickly and effectively.
HTML Cheatsheet - Learn web development
embedded audio with alternative sources <audio controls="controls"><source src="https://udn.realityripple.com/samples/b7/193cb038d0.mp3" type="audio/mpeg"><source src="https://udn.realityripple.com/samples/f7/14a4179ee6.ogg" type="audio/ogg"> your browser does not support audio.
Creating hyperlinks - Learn web development
inside the html body, add one or more paragraphs or other types of content you already know about.
Test your skills: Multimedia and embedding - Learn web development
you must explicitly set the type as subtitles, and the subtitle language to english.
HTML table advanced features and accessibility - Learn web development
your finished table should look something like the following: hidden example <!doctype html> <html> <head> <meta charset="utf-8"> <title>my spending record</title> <style> html { font-family: sans-serif; } table { border-collapse: collapse; border: 4px solid rgb(200,200,200); letter-spacing: 1px; font-size: 0.8rem; } td, th { border: 2px solid rgb(190,190,190); ...
Functions — reusable blocks of code - Learn web development
previous overview: building blocks next another essential concept in coding is functions, which allow you to store a piece of code that does a single task inside a defined block, and then call that code whenever you need it using a single short command — rather than having to type out the same code multiple times.
Test your skills: Object basics - Learn web development
genre: what type of music the band plays.
JavaScript — Dynamic client-side scripting - Learn web development
javascript building blocks in this module, we continue our coverage of all javascript's key fundamental features, turning our attention to commonly-encountered types of code block such as conditional statements, loops, functions, and events.
Perceived performance - Learn web development
make things like type-ahead a progressive enhancement: use css to display input modal, js to add typeahead/autocomplete as it is available make task initiators appear more interactive making a content request on keydown rather than waiting for keyup can shave 200ms off the perceived load of the content.
The business case for web performance - Learn web development
the budget can be applied to a single file, a file type, all files loaded on a page, a specific metric, or a threshold over a period of time.the budget reflects reachable goals; whehter they are time, quantity, or rule based.
The "why" of web performance - Learn web development
building websites requires html, css, and javascript, typically including binary file types such as images and video.
Learning area release notes - Learn web development
you can see these on: css layout: flexbox css layout: grids css layout: floats december 2019 we are adding a new type of assessment article to the learning area — "test your skills" — which will offer several short questions aimed at rapidly testing whether you understood what is going on.
Server-side website programming first steps - Learn web development
prerequisites before starting this module, you don't need to have any knowledge of server-side website programming, or indeed any other type of programming.
Ember resources and troubleshooting - Learn web development
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 svelte deployment and next steps ...
Getting started with React - Learn web development
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 svelte deployment and next steps ...
React resources - Learn web development
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 svelte deployment and next steps ...
Vue resources - Learn web development
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 svelte deployment and next steps ...
Introduction to cross browser testing - Learn web development
overview: cross browser testing next this article starts the module off by providing an overview of the topic of (cross) browser testing, answering questions such as "what is cross browser testing?", "what are the most common types of problems you'll encounter?", and "what are the main approaches for testing, identifying, and fixing problems?" prerequisites: familiarity with the core html, css, and javascript languages.
Strategies for carrying out testing - Learn web development
previous overview: cross browser testing next this article starts the module off by providing an overview of the topic of (cross) browser testing, answering questions such as "what is cross-browser testing?", "what are the most common types of problems you'll encounter?", and "what are the main approaches for testing, identifying, and fixing problems?" prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high level principles of cross-browser testing.
Setting up your own test automation environment - Learn web development
for example, to select an element by id: const element = driver.findelement(by.id('myelementid')); one of the most useful ways to find an element by css — the by.css method allows you to select an element using a css selector enter the following at the bottom of your quick_test.js code now: const button = driver.findelement(by.css('button:nth-of-type(1)')); testing your element there are many ways to interact with your web documents and elements on them.
Deploying our app - Learn web development
and many more types.
Understanding client-side web development tools - Learn web development
client-side tooling can be intimidating, but this series of articles aims to illustrate the purpose of some of the most common client-side tool types, explain the tools you can chain together, how to install them using package managers, and control them using the command line.
Accessibility information for UI designers and developers
on desktop with a keyboard, it lets people type a character, say ‘k’, to jump directly to options starting with ‘k’.
Information for External Developers Dealing with Accessibility
mac os x: this document list all functions of specified keys, known keyboard shortcuts, explains how to create keyboard shortcuts, explains appropriate use for the arrow keys, how to move the insertion point with keys, how to extent text selection with keys, functions of function keys, what are reserved keyboard shortcuts, how to create your own keyboard shortcuts, keyboard focus and navigation, type-ahead and key-repeat, etc.
Mozilla's Section 508 Compliance
caveats: 1) although sidebar cannot be customized without a mouse, all sidebar functions that come with the browser are available through other means 2) java and in-page plugins cannot be used with the keyboard, so they must not be installed for keyboard-only users additional features for the keyboard: 1) find as you type allows for quick navigation to links and convenient text searching 2) browse with caret (f7 key toggles) allows users to select arbitrary content with the keyboard and move through content as if inside a readonly editor.
Accessible Toolkit Checklist
for autocomplete lists, use the system color offset by 1, so that it looks active but the list items don't get echoed while they user's trying to simply type and edit.
Accessibility and Mozilla
all accessibility apis to date define a list of possible object roles, or general types, such as button, menu item, text, etc.
Frequently Asked Questions for Lightweight themes
lightweight themes work with any type of computer that has firefox installed.
Lightweight themes
read more about the types of creative common licenses.
Theme concepts
add the theme image file to the folder: <mytheme> <your_header_image>.<type> create a file called manifest.json in the folder and edit its content as follows: { "manifest_version": 2, "version": "1.0", "name": "<your_theme_name>", "theme": { "images": { "theme_frame": "<your_header_image>.<type>" }, "colors": { "frame": "#ffffff", "tab_background_text": "#000" } } } where: "frame": is the heading area background ...
A bird's-eye view of the Mozilla framework
when an html, xml, svg or other type of document is loaded, the nglayout engine (also known as gecko) parses the contents into a dom tree, and handles the layout and rendering of the document pages.
Building SpiderMonkey with UBSan
the stack trace should show a function such as __ubsan_handle_load_invalid_value or __ubsan_handle_type_mismatch being called by the buggy c++ code.
Creating JavaScript callbacks in components
remember (or discover) that addeventlistener is a method of the nsidomeventtarget interface and is defined as such: void addeventlistener(in domstring type, in nsidomeventlistener listener, in boolean usecapture); however, it is extremely common to see developers pass a normal javascript function for the listener instead of an nsidomeventlistener implementation: function doload(event) { // do something here } window.addeventlistener("load", doload, false); revealing the magic how is this possible?
Creating a Login Manager storage module
const cc = components.classes; const ci = components.interfaces; components.utils.import("resource://gre/modules/xpcomutils.jsm"); function sampleloginmanagerstorage() {} sampleloginmanagerstorage.prototype = { classdescription: "sample nsiloginmanagerstorage implementation", contractid: "@example.com/login-manager/storage/sample;1", classid: components.id("{364a118c-747a-4f6d-ac63-2d2998e5a5c1}"), queryinterface: xpcomutils.generateqi([ci.nsiloginmanagerstorage]), // this registers the category for overriding the built-in nsiloginmanagerstorage _xpcom_categories: [ { category...
Capturing a minidump
at this point, you should type ".dump /ma c:\temp\firefoxcrash.dmp" -- without the quotes, but don't forget the dot at the beginning.
Debugging Frame Reflow
log file analysis the log file for a simple table like <!doctype html public "-//w3c//dtd html 4.01 transitional//en"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> </head> <body> <table width="100"> <tbody> <tr> <td>foo</td> </tr> </tbody> </table> </body> </html> will create the following log: vp 00b97c30 r=0 a=9180,4470 c=9180,4470 cnt=856 scroll 00b97ee0 r=0 a=9180,4470 c=9180,4470 cnt=857 s...
Debugging JavaScript
strict code checking if you set the pref javascript.options.strict to true, the javascript engine gives you more types of warnings on the error console, most of which hint at code bugs that are easy to oversee or even bad syntax.
Debugging Table Reflow
the following constraint types are known: enoconstraint = 0, epixelconstraint = 1, // pixel width epercentconstraint = 2, // percent width eproportionconstraint = 3, // 1*, 2*, etc.
Debugging on Windows
type/copy/drag the memory address of "int 3" into the memory view to get it to update on that part of the memory.
Building Firefox with Debug Symbols
ac_add_options --enable-debug-symbols this can optionally take an argument for the type of symbols that need to be produced (like "-g3").
Gmake vs. Pymake
for example, if using the default objdir, you might type in the root of your source tree: mkdir obj-i686-pc-mingw32; cd obj-i686-pc-mingw32; python ../build/pymake/make.py -f ../client.mk.
Makefile - variables
os_ variable description os_arch platform type os_target target binary type if building on an intermediate platform(building mobile binaries on gnu/linux).
Old Thunderbird build
first, cd into the comm-central subdirectory (created automatically by the previous command): cd comm-central then run: python client.py checkout on some types of network connections, "hg clone" might fail because it gets interrupted.
The Firefox codebase: CSS Guidelines
when importing your stylesheets, it's best to import the content css before the theme css, that way the theme values get to override the content values (which is probably what you want), and you're going to want them both after the global values, so your imports will look like this: <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <?xml-stylesheet href="chrome://browser/content/path/module.css" type="text/css"?> <?xml-stylesheet href="chrome://browser/skin/path/module.css" type="text/css"?> [1] -moz-appearance is tricky.
Inner and outer windows
in order to represent these levels of complexity, two "types" of window need to be considered.
Contributing to the Mozilla code base
if getting involved in design, support, translation, testing, or other types of contributions sparks your interest please see community webiste.
Listening to events on all tabs
this value is a combination of one of the state transition flags and one or more of the state type flags defined in the nsiwebprogresslistener documentation.
Experimental features in Firefox
nightly 55 no developer edition 55 no beta 55 no release 55 no preference name dom.payments.request.enabled and dom.payments.request.supportedregions basic card api extends the payment request api with dictionaries that define data structures describing card payment types and payment responses.
Communicating with frame scripts
wsermm = gbrowser.selectedbrowser.messagemanager; browsermm.loadframescript("chrome://my-addon@me.org/content/frame-script.js", false); messagemanagers.push(browsermm); console.log(messagemanagers.length); we can listen for message-manager-disconnect to update the array when the message managers disconnect (for example because the user closed the tab): function myobserver() { } myobserver.prototype = { observe: function(subject, topic, data) { var index = messagemanagers.indexof(subject); if (index != -1) { console.log("one of our message managers disconnected"); mms.splice(index, 1); } }, register: function() { var observerservice = cc["@mozilla.org/observer-service;1"] .getservice(ci.nsiobserverservice); observerservice.addob...
Frame script loading and lifetime
if you want to limit a script to the lifetime of a page you can create a sandbox instead, where the current content page is used as prototype.
Performance
} object.assign(contentypolicy.prototype, { classdescription: ..., classid: ..., contractid: ..., queryinterface: xpcomutils.generateqi([ci.nsicontentpolicy]), shouldload: function(type, location, origin, context) { let resultlist = services.cpmm.sendsyncmessage("my-addon:check-load", {destination: location, source: origin}) // <=== sync message!
Message manager overview
there are three different subtypes of frame message manager: the global message manager, the window message manager, and the browser message manager.
Performance best practices for Firefox front-end engineers
this is a special type of content-only reflow that checks at particular points whether or not it should be interrupted (usually to respond to user events).
Firefox UI considerations for web developers
providing a top sites ready icon the simple rule is to provide an icon which is at least 96x96 pixels in size, using a <link> element whose rel attribute is a reference to a file containing an icon of a supported type.
Using the Browser API
MozillaGeckoChromeAPIBrowser APIUsing
the search bar also contains buttons, as well as a form to type search requests into.
HTMLIFrameElement.getStructuredData()
erloadend',function() { var request = browser.getstructureddata(); request.onsuccess = function() { console.log(request.result); } }); running this code in a browser api app and then loading up a page that contains microdata (such as the website of british alt-country band salter cane) will result in a json object being returned, along the lines of: { "items": [ { "type":["http://microformats.org/profile/hcard"], "properties":{"fn":["chris askew"], "n":[ { "properties": { "given-name":["chris"], "family-name":["askew"], ...
mozbrowseractivitydone
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.
mozbrowserasyncscroll
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.
mozbrowseraudioplaybackchange
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.
mozbrowsercaretstatechanged
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.
mozbrowserfindchange
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.
mozbrowsericonchange
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.
mozbrowserloadend
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.
mozbrowserlocationchange
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.
mozbrowsermanifestchange
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.
mozbrowseropentab
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.
mozbrowseropenwindow
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.
mozbrowserresize
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.
mozbrowserscroll
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.
mozbrowserscrollareachanged
this can occur on resize and when the page size changes (while loading for example.) 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.
mozbrowserscrollviewchange
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.
mozbrowsersecuritychange
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.
mozbrowserselectionstatechanged
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.
mozbrowsertitlechange
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.
mozbrowserusernameandpasswordrequired
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.
mozbrowservisibilitychange
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.
-moz-window-dragging
<window>, <panel> inherited no media visual computed value as specified animation type discrete canonical order the unique non-ambiguous order defined by the formal grammar syntax the -moz-window-dragging property is specified as one of the keyword values listed below.
::-moz-tree-progressmeter
activated when the type attribute is set to progressmeter.
overflow-clip-box-block
/* keyword values */ overflow-clip-box-block: padding-box; overflow-clip-box-block: content-box; /* global values */ overflow-clip-box-block: inherited; overflow-clip-box-block: initial; overflow-clip-box-block: unset; note: on gecko, by default, padding-box is used everywhere, but <input type="text"> and similar use the value content-box.
overflow-clip-box-inline
/* keyword values */ overflow-clip-box-inline: padding-box; overflow-clip-box-inline: content-box; /* global values */ overflow-clip-box-inline: inherited; overflow-clip-box-inline: initial; overflow-clip-box-inline: unset; note: on gecko, by default, padding-box is used everywhere, but <input type="text"> and similar use the value content-box.
Chrome-only CSS reference
MozillaGeckoChromeCSS
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 attribute.::-moz-tree-indentationactivated by the properties attribute.::-moz-tree-lineactivated by the properties attribute.::-moz-tree-progressmeteractivated when the type attribute is set to progressmeter.
MozBeforePaint
<!doctype html> <html> <body> <div id="d" style="width:100px; height:100px; background:lime; position:relative;"></div> <script> var d = document.getelementbyid("d"); var start = window.mozanimationstarttime; function step(event) { var progress = event.timestamp - start; d.style.left = math.min(progress/10, 200) + "px"; if (progress < 2000) { window.mozrequestanimationframe(); } else { wind...
Embedding Tips
if necessary you may also implement the nsiuricontentlistener::ispreferred(), returning pr_true to ensure you are always the preferred uri handler and are called no matter what the content type.
Script security
security principals there are four types of security principal: the system principal, content principals, expanded principals, and the null principal.
Getting from Content to Layout
examples of this type of code are in wipecontainingblock.
HTTP Cache
currently we have 3 types of storages, all the access methods return an nsicachestorage object: memory-only (memorycachestorage): stores data only in a memory cache, data in this storage are never put to disk disk (diskcachestorage): stores data on disk, but for existing entries also looks into the memory-only storage; when instructed via a special argument also primarily looks into application ca...
How to get a stacktrace for a bug report
to access all of your submitted reports type "about:crashes" into the firefox address bar and press enter.
How to get a stacktrace with WinDbg
while firefox is running, you will not be able to type any commands into the debugger.
IPDL Best Practices
when to run code here's a rundown on appropriate places to run certain kinds of code: manager::allocpprotocol - allocation manager::recvpprotocolconstructor - initialization, protocol deletion (the typeaheadfind protocol uses one-shot protocols like this) actor::recv__delete__ - cleanup, ipdl calls still valid but ill-advised actor::actordestroy - non-ipdl cleanup manager::deallocpprotocol - deallocation one construct to avoid: class protocolparent { public: ~protocolparent() { send__delete__(this); } }; class protocolmanagerparent { public: pprotocolparent* allocppr...
Extending a Protocol
once it's compiled, ./mach run and you should be able to spin up the developer console and type: navigator.echo("hi!"); that will return a pending promise that never settles.
PBackground
this has lead to a rather awkward pattern seen in some parts of the gecko codebase, looking something like this (try searching for geckoprocesstype_default in dxr): if (xre_getprocesstype() == geckoprocesstype_default) { dothething(arguments); } else { mipdlprotocol->senddothething(arguments); } this can get unwieldy very quickly, so a better solution was needed.
IPC Protocol Definition Language (IPDL)
current docs ipdl tutorial quick start: creating a new protocol quick start: extending a protocol ipdl type serialization ipdl best practices ipdl glossary pbackground future planned docs ipdl language reference error and shutdown handling in ipdl protocols how ipdl uses processes, threads, and sockets ipdl shared memory ...
JavaScript Tips
for instance, windowmanager.getenumerator(atype).hasmoreelements() may be replaced with windowmanager.getmostrecentwindow(atype) != null for a single window.
AddonAuthor
represents a creator, developer, contributor or translator of an add-on attributes attribute type description name string the name of the person.
AddonScreenshot
attributes attribute type description url string the url of the screenshot.
UpdateCheckListener
void onupdatecheckerror( in integer status ) parameters status a value representing the type of failure; see the range of possible values.
UpdateInfo
attributes attribute type description version string the version of the update.
AsyncShutdown.jsm
properties attribute type description profilebeforechange read only phase the profile is about to be unmounted.
DownloadError
properties attribute type description result read only nsresult the result code associated with this error.
DownloadSource
properties attribute type description url read only string the uri for the download source.
DownloadSummary
method overview promise bindtolist(downloadlist alist); promise addview(object aview); promise removeview(object aview); properties attribute type description allhavestopped read only boolean indicates whether all the downloads are currently stopped.
DownloadTarget
method overview promise refresh() properties attribute type description exists read only boolean indicates whether or not the target file exists.
OS.File.Info
rmining the owner of a file let promise = os.file.stat() promise.then( function onsuccess(info) { if ("unixowner" in info) { // info.unixowner holds the owner of the file } else { // information is not available on this platform } } ); evolution of this example bug 802534 will introduce the ability to check whether field unixowner appears in os.file.info.prototype, which will make it possible to write faster code.
OS.File for the main thread
typeerror if options.bytes is specified and is larger than source.bytelength.
Promise
documentation conventions in documentation, the type of the fulfillment value is usually specified between angular brackets.
Deferred
method overview void resolve([optional] avalue); void reject([optional] areason); properties attribute type description promise read only promise a newly created promise, initially in the pending state.
Using workers in JavaScript code modules
it works exactly like a standard worker, except that it has access to js-ctypes via a global ctypes object available in the global scope of the worker obsolete since gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5)this feature is obsolete.
Translation phase
each group of projects employs a different type of l10n tool for, you guessed it, localizing the projects.
Creating localizable web applications
x 1px; display:inline; line-height: 25px; padding: 6px 6px 6px 10px; } .button .arrow { background: transparent url(../img/main-sprites.png) no-repeat scroll -651px 1px; padding: 6px 15px; } html[dir='rtl'] .button .arrow { /* flip the arrow to point to the left*/ background: transparent url(../img/main-sprites.png) no-repeat scroll -601px 1px; } html/php: <button type="submit" class="button"><span><?= _('get started'); ?></span><span class="arrow"></span></button> don't put captions in the images image 1.
Setting up the infrastructure
first, make your project's file type decision (see localization formats for details): html/php .lang gettext (.po) assuming you chose gettext, you'll need to follow the steps below to set up the infrastructure for localizing your web application.
What every Mozilla translator should know
specify the branch (1.9.2 for firefox 3.6, 1.9.2.1 for firefox 3.6.1, ...) attach the diff file to the bug: content type: patch mark the approval1.9.xxx with ?
gettext
# #, fuzzy msgid "" msgstr "" "project-id-version: package version\n" "report-msgid-bugs-to: \n" "pot-creation-date: 2009-09-28 16:18+0200\n" "po-revision-date: year-mo-da ho:mi+zone\n" "last-translator: full name <email@address>\n" "language-team: language <ll@li.org>\n" "mime-version: 1.0\n" "content-type: text/plain; charset=charset\n" "content-transfer-encoding: 8bit\n" "plural-forms: nplurals=integer; plural=expression;\n" #.
MathML Screenshots
screen captures of mtable, showing typesetting mathematical constructs in 2d.
MathML Demo: <mo> - operator, fence, separator, or accent
[ a b c d ] ⁢ [ a b c d ] we want the row vector to typeset at the same level as the top row of the column vector, but this is difficult to achieve.
Mozilla Style System
however, they also exist for the other types of rule processors.
Measuring performance using the PerfMeasurement.jsm code module
for instance, let's measure instructions executed, cache references, and cache misses: let monitor = new perfmeasurement(perfmeasurement.cpu_cycles | perfmeasurement.cache_references | perfmeasurement.cache_misses); this creates a new perfmeasurement object, configured to record the specified event types.
Profiling with Xperf
all lead to the same summary graphs), 3 types of allocations are listed -- aifi, aifo, aofi.
Refcount tracing and balancing
xpcom_mem_log_classes this variable should contain a comma-separated list of names which will be used to compare against the types of the objects being logged.
Scroll-linked effects
<body style="height: 5000px"> <style> body, /* blink currently has bug that requires declaration on `body` */ html { scroll-snap-type: y proximity; } .snaptarget { scroll-snap-align: start; position: relative; top: 200px; height: 200px; background-color: green; } </style> <div class="snaptarget"></div> </body> this version can work smoothly in the browser even if there is slow-running javascript on the browser's main thread.
about:memory
once firefox's memory usage has gotten high) open a new tab and type "about:memory" into the address bar and hit "enter".
accessibility.tabfocus
type:integer default value: 7 (windows and linux); 2 (mac os x) exists by default: no application support:gecko 1.7 status: active introduction: bugs: bug 140612 values 1 give focus only to text fields (default on mac osx) 2 give focus to all form elements except text fields.
browser.altClickSave
type:boolean default value: false exists by default: yes application support:firefox 13.0 status: active; last updated 2012-03-19 introduction: pushed to nightly on 2012-03-02 bugs: bug 713052 values true clicking a link while holding the alt key starts the download of that link.
browser.dom.window.dump.file
type:string default value:none exists by default: no application support: gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) status: active; last updated 2012-03-18 introduction: pushed to nightly on 2009-04-24 bugs: bug 489938 values the value holds the file system path for the file in which the content of the window.dump() calls get written, e.g.
browser.download.lastDir.savePerSite
type:boolean default value:true exists by default: no application support:firefox 11.0 status: active; last updated 2012-02-15 introduction: pushed to nightly on 2011-12-11 bugs: bug 702748 values true (default) the last used directory for the website (host) serving the file for download will be preselected in the file picker.
browser.pagethumbnails.capturing_disabled
type:boolean default value:true exists by default: no application support: firefox 14.0 status: active; last updated 2012-09-17 introduction: pushed to nightly on 2012-04-13 bugs: bug 726347 values false the application creates screenshots of visited web pages.
browser.search.context.loadInBackground
type:boolean default value:false exists by default: yes application support: firefox 13.0 status: active; last updated 2012-02-17 introduction: pushed to nightly on 2012-02-15 bugs: bug 727131 values true new tab with search results will be opened in the background, focus stays on the current tab.
browser.urlbar.formatting.enabled
type:boolean default value: true exists by default: yes application support:firefox 6.0 status: active; last updated 2012-04-03 introduction: pushed to nightly on 2011-05-03 bugs: bug 451833 values true (default) the domain name including the top level domain is highlighted in the address bar by coloring it black and the other parts grey.
browser.urlbar.trimURLs
type:boolean default value: true exists by default: yes application support:firefox 7.0 status: active; last updated 2012-04-03 introduction: pushed to nightly on 2011-06-23 bugs: bug 665580 values true (default) if the active url is exactly the domain name, the trailing slash (/) behind the top level domain will be hidden.
dom.event.clipboardevents.enabled
type:boolean default value:true exists by default: no application support: gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10) status: active; last updated 2012-02-15 introduction: pushed to nightly on 2012-02-14 bugs: bug 542938 values true (default) the oncopy, oncut and onpaste events are enabled for web content.
javascript.options.showInConsole
type:boolean default value: false (true in debug builds) exists by default: yes application support:firefox 1.0 status: active introduction:2002-02-26 bugs: bug 125181 bug 337875 values false only errors and warnings from content code are shown.
mail.tabs.drawInTitlebar
type:boolean default value: true exists by default: yes application support:thunderbird 17.0 status: active; last updated 2012-09-17 introduction: pushed to daily on 2012-08-08 bugs: bug 771816 values true (default) the tabs are drawn in the title bar of the mail program.
nglayout.debug.disable xul fastload
type:boolean default value: false (true in debug builds) exists by default: yes application support:?
reader.parse-on-load.force-enabled
type:boolean default value: false exists by default: yes application support:firefox mobile 23.0 status: active; last updated 2013-05-11 introduction: pushed to nightly on 2013-05-06 bugs: bug 867875 values true reader mode is enabled independent of memory available.
ui.SpellCheckerUnderline
type:string default value:#ff0000 exists by default: no application support: gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) status: active; last updated 2012-02-21 introduction: pushed to nightly on 2009-04-03 bugs: bug 338209 values a color code like #ff0000 for red.
ui.SpellCheckerUnderlineStyle
type:integer default value:5 exists by default: no application support: gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) status: active; last updated 2012-02-22 introduction: pushed to nightly on 2009-04-03 bugs: bug 338209 values the values are defined in nsstyleconsts.h.
ui.alertNotificationOrigin
type:integer default value:dependent on position of taskbar or equivalent exists by default: no application support: gecko 1.8.1.2 (firefox 2.0.0.2 / thunderbird 2.0.0.4 / seamonkey 1.1) status: active; last updated 2012-02-22 introduction: pushed to nightly on 2007-01-04 bugs: bug 133527 values 0 bottom right corner, vertical slide-in from the bottom 1 bottom right corner, horizontal slide-in from the right 2 bottom left corner, vertical slide-in from the bottom 3 bottom left corner, horizontal slide-in from the left 4 top right corner, vertical slide-in from the top 5 top right corner, horizontal slide-in from the right 6...
ui.textSelectBackground
type:string with rgb hex value as color code default value:#ef0fff (blue) [1] exists by default: no application support: before gecko 1.7 status: active; last updated 2015-09-21 introduction: pushed to trunk on 2000-04-13 bugs: bug 34704 [1]: nsxplookandfeel.cpp, line 628, retrieved 2015-09-21 ...
ui.textSelectForeground
type:string with rgb hex value as color code default value:#ffffff (white) [1] exists by default: no application support: before gecko 1.7 status: active; last updated 2015-09-21 introduction: pushed to trunk on 2000-04-13 bugs: bug 34704 [1]: nsxplookandfeel.cpp, line 635, retrieved 2015-09-21 ...
ui.tooltipDelay
type:integer default value:500 exists by default: no application support: gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8) status: active; last updated 2012-02-21 introduction: pushed to nightly on 2011-12-15 bugs: bug 204786 values integer (milliseconds, default: 500) the time for delay between the mouse stopping over the element and the tooltip appearing is stored in milliseconds and the default value is 500ms.
view_source.syntax_highlight
type:boolean default value: true exists by default: yes application support:firefox 1.0 status: active introduction: bugs: bug 52154 values true (default) syntax hightlighting is enabled.
Preferences system
d | examples | troubleshooting reference: prefwindow | prefpane | preferences | preference | xul attributes use code for a typical preferences window may look like this: <prefwindow id="apppreferences" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <prefpane id="pane1" label="&pane1.title;"> <preferences> <preference id="pref1" name="pref.name" type="bool"/> </preferences> ..
Patches and pushes
<searchplugin xmlns="http://www.mozilla.org/2006/browser/search/"> <shortname>yahoo</shortname> <description>yahoo search</description> <inputencoding>utf-8</inputencoding> <image width="16" height="16">data:image/x-icon;base64,r0lgodlheaaqajecap8aaaaaap///waaach5baeaaaialaaaaaaqabaaaaipli+py+0nogquybdened2khkffwuamezmpzsfmaihphrrguum/ft+uwaaow==</image> ***this tag is optional***<url type="application/x-suggestions+json" method="get" template="http://ff.search.yahoo.com/gossip?output=fxjson&amp;command={searchterms}" />*** <url type="text/html" method="get" template="http://search.yahoo.com/search"> <param name="p" value="{searchterms}"/> <param name="ei" value="utf-8"/> <mozparam name="fr" condition="pref" pref="yahoo-fr" /> </url> <searchform>http://search.yahoo.com/...
Research and prep
e-commerce search these search engines should allow users to get connected to new and used products they want to buy as quickly and painlessly as possible in a "trusted" site -- for example, choosing the most popular auction, general shopping, or classified type sites that have the desired user experience are good choices.
Crash reporting
type about:crashes into your location bar to get a page listing both submitted and unsubmitted crash reports.
Firefox Sync
the exact types of information synced is user-configurable in the browser's preferences or options page.
AsyncTestUtils extended framework
if you have the following types of listeners you can use the following pre-defined helpers: nsiurllistener: asyncurllistener (predefined).
NSPR Poll Method
the prototype of the poll method is print16 poll_method(prfiledesc *fd, print16 in_flags, print16 *out_flags); the purpose of the poll method is to allow a layer to modify that flags that will ultimately be used in the call to the underlying network transport's select (or equivalent) function, and to indicate that a layer is already able to make progress in the manner suggested by the polling flags.
NSPR's Position On Abrupt Thread Termination
if threads have to maintain the same type of resource knowledge as a process, they loose all of their benefit.
Anonymous Shared Memory
anonymous memory protocol anonymous shared memory functions anonymous memory protocol nspr provides an anonymous shared memory based on nspr's prfilemap type.
Dynamic Library Linking
library linking types these data types are defined for dynamic library linking: prlibrary prstaticlinktable library linking functions the library linking functions are: pr_setlibrarypath pr_getlibrarypath pr_getlibraryname pr_freelibraryname pr_loadlibrary pr_unloadlibrary pr_findsymbol pr_findsymbolandlibrary finding symbols defined in the main executable program pr_loadlibrary cannot open a handle that references the main executable program.
Hash Tables
hash table types and constants hash table functions hash table types and constants plhashentry plhashtable plhashnumber plhashfunction plhashcomparator plhashenumerator plhashallocops hash table functions pl_newhashtable pl_hashtabledestroy pl_hashtableadd pl_hashtableremove pl_hashtablelookup pl_hashtableenumerateentries pl_hashstring pl_comparestrings pl_comparevalues see also xpcom hashtable guid...
Linked Lists
linked list types linked list macros linked list types the prclist type represents a circular linked list.
Long Long (64-bit) Integers
64-bit integer types nspr provides two types to represent 64-bit integers: print64 pruint64 64-bit integer functions the api defined for the 64-bit integer functions is consistent across all supported platforms.
Memory Management Operations
(note that the argument type size_t is replaced by pruint32.) memory allocated by pr_malloc(), pr_calloc(), or pr_realloc() must be freed by pr_free().
PLHashAllocOps
syntax #include <plhash.h> typedef struct plhashallocops { void *(pr_callback *alloctable)(void *pool, prsize size); void (pr_callback *freetable)(void *pool, void *item); plhashentry *(pr_callback *allocentry)(void *pool, const void *key); void (pr_callback *freeentry)(void *pool, plhashentry *he, pruintn flag); } plhashallocops; #define ht_free_value 0 /* just free the entry's value */ #define ht_free_entry 1 /* free value and entire entry */ description users of the hash table functions can provide their own memory allocation functions.
PLHashEntry
syntax #include <plhash.h> typedef struct plhashentry plhashentry; description plhashentry is a structure that represents an entry in the hash table.
PLHashFunction
syntax #include <plhash.h> typedef plhashnumber (pr_callback *plhashfunction)(const void *key); description plhashnumber is a function type that maps the key of a hash table entry to a hash number.
PL_NewHashTable
the arguments keycompare and valuecompare are functions of type plhashcomparator that the hash table library functions use to compare the keys and the values of entries.
PRAccessHow
this is the declaration for the enumeration praccesshow, used in the how parameter of pr_access: #include <prio.h> typedef enum praccesshow { pr_access_exists = 1, pr_access_write_ok = 2, pr_access_read_ok = 3 } praccesshow; see pr_access for what each of these values mean.
PRCList
syntax #include <prclist.h> typedef struct prcliststr prclist; typedef struct prcliststr { prclist *next; prclist *previous; }; description prclist defines a node in a circular linked list.
PRCallOnceFN
syntax #include <prinit.h> typedef prstatus (pr_callback *prcalloncefn)(void); description the function is called to perform the initialization desired.
PRCondVar
syntax #include <prcvar.h> typedef struct prcondvar prcondvar; description an nspr condition variable is an opaque object identified by a pointer.
PRDescIdentity
syntax #include <prio.h> typedef pruintn prdescidentity; description file descriptors may be layered.
PRDir
syntax #include <prio.h> typedef struct prdir prdir; description the opaque structure prdir represents an open directory in the file system.
PRExplodedTime
syntax #include <prtime.h> typedef struct prexplodedtime { print32 tm_usec; print32 tm_sec; print32 tm_min; print32 tm_hour; print32 tm_mday; print32 tm_month; print16 tm_year; print8 tm_wday; print16 tm_yday; prtimeparameters tm_params; } prexplodedtime; description the prexplodedtime structure represents clock/calendar time.
PRFilePrivate
syntax #include <prio.h> typedef struct prfileprivate prfileprivate; description a layer implementor should collect all the private data of the layer in the prfileprivate structure.
PRInt16
syntax #include <prtypes.h> typedefdefinition print16; ...
PRInt8
syntax #include <prtypes.h> typedef definition print8; ...
PRJobFn
syntax #include <prtpool.h> typedef void (pr_callback *prjobfn)(void *arg); ...
PRJobIoDesc
syntax #include <prtpool.h> typedef struct prjobiodesc { prfiledesc *socket; prerrorcode error; printervaltime timeout; } prjobiodesc; ...
PRLibrary
syntax #include <prlink.h> typedef struct prlibrary prlibrary; description a prlibrary is an opaque structure.
PRLock
syntax #include <prlock.h> typedef struct prlock prlock; description nspr represents a lock as an opaque entity to clients of the functions described in "locks".
PRLogModuleInfo
syntax #include <prlog.h> typedef struct prlogmoduleinfo { const char *name; prlogmodulelevel level; struct prlogmoduleinfo *next; } prlogmoduleinfo; ...
PRMonitor
syntax #include <prmon.h> typedef struct prmonitor prmonitor; ...
PRPackedBool
syntax #include <prtypes.h> typedef pruint8 prpackedbool; description use prpackedbool within structures.
PR_Initialize
the type for the root function used by pr_initialize is specified as follows: syntax typedef printn (pr_callback *prprimordialfn)(printn argc, char **argv); see also pr_initialize ...
PRProcess
syntax #include <prproces.h> typedef struct prprocess prprocess; description a pointer to the opaque prprocess structure identifies a process.
PRProcessAttr
syntax #include <prproces.h> typedef struct prprocessattr prprocessattr; description this opaque structure describes the attributes of a process to be created.
PRProtoEnt
syntax #include <prnetdb.h> typedef struct prprotoent { char *p_name; char **p_aliases; #if defined(_win32) print16 p_num; #else print32 p_num; #endif } prprotoent; fields the structure has the following fields: p_name pointer to official protocol name.
PRSeekWhence
syntax #include <prio.h> typedef prseekwhence { pr_seek_set = 0, pr_seek_cur = 1, pr_seek_end = 2 } prseekwhence; enumerators the enumeration has the following enumerators: pr_seek_set sets the file pointer to the value of the offset parameter.
PRStaticLinkTable
syntax #include <prlink.h> typedef struct prstaticlinktable { const char *name; void (*fp)(); } prstaticlinktable; ...
PRThread
syntax #include <prthread.h> typedef struct prthread prthread; description in nspr, a thread is represented by a pointer to an opaque structure of type prthread.
PRThreadPriority
syntax #include <prthread.h> typedef enum prthreadpriority { pr_priority_first = 0, pr_priority_low = 0, pr_priority_normal = 1, pr_priority_high = 2, pr_priority_urgent = 3, pr_priority_last = 3 } prthreadpriority; enumerators pr_priority_first placeholder.
PRThreadPrivateDTOR
syntax #include <prthread.h> typedef void (pr_callback *prthreadprivatedtor)(void *priv); description until the data associated with an index is actually set with a call to pr_setthreadprivate, the value of the data is null.
PR_AttachThread
syntax #include <prthread.h> typedef struct prthreadstack prthreadstack; ...
PRThreadState
syntax #include <prthread.h> typedef enum prthreadstate { pr_joinable_thread, pr_unjoinable_thread } prthreadstate; enumerators pr_unjoinable_thread thread termination happens implicitly when the thread returns from the root function.
PRTime
syntax #include <prtime.h> typedef print64 prtime; description this type is a 64-bit integer representing the number of microseconds since the nspr epoch, midnight (00:00:00) 1 january 1970 coordinated universal time (utc).
PRTimeParameters
syntax #include <prtime.h> typedef struct prtimeparameters { print32 tp_gmt_offset; print32 tp_dst_offset; } prtimeparameters; description each geographic location has a standard time zone, and if daylight saving time (dst) is practiced, a daylight time zone.
PRUint16
syntax #include <prtypes.h> typedefdefinition pruint16; ...
PR_AttachThread
syntax #include <pprthread.h> prthread* pr_attachthread( prthreadtype type, prthreadpriority priority, prthreadstack *stack); parameters pr_attachthread has the following parameters: type specifies that the thread is either a user thread (pr_user_thread) or a system thread (pr_system_thread).
PR_Calloc
returns an untyped pointer to the allocated memory, or if the allocation attempt fails, null.
PR_CallOnce
syntax prstatus pr_callonce( prcalloncetype *once, prcalloncefn func); parameters pr_callonce has these parameters: once a pointer to an object of type prcalloncetype.
PR_Connect
timeout a value of type printervaltime specifying the time limit for completion of the connect operation.
PR_DestroyMonitor
syntax #include <prmon.h> void pr_destroymonitor(prmonitor *mon); parameter the function has the following parameter: mon a reference to an existing structure of type prmonitor.
PR_EnterMonitor
syntax #include <prmon.h> void pr_entermonitor(prmonitor *mon); parameter the function has the following parameter: mon a reference to an existing structure of type prmonitor.
PR_ExitMonitor
syntax #include <prmon.h> prstatus pr_exitmonitor(prmonitor *mon); parameter the function has the following parameter: mon a reference to an existing structure of type prmonitor.
PR_GetHostByAddr
that is, given a valid network address (of type prnetaddr), pr_gethostbyaddr discovers the address' primary name, any aliases, and any other network addresses for the same host.
PR_GetOpenFileInfo
description pr_getopenfileinfo obtains the file type (normal file, directory, or other), file size (as a 32-bit integer), and the file creation and modification times of the open file represented by the file descriptor.
PR_GetOpenFileInfo64
it obtains the file type (normal file, directory, or other), file size (as a 64-bit integer), and the creation and modification times of the open file represented by the file descriptor.
PR_GetSocketOption
data a pointer to a structure of type prsocketoptiondata.
PR_GetThreadScope
syntax #include <prthread.h> prthreadscope pr_getthreadscope(void); returns a value of type prthreadscope indicating whether the thread is local or global.
PR_Init
syntax #include <prinit.h> void pr_init( prthreadtype type, prthreadpriority priority, pruintn maxptds); parameters pr_init has the following parameters: type this parameter is ignored.
PR_InitializeNetAddr
the special network address values are identified by the enum prnetaddrvalue: typedef enum prnetaddrvalue{ pr_ipaddrnull, pr_ipaddrany, pr_ipaddrloopback } prnetaddrvalue; the enum has the following enumerators: pr_ipaddrnull do not overwrite the ip address.
PR_MALLOC
returns an untyped pointer to the allocated memory, or if the allocation attempt fails, null.
PR_NewThreadPrivateIndex
when you allocate the index, you may also register a destructor function of type prthreadprivatedtor.
PR_Notify
syntax #include <prmon.h> prstatus pr_notify(prmonitor *mon); parameters the function has the following parameter: mon a reference to an existing structure of type prmonitor.
PR_NotifyAll
syntax #include <prmon.h> prstatus pr_notifyall(prmonitor *mon); parameters the function has the following parameter: mon a reference to an existing structure of type prmonitor.
PR_Poll
the prpolldesc structure is defined as follows: struct prpolldesc { prfiledesc* fd; print16 in_flags; print16 out_flags; }; typedef struct prpolldesc prpolldesc; the structure has the following fields: fd a pointer to a prfiledesc object representing a socket or a pollable event.
PR_Realloc
returns an untyped pointer to the allocated memory, or if the allocation attempt fails, null.
PR_Recv
timeout a value of type printervaltime specifying the time limit for completion of the receive operation.
PR_RecvFrom
timeout a value of type printervaltime specifying the time limit for completion of the receive operation.
PR_Seek
whence a value of type prseekwhence that specifies how to interpret the offset parameter in setting the file pointer associated with the fd parameter.
PR_Seek64
whence a value of type prseekwhence that specifies how to interpret the offset parameter in setting the file pointer associated with the fd parameter.
PR_Send
timeout a value of type printervaltime specifying the time limit for completion of the receive operation.
PR_SendTo
timeout a value of type printervaltime specifying the time limit for completion of the receive operation.
PR_SetSocketOption
data a pointer to a structure of type prsocketoptiondata specifying the options to set.
PR_Shutdown
description the prshutdownhow enumeration is defined as follows: typedef enum prshutdownhow{ pr_shutdown_rcv = 0, pr_shutdown_send = 1, pr_shutdown_both = 2 } prshutdownhow; ...
PR_TransmitFile
the enumeration prtransmitfileflags, used in the flags parameter, is defined as follows: typedef enum prtransmitfileflags { pr_transmitfile_keep_open = 0, pr_transmitfile_close_socket = 1 } prtransmitfileflags; ...
PR_Wait
syntax #include <prmon.h> prstatus pr_wait( prmonitor *mon, printervaltime ticks); parameters the function has the following parameter: mon a reference to an existing structure of type prmonitor.
PR_dtoa
mode the type of conversion to employ.
Process Initialization
prcalloncetype prcalloncefn pr_callonce ...
Process Management and Interprocess Communication
process management types and constants the types defined for process management are: prprocess prprocessattr process management functions the process manipulation function fall into these categories: setting the attributes of a new process creating and managing processes setting the attributes of a new process the functions that create and manipulate attribute sets of new processes are: pr_newprocessa...
Thread Pools
thread pool types thread pool functions thread pool types prjobiodesc prjobfn prthreadpool prjob thread pool functions pr_createthreadpool pr_queuejob pr_queuejob_read pr_queuejob_write pr_queuejob_accept pr_queuejob_connect pr_queuejob_timer pr_canceljob pr_joinjob pr_shutdownthreadpool pr_jointhreadpool ...
An overview of NSS Internals
the common structure to store such an untyped block is secitem, which contains a size and an untyped c pointer variable.
Function_Name
syntax #include <headers.h> returntype function_name( paramtype paramname, paramtype paramname, ); parameters paramname sample: in pointer to a certcertdbhandle representing the certificate database to look in paramname sample: in pointer to an secitem whose type must be sidercertbuffer and whose data contains a der-encoded certificate description long description of this function, what it does, and why you would use it.
CERT_FindCertByDERCert
syntax #include <cert.h> certcertificate *cert_findcertbydercert( certcertdbhandle *handle, secitem *dercert ); parameters handle in pointer to a certcertdbhandle representing the certificate database to look in dercert in pointer to an secitem whose type must be sidercertbuffer and whose data contains a der-encoded certificate description this function looks in the ?nsscryptocontext?
Deprecated SSL functions
the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references.
HTTP delegation
create an instance of this type and supply a pointer to your implementation for each entry in the function table.
HTTP delegation
create an instance of this type and supply a pointer to your implementation for each entry in the function table.
4.3 Release Notes
new sqlite-based shareable certificate and key databases by prepending the string "sql:" to the directory path passed to configdir parameter for crypomanager.initialize method or using the nss environment variable nss_default_db_type.
JSS FAQ
MozillaProjectsNSSJSSJSS FAQ
the best way to do this is with the pkcs #7 signeddata type.
JSS Provider Notes
mac supported algorithms notes hmacsha1 (hmac-sha1 ) any secret key type (aes, des, etc.) can be used as the mac key, but it must be a jss key.
Mozilla-JSS JCA Provider notes
mac supported algorithms notes hmacsha1 (hmac-sha1) any secret key type (aes, des, etc.) can be used as the mac key, but it must be a jss key.
Using JSS
MozillaProjectsNSSJSSUsing JSS
jss dependencies core library name description binary release location nspr4 nspr os abstraction layer http://ftp.mozilla.org/pub/mozilla.org/nspr/releases plc4 nspr standard c library replacement functions plds4 nspr data structure types nss3 nss crypto, pkcs #11, and utilities http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases ssl3 nss ssl library smime3 nss s/mime functions and types nssckbi pkcs #11 module containing built-in root ca certificates.
JSS
MozillaProjectsNSSJSS
jss also provides a pure java interface for asn.1 types and ber/der encoding.
NSS Memory allocation
see the prototype at http://mxr.mozilla.org/nspr/source/n.../ds/plarenas.h a program should call that function at the very end, after having shutdown nss and nspr, to really free the contents of the free list.
NSS_3.12.1_release_notes.html
bug 439123: assertion failure in libpkix at shutdown bug 440062: incorrect list element count in pkix_list_appenditem function bug 442618: eliminate dead function cert_certpackagetype bug 443755: extra semicolon in pkm_tlskeyandmacderive makes conditional code unconditional bug 443760: extra semicolon in seqdatabase makes static analysis tool suspicious bug 448323: certutil -k doesn't report the token and slot names for found keys bug 448324: ocsp checker returns incorrect error code on request with invalid signing cert bug 449146: remove dead libsec function declara...
NSS_3.12.2_release_notes.html
bug 444974: crash upon reinsertion of e-identity smartcard bug 447563: modutil -add prints no error explanation on failure bug 448431: pk11_createmergelog() declaration causes gcc warning when compiling with -wstrict-prototypes bug 449334: pk12util has duplicate options letters bug 449725: signver is still using static libraries.
NSS 3.12.9 release notes
bug 536485: crash during ssl handshake in [@ intel_aes_decrypt_cbc_256] bug 444367: nss 3.12 softoken returns the certificate type of a certificate object as ckc_x_509_attr_cert.
NSS 3.14.1 release notes
new functions in ocspt.h cert_createocspsingleresponsegood cert_createocspsingleresponseunknown cert_createocspsingleresponserevoked cert_createencodedocspsuccessresponse cert_createencodedocsperrorresponse new types in ocspt.h ​certocspresponderidtype notable changes in nss 3.14.1 windows ce support has been removed from the code base.
NSS 3.14.2 release notes
new types: in certt.h cert_pi_useonlytrustanchors in secoidt.h sec_oid_ms_ext_key_usage_ctl_signing notable changes in nss 3.14.2 bug 805604 - support for aes-ni and avx accelerated aes-gcm was contributed by shay gueron of intel.
NSS 3.14.3 release notes
new types ck_nss_mac_constant_time_params - parameters for use with ckm_nss_hmac_constant_time and ckm_nss_ssl3_mac_constant_time.
NSS 3.14.4 release notes
bugs fixed in nss 3.14.4 https://bugzilla.mozilla.org/buglist.cgi?bug_id=894370%2c832942%2c863947&bug_id_type=anyexact&list_id=8338081&resolution=fixed&classification=components&query_format=advanced&product=nss compatibility nss 3.14.4 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.14.5 release notes
bugs fixed in nss 3.14.5 https://bugzilla.mozilla.org/buglist.cgi?bug_id=934016&bug_id_type=anyexact&resolution=fixed&classification=components&query_format=advanced&product=nss compatibility nss 3.14.5 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.14 release notes
the following types have been added in nss 3.14 certchainverifycallback (in certt.h) certchainverifycallbackfunc (in certt.h) cert_pi_chainverifycallback, a new option for certvalparamintype (in certt.h) a new error code: sec_error_application_callback_error (in secerr.h) new for pkcs #11 pkcs #11 mechanisms: ckm_aes_cts ckm_a...
NSS 3.15.2 release notes
new types no new types have been introduced.
NSS 3.15.4 release notes
new functions cert_forcepostmethodforocsp cert_getsubjectnamedigest cert_getsubjectpublickeydigest ssl_peercertificatechain ssl_recommendedcanfalsestart ssl_setcanfalsestartcallback new types cert_rev_m_force_post_method_for_ocsp: when this flag is used, libpkix will never attempt to use the http get method for ocsp requests; it will always use post.
NSS 3.15 release notes
new types in secitem.h secitemarray - represents a variable-length array of secitems.
NSS 3.16.3 release notes
new functions in cert.h ​cert_getgeneralnametypefromstring - an utlity function to lookup a value of type certgeneralnametype given a human readable string.
NSS 3.18 release notes
new types in p12.h sec_pkcs12nicknamerenamecallback - a function pointer definition.
NSS 3.20 release notes
new types in sslt.h ssldhegrouptype - enumerates the set of dhe parameters embedded in nss that can be used with function ssl_dhegroupprefset new macros in ssl.h ssl_enable_server_dhe - a socket option user to enable or disable dhe ciphersuites for a server socket notable changes in nss 3.20 the tls library has been extended to support dhe ciphersuites in server applic...
NSS 3.21 release notes
new types in pkcs11t.h ck_tls12_master_key_derive_params{_ptr} - parameters {or pointer} for ckm_tls12_master_key_derive ck_tls12_key_mat_params{_ptr} - parameters {or pointer} for ckm_tls12_key_and_mac_derive ck_tls_kdf_params{_ptr} - parameters {or pointer} for ckm_tls_kdf ck_tls_mac_params{_ptr} - parameters {or pointer} for ckm_tls_mac in sslt.h sslhashtype - identifies ...
NSS 3.28.3 release notes
if an application passed type seckeyecpublickey to nss (as part of seckeypublickey), the nss library read the uninitialized attribute.
NSS 3.29.1 release notes
if an application passed type seckeyecpublickey to nss (as part of seckeypublickey), the nss library read the uninitialized attribute.
NSS 3.39 release notes
new functions in cert.h cert_getcertkeytype - query the key type associated with the given certificate.
NSS 3.43 release notes
new in nss 3.43 new functionality new functions in sechash.h hash_gethashoidtagbyhashtype - convert type hash_hashtype to type secoidtag in sslexp.h ssl_sendcertificaterequest - allow server to request post-handshake client authentication.
NSS 3.55 release notes
bug 1643528 - fix compilation error with -werror=strict-prototypes.
NSS Sample Code sample3
d secret key" << endl; /* initialize data */ memset(data, 0xbc, sizeof data); /* create a key */ key = pk11_keygen(slot, ckm_generic_secret_key_gen, 0, 128, 0); if (!key) { cout << "create key failed" << endl; goto done; } cout << (void *)key << endl; /* create parameters for crypto context */ /* note: params must be provided, but may be empty */ secitem noparams; noparams.type = sibuffer; noparams.data = 0; noparams.len = 0; /* create context using the same slot as the key */ // context = pk11_createdigestcontext(sec_oid_md5); context = pk11_createcontextbysymkey(ckm_md5, cka_digest, key, &noparams); if (!context) { cout << "createdigestcontext failed" << endl; goto done; } s = pk11_digestbegin(context); if (s != secsuccess) { cout << "digestbegin fail...
NSS Sample Code sample4
* # create ca cert, self-signed, generates key-pair, prompts for key * # type, cert type etc * # answers for prompts: 5,9,n,y,-1,n,5,6,7,9,n * $ certutil -s -s "cn=test ca, o=bogus inc, l=mtn view, st=ca, c=us" \ * -n testca -t ctu,ctu,ctu -v 60 -x -d .
NSS Sample Code sample5
n;i++) { buf1[i]= (i %26) + 'a'; } buf1[modulus_len-1] = '\0'; fprintf(stderr, "buffer being encrypted = \n%s\n", buf1); /* encrypt buf1, result will be in buf2 */ rv = pk11_pubencryptraw(pubkey, buf2, buf1, modulus_len, null); if (rv != secsuccess) { fprintf(stderr, "encrypt with public key failed (err %d)\n", pr_geterror()); goto cleanup; } nickname.type = sibuffer; nickname.data = "pvtkeynickname"; nickname.len = strlen("pvtkeynickname"); rv = atob_convertasciitoitem(&der, pvtkstr); if (rv!= secsuccess) { fprintf(stderr, "atob_convertasciitoitem failed %d\n", pr_geterror()); goto cleanup; } /* ku_all includes a lot of different key usages, ku_data_encipherment * is enough for just rsa encryption.
Utilities for nss samples
*/ typedef struct { enum { pw_none = 0, /* no password */ pw_fromfile = 1, /* password stored in a file */ pw_plaintext = 2 /* plain-text password passed in buffer */ /* pw_external = 3 */ } source; char *data; /* depending on source this can be the actual * password or the file to read it from */ } secupwdata; /* * printasascii ...
nss tech note8
every ssl socket has two function pointers, ss->sec.cache and ss->sec.uncache, which have the following types: typedef void (*sslsessionidcachefunc) (sslsessionid *sid); typedef void (*sslsessioniduncachefunc)(sslsessionid *sid); there are two separate implementations of each function, one for clients and one for servers.
NSS release notes template
new functions in ___.h function - description new types in ___.h type - description.
Overview of NSS
rsa standard that governs selected attribute types, including those used with pkcs #7, pkcs #8, and pkcs #10.
PKCS11 FAQ
MozillaProjectsNSSPKCS11FAQ
key types?
PKCS #11 Module Specs
a new ck_c_initialize_args structure is defined as typedef struct ck_c_initialize_args { ck_createmutex createmutex; ck_destroymutex destroymutex; ck_lockmutex lockmutex; ck_unlockmutex unlockmutex; ck_flags flags; ck_void_ptr libraryparameters; ck_void_ptr preserved; } ck_c_initialize_args; applications/libraries must set libraryparameters to null if no parameter value is specified.
PKCS 12 functions
the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references.
Sample manual installation
where <obj-dir> would vary according to the type of build and the platform.
FC_GetMechanismInfo
syntax ck_rv fc_getmechanisminfo( ck_slot_id slotid, ck_mechanism_type type, ck_mechanism_info_ptr pinfo ); parameters fc_getmechanisminfo takes three parameters: slotid [input] type [input] .
FC_GetSessionInfo
otherwise, it fills in the ck_session_info structure with the following information: state: the state of the session, i.e., no role is assumed, the user role is assumed, or the crypto officer role is assumed flags: bit flags that define the type of session ckf_rw_session (0x00000002): true if the session is read/write; false if the session is read-only.
FC_InitPIN
ckr_pin_len_range: the pin is too short, too long, or too weak (doesn't have enough character types).
NSS Key Functions
syntax include <key.h> include <keyt.h> seckeykeydbhandle *seckey_getdefaultkeydb(void); returns the function returns a handle of type seckeykeydbhandle.
sslkey.html
syntax #include <key.h> #include <keyt.h> seckeykeydbhandle *seckey_getdefaultkeydb(void); returns the function returns a handle of type seckeykeydbhandle.
SSL functions
the mozilla cross reference (dxr) link for each function provides access to the function definition, prototype definition, and source code references.
NSS Tools
the ssltap tool does not decrypt data, but it shows things like the type of ssl message (clienthello, serverhello, etc) and connection data (protocol version, cipher suite, etc).
NSS Tools pk12util
[-v] [common-options] or pk12util -o p12file -n certname [-c keycipher] [-c certcipher] [-m | --key_len keylen] [-n | --cert_key_len certkeylen] [common-options] or pk12util -l p12file [-h tokenname] [-r] [common-options] where [common-options] = [-d dir] [-p dbprefix] [-k slotpasswordfile | -k slotpassword] [-w p12filepasswordfile | -w p12filepassword] syntax to run the pkcs #12 tool, type ther command pk12util option [arguments] where option and arguments are combinations of the options and arguments listed in the following section.
Rhino optimization
simple data and type flow analysis is performed to determine which javascript variables can be allocated to java vm registers, and which variables are used only as numbers.
Rhino requirements and limitations
limitations liveconnect if a javaobject's field's name collides with that of a method, the value of that field is retrieved lazily, and can be counter-intuitively affected by later assignments: javaobj.fieldandmethod = 5; var field = javaobj.fieldandmethod; javaobj.fieldandmethod = 7; // now, field == 7 you can work around this by forcing the field value to be converted to a javascript type when you take its value: javaobj.fieldandmethod = 5; var field = javaobj.fieldandmethod + 0; // force conversion now javaobj.fieldandmethod = 7; // now, field == 5 jsobject rhino does not support the netscape.javascript.jsobject class.
SpiderMonkey compartments
only a special object type can cross the compartment boundaries.
Future directions
no fundamental blockers currently exist, but ctypes is still using nspr's runtime library loading facilities.
Functions
(but note that objects of other classes can be callable and can even have typeof obj == "function".) script functions functions written in javascript and compiled to bytecode.
INT_TO_JSVAL
syntax jsval int_to_jsval(int32_t i); name type description i any integer type c integer to convert to a jsval.
JS::AutoIdArray
syntax autoidarray(jscontext *cx, jsidarray *ida); name type description cx jscontext * the context in which to add the root.
JS::AutoSaveExceptionState
syntax js::autosaveexceptionstate(jscontext *cx); name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS::AutoValueArray
syntax js::autovaluearray<n> vp(cx); name type description cx jscontext * the context in which to add the root.
JS::Call
alue fun, const js::handlevaluearray& args, js::mutablehandlevalue rval); bool js::call(jscontext *cx, js::handlevalue thisv, js::handlevalue fun, const js::handlevaluearray& args, js::mutablehandlevalue rval); bool js::call(jscontext *cx, js::handlevalue thisv, js::handleobject funobj, const js::handlevaluearray& args, js::mutablehandlevalue rval); name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS::CallArgs
syntax js::callargs js::callargsfromvp(unsigned argc, js::value *vp); name type description args unsigned number of argument.
JS::Compile
th, js::mutablehandlescript script); bool js::compile(jscontext *cx, js::handleobject obj, const js::readonlycompileoptions &options, file *file, js::mutablehandlescript script); bool js::compile(jscontext *cx, js::handleobject obj, const js::readonlycompileoptions &options, const char *filename, js::mutablehandlescript script); name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS::CompileFunction
js::sourcebufferholder &srcbuf, js::mutablehandlefunction fun); bool js::compilefunction(jscontext *cx, js::autoobjectvector &scopechain, const js::readonlycompileoptions &options, const char *name, unsigned nargs, const char *const *argnames, const char *bytes, size_t length, js::mutablehandlefunction fun); name type description cx jscontext * the context in which to compile the function.
JS::CompileOffThread
cx, const js::readonlycompileoptions &options, size_t length); bool js::compileoffthread(jscontext *cx, const js::readonlycompileoptions &options, const char16_t *chars, size_t length, js::offthreadcompilecallback callback, void *callbackdata); jsscript * js::finishoffthreadscript(jscontext *maybecx, jsruntime *rt, void *token); typedef void (*js::offthreadcompilecallback)(void *token, void *callbackdata); name type description cx / maybe jscontext * pointer to a js context from which to derive runtime information.
JS::Construct
syntax bool js::construct(jscontext *cx, js::handlevalue fun, const js::handlevaluearray& args, js::mutablehandlevalue rval); name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS::CurrentGlobalOrNull
syntax jsobject * js::currentglobalornull(jscontext *cx); name type description cx jscontext * the context for which to return the global object.
JS::DeflateStringToUTF8Buffer
syntax // new in jsapi 52 void deflatestringtoutf8buffer(jsflatstring* src, mozilla::rangedptr<char> dst, size_t* dstlenp = nullptr, size_t* numcharsp = nullptr); // obsolete in spidermonkey 49 void deflatestringtoutf8buffer(jsflatstring* src, mozilla::rangedptr<char> dst); name type description src jsflatstring * the pointer to the string to deflate.
JS::Evaluate
levalue rval); bool js::evaluate(jscontext *cx, js::handleobject obj, const js::readonlycompileoptions &options, const char *bytes, size_t length, js::mutablehandlevalue rval); bool js::evaluate(jscontext *cx, js::handleobject obj, const js::readonlycompileoptions &options, const char *filename, js::mutablehandlevalue rval); name type description cx jscontext * the context in which to run the script.
JS::GetDeflatedUTF8StringLength
syntax size_t getdeflatedutf8stringlength(jsflatstring* s); name type description s jsflatstring * the pointer to the string to calculate the length.
JS::GetSelfHostedFunction
syntax jsfunction* js::getselfhostedfunction(jscontext* cx, const char* selfhostedname, js::handle<jsid> id, unsigned nargs); name type description cx jscontext* the context from which to get the function.
JS::IsCallable
syntax bool js::iscallable(jsobject *obj); bool js::isconstructor(jsobject *obj); name type description obj jsobject * pointer to the function.
JS::NewFunctionFromSpec
syntax jsfunction* js::newfunctionfromspec(jscontext* cx, const jsfunctionspec* fs, handleid id); name type description cx jscontext * the context in which to define functions.
JS::ObjectOrNullValue
syntax js::value js::objectornullvalue(jsobject* obj) name type description str jsobject* a pointer to a jsobject or null to convert.
JS::ObjectValue
syntax js::value js::objectvalue(jsobject& obj) name type description str jsobject&amp; a reference to a jsobject to convert.
JS::PropertySpecNameEqualsId
syntax bool js::propertyspecnameequalsid(const char *name, js::handleid id); name type description name const char * jspropertyspec::name or jsfunctionspec::name.
JS::PropertySpecNameIsSymbol
syntax bool js::propertyspecnameissymbol(const char *name); name type description name const char * the pointer of the name, actually the uintptr_t type, and not a pointer to any string.
JS::PropertySpecNameToPermanentId
syntax bool js::propertyspecnametopermanentid(jscontext *cx, const char *name, jsid *idp); name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS::Remove*Root
ectroot(jscontext *cx, js::heap<jsobject *> *rp); void removescriptroot(jscontext *cx, js::heap<jsscript *> *rp); void removevaluerootrt(jsruntime *rt, js::heap<js::value> *vp); void removestringrootrt(jsruntime *rt, js::heap<jsstring *> *rp); void removeobjectrootrt(jsruntime *rt, js::heap<jsobject *> *rp); void removescriptrootrt(jsruntime *rt, js::heap<jsscript *> *rp); name type description cx jscontext * the context from which to remove the root.
JS::SourceBufferHolder
constructor enum ownership { noownership, giveownership }; js::sourcebufferholder(const char16_t *data, size_t datalength, ownership ownership); name type description data const char16_t * source buffer containing the script to compile.
JS::StringValue
syntax js::value js::stringvalue(jsstring* str) name type description str jsstring* a pointer to a jsstring to convert.
JS::SymbolValue
syntax js::value js::symbolvalue(js::symbol* sym) name type description sym js::symbol* a pointer to a js::symbol to convert.
JS::ToBoolean
syntax bool js::toboolean(js::handlevalue v) name type description v js::handlevalue the value to convert.
JS::ToInt32
syntax bool js::toint32(jscontext *cx, js::handlevalue v, int32_t *out); name type description cx jscontext * the context in which to perform the conversion.
JS::ToInt64
syntax bool js::toint64(jscontext *cx, js::handlevalue v, int64_t *out); name type description cx jscontext * the context in which to perform the conversion.
JS::ToNumber
syntax bool js::tonumber(jscontext *cx, js::handlevalue v, double *out); name type description cx jscontext * the context in which to perform the conversion.
JS::ToString
syntax #include "js/conversions.h" // as of spidermonkey 38; previously in jsapi.h jsstring* js::tostring(jscontext *cx, js::handlevalue v) name type description cx jscontext * the context in which to perform the conversion.
JS::ToUint16
syntax bool js::touint16(jscontext *cx, js::handlevalue v, uint16_t *out); name type description cx jscontext * the context in which to perform the conversion.
JS::ToUint32
syntax bool js::touint32(jscontext *cx, js::handlevalue v, int32_t *out); name type description cx jscontext * the context in which to perform the conversion.
JS::ToUint64
syntax bool js::touint64(jscontext *cx, js::handlevalue v, uint64_t *out); name type description cx jscontext * the context in which to perform the conversion.
JSAutoByteString
syntax jsautobytestring str; jsautobytestring(jscontext *cx, jsstring *str); name type description cx jscontext * the context in which to add the root.
JSAutoCompartment
syntax jsautocompartment(jscontext *cx, jsobject *target); jsautocompartment(jscontext *cx, jsscript *target); name type description cx jscontext * the context on which a cross-compartment call is needed.
JSClass.call
these hooks are of type jsnative.
JSConstDoubleSpec
syntax template<typename t> struct jsconstscalarspec { const char *name; t val; /* uint8_t flags; // obsolete from jsapi 35 uint8_t spare[3]; // obsolete from jsapi 35 */ }; typedef jsconstscalarspec<double> jsconstdoublespec; typedef jsconstscalarspec<int32_t> jsconstintegerspec; // added in spidermonkey 38 name type description val double or int32_t value for the double or integer.
JSExtendedClass.outerObject
callback syntax typedef jsobject * (*jsobjectop)(jscontext *cx, jsobject *obj); name type description cx jscontext * a context.
JSExtendedClass
}; name type description base jsclass the basic class information and callbacks for this class.
JSFreeOp
syntax jsfreeop(jsruntime *rt); name type description rt jsruntime * a runtime to store in this structure.
JSFunctionSpec
syntax struct jsfunctionspec { const char *name; jsnativewrapper call; uint16_t nargs; uint16_t flags; const char *selfhostedname; }; typedef struct jsnativewrapper { jsnative op; const jsjitinfo *info; } jsnativewrapper; name type description name const char * the function's name.
JSGetObjectOps
jsgetobjectops is the type for jsclass.getobjectops callback syntax typedef jsobjectops * (* jsgetobjectops)(jscontext *cx, jsclass *clasp); name type description cx jscontext * the js context in which the new object is being created.
JSID_IS_EMPTY
syntax bool jsid_is_empty(jsid id); name type description id jsid the property identifier to test.
JSID_IS_GCTHING
syntax bool jsid_is_gcthing(jsid id); js::gccellptr jsid_to_gcthing(jsid id); name type description id jsid the property identifier to test or convert.
JSID_IS_INT
syntax bool jsid_is_int(jsid id); int32_t jsid_to_int(jsid id); bool int_fits_in_jsid(int32_t i); jsid int_to_jsid(int32_t i); name type description id jsid the property identifier to test or convert.
JSID_IS_STRING
syntax bool jsid_is_string(jsid id); jsstring * jsid_to_string(jsid id); jsid interned_string_to_jsid(jscontext *cx, jsstring *str); // added in spidermonkey 38 jsflatstring * jsid_to_flat_string(jsid id); // added in spidermonkey 17 name type description cx jscontext * pointer to a js context from which to derive runtime information.
JSID_IS_SYMBOL
syntax bool jsid_is_symbol(jsid id); js::symbol * jsid_to_symbol(jsid id); jsid symbol_to_jsid(js::symbol *sym); name type description id jsid the property identifier to test or convert.
JSID_IS_VOID
syntax bool jsid_is_void(jsid id); name type description id jsid the property identifier to test.
JSID_IS_ZERO
syntax bool jsid_is_zero(jsid id); name type description id jsid the property identifier to test.
JSIteratorOp
syntax typedef jsobject * (*jsiteratorop)(jscontext *cx, jsobject *obj, jsbool keysonly); name type description cx jscontext * pointer to the js context in which the iterator creation should take place.
JSObjectOps.defineProperty
syntax jsbool (*jsdefinepropop)(jscontext *cx, jsobject *obj, jsid id, jsval value, jspropertyop getter, jspropertyop setter, unsigned int attrs); name type description cx jscontext * pointer to the js context in which the property is being defined.
JSObjectOps.destroyObjectMap
syntax typedef void (*jsobjectmapop)(jscontext *cx, jsobjectmap *map); name type description cx jscontext * pointer to the js context in which garbage collection is happening.
JSObjectOps.dropProperty
syntax typedef void (*jspropertyrefop)(jscontext *cx, jsobject *obj, jsproperty *prop); name type description cx jscontext * a context that was the cx argument to an earlier call to jsobjectops.lookupproperty that found a property.
JSObjectOps.enumerate
the type of the callback is jsnewenumerateop.
JSObjectOps.getAttributes
syntax typedef jsbool (*jsattributesop)(jscontext *cx, jsobject *obj, jsid id, jsproperty *prop, unsigned int *attrsp); name type description cx jscontext * pointer to the js context in which the property access is happening.
JSObjectOps.getRequiredSlot
syntax typedef jsval (*jsgetrequiredslotop)(jscontext *cx, jsobject *obj, uint32 slot); typedef jsbool (*jssetrequiredslotop)(jscontext *cx, jsobject *obj, uint32 slot, jsval v); name type description cx jscontext * the js context in which we access the slot.
JSObjectOps.newObjectMap
syntax typedef jsobjectmap * (*jsnewobjectmapop)(jscontext *cx, jsrefcount nrefs, jsobjectops *ops, jsclass *clasp, jsobject *obj); name type description cx jscontext * pointer to the js context in which the new object is being created.
JSPRINCIPALS_HOLD
syntax jsprincipals_hold(cx, principals) jsprincipals_drop(cx, principals) name type description cx jscontext * a context.
JSProperty
the type of javascript object properties, used by the jsobjectops layer.
JSPropertyDescriptor
there are two main types of property descriptors that exist in an object: a data descriptor and an access descriptor.
JSScript
jsscript is a type in the jsapi.
JSStringFinalizer
syntax struct jsstringfinalizer { void (*finalize)(const jsstringfinalizer *fin, char16_t *chars); }; name type description fin jsstringfinalizer the finalizer itself.
JSVAL_IS_DOUBLE
example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if statement to see if it is a js double data type.
JSVAL_IS_GCTHING
indicates whether a js value has a type that is subject to garbage collection.
JSVAL_IS_OBJECT
this indicates that it is safe to call jsval_to_object(v) to convert v to type jsobject *.
JSVAL_IS_PRIMITIVE
determine if a given jsval is of a primitive type.
JS_ASSERT_STRING_IS_FLAT
syntax static moz_always_inline jsflatstring * js_assert_string_is_flat(jsstring *str) { moz_assert(js_stringisflat(str)); return (jsflatstring *)str; } name type description str jsstring * string to examine.
JS_AliasElement
syntax jsbool js_aliaselement(jscontext *cx, jsobject *obj, const char *name, jsint alias); name type description cx jscontext * the context in which to create the alias.
JS_AliasProperty
syntax jsbool js_aliasproperty(jscontext *cx, jsobject *obj, const char *name, const char *alias); name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS_BindCallable
syntax jsobject* js_bindcallable(jscontext *cx, js::handle<jsobject*> callable, js::handle<jsobject*> newthis); name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS_BufferIsCompilableUnit
syntax bool js_bufferiscompilableunit(jscontext *cx, js::handle<jsobject*> obj, const char *utf8, size_t length); name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS_CallFunction
unction(jscontext *cx, jsobject *obj, jsfunction *fun, unsigned argc, jsval *argv, jsval *rval); bool js_callfunctionname(jscontext *cx, jsobject *obj, const char *name, unsigned argc, jsval *argv, jsval *rval); bool js_callfunctionvalue(jscontext *cx, jsobject *obj, jsval fval, unsigned argc, jsval *argv, jsval *rval); name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS_CheckForInterrupt
syntax bool js_checkforinterrupt(jscontext* cx); name type description cx </code>jscontext *<code> the context.
JS_ClearContextThread
syntax jsword js_clearcontextthread(jscontext *cx); jsword js_setcontextthread(jscontext *cx); name type description cx jscontext * the context to transfer from one thread to another.
JS_ClearDateCaches
syntax void js_cleardatecaches(jscontext *cx); name type description cx jscontext * pointer to a javascript context from which to derive runtime information.
JS_ClearPendingException
syntax void js_clearpendingexception(jscontext *cx); name type description cx jscontext * the context in which the exception was thrown.
JS_ClearRegExpStatics
syntax bool js_clearregexpstatics(jscontext *cx, handleobject obj); name type description cx jscontext * the context.
JS_CompareStrings
syntax bool js_comparestrings(jscontext *cx, jsstring *str1, jsstring *str2, int32_t *result); name type description cx jscontext * the context to which both strings must belong.
JS_CompileFileHandleForPrincipals
syntax jsobject * js_compilefilehandleforprincipals(jscontext *cx, jsobject *obj, const char *filename, file *fh, jsprincipals *principals); name type description cx jscontext * the context.
JS_CompileFileHandleForPrincipalsVersion
syntax jsobject * js_compilefilehandleforprincipalsversion(jscontext *cx, jsobject *obj, const char *filename, file *fh, jsprincipals *principals, jsversion version); name type description cx jscontext * the context.
JS_CompileFunction
sobject *obj, const char *name, unsigned int nargs, const char **argnames, const char *body, size_t length, const char *filename, unsigned int lineno); jsfunction * js_compileucfunction(jscontext *cx, jsobject *obj, const char *name, unsigned int nargs, const char **argnames, const jschar *body, size_t length, const char *filename, unsigned int lineno); name type description cx jscontext * the context in which to compile the function.
JS_CompileFunctionForPrincipals
unsigned int nargs, const char **argnames, const char *body, size_t length, const char *filename, unsigned int lineno); jsfunction * js_compileucfunctionforprincipals(jscontext *cx, jsobject *obj, jsprincipals *principals, const char *name, unsigned int nargs, const char **argnames, const jschar *body, size_t length, const char *filename, unsigned int lineno); name type description cx jscontext * the context in which to compile the function.
JS_CompileScript
j, const char *ascii, size_t length, const js::compileoptions &options, js::mutablehandlescript script); bool js_compileucscript(jscontext *cx, js::handleobject obj, const char16_t *chars, size_t length, const js::compileoptions &options, js::mutablehandlescript script); name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS_CompileScriptForPrincipals
*principals, const char *src, size_t length, const char *filename, unsigned int lineno, jsversion version); // obsoleted since jsapi 19 jsobject * js_compileucscriptforprincipalsversion(jscontext *cx, jsobject *obj, jsprincipals *principals, const jschar *src, size_t length, const char *filename, unsigned int lineno, jsversion version); // obsoleted since jsapi 19 name type description cx jscontext * the context in which to compile the script.
JS_CompileUCFunctionForPrincipalsVersion
syntax jsfunction * js_compileucfunctionforprincipalsversion(jscontext *cx, jsobject *obj, jsprincipals *principals, const char *name, unsigned int nargs, const char **argnames, const jschar *chars, size_t length, const char *filename, unsigned int lineno, jsversion version); name type description cx jscontext * the context.
JS_CompileUTF8File
syntax jsobject * js_compileutf8file(jscontext *cx, jsobject *obj, const char *filename); name type description cx jscontext * the context in which to compile the script.
JS_CompileUTF8FileHandle
syntax jsobject * js_compileutf8filehandle(jscontext *cx, jsobject *obj, const char *filename, file *file); jsobject * js_compileutf8filehandleforprincipals( jscontext *cx, jsobject *obj, const char *filename, file *file, jsprincipals *principals); name type description cx jscontext * the context in which to compile the script.
JS_ConcatStrings
syntax jsstring * js_concatstrings(jscontext *cx, js::handlestring left, js::handlestring right); name type description cx jscontext * the context in which both the strings have been created.
JS_DecompileFunction
syntax jsstring * js_decompilefunction(jscontext *cx, js::handle<jsfunction*> fun); name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS_DecompileFunctionBody
syntax jsstring * js_decompilefunctionbody(jscontext *cx, js::handle<jsfunction*> fun, unsigned indent); name type description cx jscontext * the context in which to decompile the function.
JS_DecompileScript
syntax jsstring * js_decompilescript(jscontext *cx, js::handle<jsscript*> script); name type description cx jscontext * the context to use to decompile the script.
JS_DecompileScriptObject
syntax jsstring * js_decompilescriptobject(jscontext *cx, jsobject *scriptobj, const char *name, unsigned int indent); name type description cx jscontext * the context.
JS_DeepFreezeObject
syntax bool js_deepfreezeobject(jscontext *cx, js::handle<jsobject*> obj); name type description cx jsruntime * the context.
JS_DefineConstDoubles
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.
JS_DefineFunction
text *cx, js::handle<jsobject*> obj, const char16_t *name, size_t namelen, jsnative call, unsigned nargs, unsigned attrs); jsfunction * js_definefunctionbyid(jscontext *cx, js::handle<jsobject*> obj, js::handle<jsid> id, jsnative call, unsigned nargs, unsigned attrs); // added in spidermonkey 17 name type description cx jscontext * the context in which to define the function.
JS_DefineOwnProperty
syntax bool js_defineownproperty(jscontext *cx, js::handleobject obj, js::handleid id, js::handlevalue descriptor, bool *bp); name type description cx jscontext * the context.
JS_DefineProperties
syntax bool js_defineproperties(jscontext *cx, js::handleobject obj, const jspropertyspec *ps); name type description cx jscontext * the context in which to define the properties.
JS_DefinePropertyWithTinyId
definepropertywithtinyid( jscontext *cx, jsobject *obj, const char *name, int8 tinyid, jsval value, jspropertyop getter, jspropertyop setter, unsigned int attrs); jsbool js_defineucpropertywithtinyid( jscontext *cx, jsobject *obj, const jschar *name, size_t namelen, int8 tinyid, jsval value, jspropertyop getter, jspropertyop setter, unsigned int attrs); name type description cx jscontext * the context in which to define the property.
JS_DestroyContext
syntax void js_destroycontext(jscontext *cx); void js_destroycontextnogc(jscontext *cx); void js_destroycontextmaybegc(jscontext *cx); // obsolete since jsapi 14 name type description cx jscontext * the context to destroy.
JS_DestroyIdArray
syntax void js_destroyidarray(jscontext *cx, jsidarray *ida); name type description cx jscontext * a context.
JS_DestroyRuntime
syntax void js_destroyruntime(jsruntime *rt); name type description rt jsruntime * the runtime to destroy.
JS_DestroyScript
syntax void js_destroyscript(jscontext *cx, jsscript *script); name type description cx jscontext * the context in which to destroy the script.
JS_DoubleIsInt32
syntax bool js_doubleisint32(double d, int32_t *ip); name type description d double a double value to compare ip int32_t * a pointer to int32_t value to compare description js_doubleisint32 returns true if d i sequal to *ip.
JS_DropExceptionState
syntax void js_dropexceptionstate(jscontext *cx, jsexceptionstate *state); name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS_EncodeCharacters
syntax jsbool js_encodecharacters(jscontext *cx, const jschar *src, size_t srclen, char *dst, size_t *dstlen); name type description cx jscontext * a context.
JS_EncodeString
syntax char * js_encodestring(jscontext *cx, jsstring *str); char * js_encodestringtoutf8(jscontext *cx, js::handlestring str); // added in spidermonkey 24 name type description cx jscontext * a context.
JS_EncodeStringToBuffer
syntax size_t js_encodestringtobuffer(jscontext *cx, jsstring *str, char *buffer, size_t length); name type description cx jscontext * a context.
JS_EnterCompartment
syntax jscompartment * js_entercompartment(jscontext *cx, jsobject *target); name type description cx jscontext * the context on which a cross-compartment call is needed.
JS_EnterCrossCompartmentCall
syntax jscrosscompartmentcall * js_entercrosscompartmentcall(jscontext *cx, jsobject *target); name type description cx jscontext * the context on which a cross-compartment call is needed.
JS_EnterLocalRootScope
syntax jsbool js_enterlocalrootscope(jscontext *cx); name type description cx jscontext * pointer to the context.
JS_EnumerateResolvedStandardClasses
syntax jsidarray * js_enumerateresolvedstandardclasses(jscontext *cx, jsobject *obj, jsidarray *ida); name type description description js_enumerateresolvedstandardclasses enumerates any already-resolved standard class ids into ida, or into a new jsidarray if ida is null.
JS_EnumerateStandardClasses
syntax bool js_enumeratestandardclasses(jscontext *cx, js::handleobject obj); name type description cx jscontext * pointer to the executable script context for which to initialize js function and object classes.
JS_ErrorFromException
syntax jserrorreport * js_errorfromexception(jscontext *cx, js::handleobject obj); name type description cx jscontext * pointer to a js context whose errors should be reported via your function.
JS_EvaluateScript
syntax jsbool js_evaluatescript(jscontext *cx, jsobject *obj, const char *src, unsigned int length, const char *filename, unsigned int lineno, jsval *rval); jsbool js_evaluateucscript(jscontext *cx, jsobject *obj, const jschar *src, unsigned int length, const char *filename, unsigned int lineno, jsval *rval); name type description cx jscontext * the context in which to run the script.
JS_EvaluateScriptForPrincipals
jsprincipals *principals, const char *bytes, unsigned int length, const char *filename, unsigned int lineno, jsval *rval, jsversion version); jsbool js_evaluateucscriptforprincipalsversion(jscontext *cx, jsobject *obj, jsprincipals *principals, const jschar *chars, unsigned int length, const char *filename, unsigned int lineno, jsval *rval, jsversion version); name type description cx jscontext * the context in which to run the script.
JS_ExecuteRegExp
:handleobject reobj, char16_t *chars, size_t length, size_t *indexp, bool test, js::mutablehandlevalue rval); bool js_executeregexpnostatics(jscontext *cx, js::handleobject reobj, char16_t *chars, size_t length, size_t *indexp, bool test, js::mutablehandlevalue rval); name type description cx jscontext * the context.
JS_ExecuteScript
jscontext *cx, js::handleobject obj, js::handlescript script); // obsolete since jsapi 39 bool js::cloneandexecutescript(jscontext *cx, js::handle<jsscript*> script); // added in spidermonkey 45 bool js::cloneandexecutescript(jscontext *cx, js::handle<jsobject*> obj, js::handle<jsscript*> script); // added in spidermonkey 31, obsoleted since jsapi 39 name type description cx jscontext * the context in which to execute the script.
JS_ExecuteScriptPart
syntax typedef enum jsexecpart { jsexec_prolog, jsexec_main } jsexecpart; jsbool js_executescriptpart( jscontext *cx, jsobject *obj, jsscript *script, jsexecpart part, jsval *rval); name type description cx jscontext * the context in which to execute the script.
JS_ExecuteScriptVersion
syntax jsbool js_executescriptversion(jscontext *cx, jsobject *obj, jsobject *scriptobj, jsval *rval, jsversion version); name type description cx jscontext * the context in which to execute the script.
JS_FORGET_STRING_FLATNESS
syntax static moz_always_inline jsstring * js_forget_string_flatness(jsflatstring *fstr) { return (jsstring *)fstr; } name type description fstr jsflatstring * a string to convert description js_forget_string_flatness converts jsflatstring * to jsstring *.
JS_FS
name type description name const char * the javascript name for the function.
JS_FileEscapedString
syntax bool js_fileescapedstring(file *fp, jsstring *str, char quote); name type description fp file * a file pointer to write into.
JS_Finish
syntax void js_finish(jsruntime *rt); name type description rt jsruntime * pointer to a js runtime to destroy.
JS_FlushCaches
syntax void js_flushcaches(jscontext *cx); name type description cx jscontext * the context.
JS_ForgetLocalRoot
syntax void js_forgetlocalroot(jscontext *cx, void *thing); name type description cx jscontext * pointer to the context in which the caller is running.
JS_ForwardGetPropertyTo
syntax bool js_forwardgetpropertyto(jscontext *cx, js::handleobject obj, js::handleid id, js::handleobject onbehalfof, js::mutablehandlevalue vp); bool js_forwardgetelementto(jscontext *cx, js::handleobject obj, uint32_t index, js::handleobject onbehalfof, js::mutablehandlevalue vp); name type description cx jscontext * a context.
JS_FreezeObject
syntax bool js_freezeobject(jscontext *cx, js::handle<jsobject*> obj); name type description cx jscontext * the context.
JS_GC
syntax void js_gc(jscontext *cx); // added in spidermonkey 52 void js_gc(jsruntime *rt); // obsolete since jsapi 50 void js_gc(jscontext *cx); // obsolete since jsapi 14 name type description cx jscontext * the context to for which to perform garbage collection.
JS_GetArrayLength
syntax bool js_getarraylength(jscontext *cx, js::handle<jsobject*> obj, uint32_t *lengthp); name type description cx jscontext * the context in which to look up the array's length.
JS_GetContextThread
syntax int js_getcontextthread(jscontext *cx); name type description cx jscontext * the context to examine.
JS_GetDefaultFreeOp
syntax jsfreeop * js_getdefaultfreeop(jsruntime *rt); name type description rt jsruntime * a pointer to the runtime.
JS_GetEmptyString
syntax jsstring * js_getemptystring(jsruntime *rt); name type description rt jsruntime * the runtime for which to return the empty string.
JS_GetExternalStringClosure
syntax void * js_getexternalstringclosure(jscontext *cx, jsstring *str); name type description cx jscontext * the context from which to retrieve the closure for a string.
JS_GetExternalStringFinalizer
syntax const jsstringfinalizer * js_getexternalstringfinalizer(jsstring *str); name type description str jsstring * a string to get finalizer.
JS_GetFlatStringChars
syntax const jschar * js_getflatstringchars(jsflatstring *str); name type description str jsflatstring * the flattended string returned by js_flattenstring.
JS_GetFunctionArity
syntax uint16_t js_getfunctionarity(jsfunction *fun); name type description fun jsfunction * a javascript function.
JS_GetFunctionCallback
syntax jsfunctioncallback js_getfunctioncallback(jscontext *cx); name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS_GetFunctionId
syntax jsstring * js_getfunctionid(jsfunction *fun); jsstring * js_getfunctiondisplayid(jsfunction *fun); // added in spidermonkey 17 name type description fun jsfunction * a javascript function.
JS_GetFunctionName
syntax const char * js_getfunctionname(jsfunction *fun); name type description fun jsfunction * a pointer to a javascript function.
JS_GetFunctionObject
syntax jsobject * js_getfunctionobject(jsfunction *fun); name type description fun jsfunction * pointer to a js function.
JS_GetFunctionScript
syntax jsscript * js_getfunctionscript(jscontext *cx, js::handlefunction fun); name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS_GetGlobalForCompartmentOrNull
syntax jsobject * js_getglobalforcompartmentornull(jscontext *cx, jscompartment *c); name type description cx jscontext * the context for which to return the global object.
JS_GetGlobalForObject
syntax jsobject * js_getglobalforobject(jscontext *cx, jsobject *obj); name type description cx jscontext * a context.
JS_GetGlobalForScopeChain
syntax jsobject * js_getglobalforscopechain(jscontext *cx); name type description cx jscontext * the context for which to return the global object.
JS_GetGlobalObject
(in javascript, global variables are stored as properties of the global object.) syntax jsobject * js_getglobalobject(jscontext *cx); name type description cx jscontext * the context from which to retrieve the global object.
JS_GetInstancePrivate
syntax void * js_getinstanceprivate(jscontext *cx, js::handle<jsobject*> obj, const jsclass *clasp, js::callargs *args); // added in jsapi 32 void * js_getinstanceprivate(jscontext *cx, js::handle<jsobject*> obj, const jsclass *clasp, jsval *argv); // obsolete since jsapi 32 name type description cx jscontext * a context.
JS_GetInternedStringChars
syntax const jschar * js_getinternedstringchars(jsstring *str); const jschar * js_getinternedstringcharsandlength(jsstring *str, size_t *length); name type description str jsstring * the interned string.
JS_GetLatin1FlatStringChars
syntax const js::latin1char * js_getlatin1flatstringchars(const js::autocheckcannotgc &nogc, jsflatstring *str); const char16_t * js_gettwobyteflatstringchars(const js::autocheckcannotgc &nogc, jsflatstring *str); name type description cx jscontext * a context.
JS_GetLatin1InternedStringChars
syntax const js::latin1char * js_getlatin1internedstringchars(const js::autocheckcannotgc &nogc, jsstring *str); const char16_t * js_gettwobyteinternedstringchars(const js::autocheckcannotgc &nogc, jsstring *str); name type description cx jscontext * a context.
JS_GetLatin1StringCharsAndLength
syntax const js::latin1char * js_getlatin1stringcharsandlength(jscontext *cx, const js::autocheckcannotgc &nogc, jsstring *str, size_t *length); const char16_t * js_gettwobytestringcharsandlength(jscontext *cx, const js::autocheckcannotgc &nogc, jsstring *str, size_t *length); name type description cx jscontext * a context.
JS_GetObjectRuntime
syntax jsruntime * js_getobjectruntime(jsobject *obj); name type description obj jsobject * the object to query.
JS_GetOptions
syntax uint32 js_getoptions(jscontext *cx); name type description cx jscontext * the context from which to read options.
JS_GetParentRuntime
syntax jsruntime * js_getparentruntime(jscontext *cx); name type description cx jscontext * the context to query.
JS_GetPendingException
syntax bool js_getpendingexception(jscontext *cx, js::mutablehandlevalue vp); name type description cx jscontext * pointer to the js context in which the exception was thrown.
JS_GetRegExpFlags
syntax unsigned js_getregexpflags(jscontext *cx, handleobject obj) name type description cx jscontext * a context.
JS_GetRegExpSource
syntax jsstring * js_getregexpsource(jscontext *cx, js::handleobject obj); name type description cx jscontext * a context.
JS_GetReservedSlot
syntax // added in spidermonkey 42 js::value js_getreservedslot(jsobject *obj, uint32_t index); void js_setreservedslot(jsobject *obj, uint32_t index, js::value v); // obsolete since spidermonkey 42 jsval js_getreservedslot(jsobject *obj, uint32_t index); void js_setreservedslot(jsobject *obj, uint32_t index, jsval v); name type description obj jsobject * an object that has reserved slots.
JS_GetRuntime
syntax jsruntime * js_getruntime(jscontext *cx); name type description cx jscontext * the context to query.
JS_GetScopeChain
syntax jsobject * js_getscopechain(jscontext *cx); name type description cx jscontext * the context to query.
JS_GetStringBytes
syntax char * js_getstringbytes(jsstring *str); const char * js_getstringbytesz(jscontext *cx, jsstring *str); // added in jsapi 1.8.2 name type description cx jscontext * (js_getstringbytesz and js_encodestring only) a context.
JS_GetStringCharAt
syntax bool js_getstringcharat(jscontext *cx, jsstring *str, size_t index, char16_t *res); char16_t js_getflatstringcharat(jsflatstring *str, size_t index); name type description cx jscontext * the context in which to create the new string.
JS_GetStringChars
syntax jschar * js_getstringchars(jsstring *str); // obsolete since jsapi 1.8.5 const jschar * js_getstringcharsz(jscontext *cx, jsstring *str); // added in spidermonkey 1.8.2, obsolete since jsapi 33 name type description cx jscontext * (in js_getstringcharsz only) a context.
JS_GetStringCharsAndLength
syntax const jschar * js_getstringcharsandlength(jscontext *cx, jsstring *str, size_t *length); name type description cx jscontext * the context.
JS_GetStringEncodingLength
syntax size_t js_getstringencodinglength(jscontext *cx, jsstring *str); name type description cx jscontext * a context.
JS_GetStringLength
syntax size_t js_getstringlength(jsstring *str); name type description str jsstring * the string to examine.
JS_GetTwoByteExternalStringChars
syntax const char16_t * js_gettwobyteexternalstringchars(jsstring *str); name type description str jsstring * a string to get characters.
JS_GetVersion
syntax jsversion js_getversion(jscontext *cx); name type description cx jscontext * the context to query.
JS_HasArrayLength
syntax jsbool js_hasarraylength(jscontext *cx, jsobject *obj, jsuint *lengthp); name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS_IdArrayGet
syntax jsid js_idarrayget(jscontext *cx, jsidarray *ida, unsigned index) name type description cx jscontext * a context.
JS_IdArrayLength
syntax int js_idarraylength(jscontext *cx, jsidarray *ida); name type description cx jscontext * a context.
JS_IdToValue
syntax bool js_idtovalue(jscontext *cx, jsid id, js::mutablehandle<js::value> vp); name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS_InternJSString
syntax jsstring * js_internjsstring(jscontext *cx, js::handlestring str); name type description cx jscontext * the context.
JS_InternString
syntax jsstring * js_internstring(jscontext *cx, const char *s); jsstring * js_internstringn(jscontext *cx, const char *s, size_t length); jsstring * js_internucstring(jscontext *cx, const char16_t *s); jsstring * js_internucstringn(jscontext *cx, const char16_t *s, size_t length); name type description cx jscontext * a context.
JS_IsArrayObject
syntax bool js_isarrayobject(jscontext *cx, js::handlevalue value, bool *isarray); bool js_isarrayobject(jscontext *cx, js::handleobject obj, bool *isarray); // obsolete since jsapi 44 bool js_isarrayobject(jscontext *cx, js::handlevalue value); bool js_isarrayobject(jscontext *cx, js::handleobject obj); name type description cx jscontext * a context.
JS_IsAssigning
syntax jsbool js_isassigning(jscontext *cx); name type description description js_isassigning returns true if a script is executing and its current bytecode is a set (assignment) operation, even if there are native (no script) stack frames between the script and the caller to js_isassigning.
JS_IsBuiltinEvalFunction
syntax bool js_isbuiltinevalfunction(jsfunction *fun); name type description obj jsfunction * pointer to the function to test.
JS_IsBuiltinFunctionConstructor
syntax bool js_isbuiltinfunctionconstructor(jsfunction *fun); name type description obj jsfunction * pointer to the function to test.
JS_IsConstructing
syntax jsbool js_isconstructing(jscontext *cx, jsval *vp); name type description cx jscontext * the cx parameter passed to the jsnative.
JS_IsConstructor
syntax bool js_isconstructor(jsfunction *fun); name type description fun jsfunction * the function to examine.
JS_IsExceptionPending
syntax bool js_isexceptionpending(jscontext *cx); name type description cx jscontext * pointer to a js context to check for pending exceptions.
JS_IsExtensible
syntax bool js_isextensible(jscontext *cx, js::handleobject obj, bool *extensible); name type description cx jscontext * the context.
JS_IsExternalString
syntax bool js_isexternalstring(jsstring *str); name type description str jsstring * the string to check.
JS_IsGlobalObject
syntax bool js_isglobalobject(jsobject *obj); name type description obj jsobject * the object to examine.
JS_IsIdentifier
syntax bool js_isidentifier(jscontext *cx, js::handlestring str, bool *isidentifier); bool js_isidentifier(const char16_t *chars, size_t length); // added in spidermonkey 38 name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS_IsNative
syntax bool js_isnative(jsobject *obj); name type description str jsobject * the object to check.
JS_IsNativeFunction
syntax bool js_isnativefunction(jsobject *funobj, jsnative call); name type description funobj jsobject * the function object to examine.
JS_IsRunning
syntax bool js_isrunning(jscontext *cx); name type description cx jscontext * the context to query.
JS_IsStopIteration
syntax // added in spidermonkey 42 bool js_isstopiteration(js::value v); // obsolete since spidermonkey 42 bool js_isstopiteration(jsval v); name type description v js::value the value to check.
JS_LeaveCompartment
syntax void js_leavecompartment(jscontext *cx, jscompartment *oldcompartment); name type description cx jscontext * the context in which to leave the compartment.
JS_LeaveCrossCompartmentCall
syntax void js_leavecrosscompartmentcall(jscrosscompartmentcall *call); name type description call jscrosscompartmentcall * value returned by previous call to js_entercrosscompartmentcall.
JS_LeaveLocalRootScope
syntax void js_leavelocalrootscope(jscontext *cx); name type description cx jscontext * pointer to the context.
JS_LeaveLocalRootScopeWithResult
syntax void js_leavelocalrootscopewithresult(jscontext *cx, jsval rval); name type description cx jscontext * pointer to the context.
JS_Lock
syntax void js_lock(jsruntime *rt); name type description rt jsruntime * pointer to the runtime to lock.
JS_LockGCThing
syntax jsbool js_lockgcthing(jscontext *cx, void *thing); // obsolete since jsapi 21 jsbool js_unlockgcthing(jscontext *cx, void *thing); // obsolete since jsapi 21 jsbool js_lockgcthingrt(jsruntime *rt, void *thing); jsbool js_unlockgcthingrt(jsruntime *rt, void *thing); name type description cx jscontext * a context.
JS_LookupElement
syntax bool js_lookupelement(jscontext *cx, js::handleobject obj, uint32_t index, js::mutablehandlevalue vp); name type description cx jscontext * the context in which to look up the property.
JS_LooselyEqual
syntax bool js_looselyequal(jscontext *cx, js::handle<js::value> v1, js::handle<js::value> v2, bool *equal); name type description cx jscontext * the context in which to perform the conversion.
JS_MakeStringImmutable
syntax jsbool js_makestringimmutable(jscontext *cx, jsstring *str); name type description cx jscontext * a context.
JS_MapGCRoots
syntax uint32 js_mapgcroots(jsruntime *rt, jsgcrootmapfun map, void *data); callback syntax #define js_map_gcroot_next 0 /* continue mapping entries */ #define js_map_gcroot_stop 1 /* stop mapping entries */ #define js_map_gcroot_remove 2 /* remove and free the current entry */ typedef int (*jsgcrootmapfun)(void *rp, const char *name, void *data); description call js_mapgcroots to map the gc's roots table using map(rp, name, data).
JS_MaybeGC
syntax void js_maybegc(jscontext *cx); name type description cx jscontext * the context in which to perform garbage collection, if needed.
JS_NewArrayObject
syntax jsobject * js_newarrayobject(jscontext *cx, const js::handlevaluearray& contents); // added in spidermonkey 31 jsobject * js_newarrayobject(jscontext *cx, size_t length); // added in spidermonkey 31 jsobject * js_newarrayobject(jscontext *cx, int length, jsval *vector); // obsolete since jsapi 30 name type description cx jscontext * the context in which to create the new array.
JS_NewCompartmentAndGlobalObject
syntax jsobject * js_newcompartmentandglobalobject(jscontext *cx, jsclass *clasp, jsprincipals *principals); name type description cx jscontext * the context in which to create the new global object.
JS_NewContext
syntax jscontext * js_newcontext(jsruntime *rt, size_t stackchunksize); name type description rt jsruntime * parent runtime for the new context.
JS_NewDateObject
syntax jsobject * js_newdateobject(jscontext *cx, int year, int mon, int mday, int hour, int min, int sec); name type description cx jscontext * the context in which to create the new date object.
JS_NewDateObjectMsec
syntax jsobject * js_newdateobjectmsec(jscontext *cx, double msec); name type description cx jscontext * the context.
JS_NewDependentString
syntax jsstring * js_newdependentstring(jscontext *cx, js::handlestring str, size_t start, size_t length); name type description cx jscontext * the context in which to create the new string.
JS_NewDouble
syntax jsdouble * js_newdouble(jscontext *cx, jsdouble d); name type description cx jscontext * the context in which to create the new number.
JS_NewDoubleValue
create a floating-point jsval syntax jsbool js_newdoublevalue(jscontext *cx, jsdouble d, jsval *rval); name type description cx jscontext * the context in which to create the new number.
JS_NewFunction
d); // obsolete since jsapi 39 jsfunction * js_newfunction(jscontext *cx, jsnative call, unsigned nargs, unsigned flags, js::handle<jsobject*> parent, const char *name); jsfunction * js_newfunctionbyid(jscontext *cx, jsnative call, unsigned nargs, unsigned flags, js::handle<jsobject*> parent, js::handle<jsid> id); // added in spidermonkey 17 name type description cx jscontext * the context in which to create the new function.
JS_NewRegExpObject
::handleobject obj, const char16_t *chars, size_t length, unsigned flags); jsobject * js_newregexpobjectnostatics(jscontext *cx, char *bytes, size_t length, unsigned flags); jsobject * js_newucregexpobjectnostatics(jscontext *cx, char16_t *chars, size_t length, unsigned flags); name type description cx jscontext * the context in which to create the new object.
JS_NewRuntime
syntax jsruntime * js_newruntime(uint32_t maxbytes, uint32_t maxnurserybytes = js::defaultnurserybytes, jsruntime *parentruntime = nullptr); jsruntime * js_newruntime(uint32_t maxbytes, jsusehelperthreads usehelperthreads, jsruntime *parentruntime = nullptr); // deprecated since jsapi 32 name type description maxbytes uint32 maximum number of allocated bytes after which garbage collection is run.
JS_NewUCString
syntax jsstring * js_newucstring(jscontext *cx, char16_t *chars, size_t length); jsstring * js_newstring(jscontext *cx, char *buf, size_t length); // obsolete since jsapi 1.8.5 name type description cx jscontext * the context in which to create the new string.
JS_NewStringCopyZ
syntax jsstring * js_newstringcopyz(jscontext *cx, const char *s); jsstring * js_newucstringcopyz(jscontext *cx, const char16_t *s); name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS_NextProperty
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.
JS_ObjectIsDate
syntax bool js_objectisdate(jscontext *cx, js::handleobject obj); name type description cx jscontext * pointer to a javascript context from which to derive runtime information.
JS_ObjectIsFunction
syntax bool js_objectisfunction(jscontext *cx, jsobject *obj); name type description cx jscontext * a context.
JS_ObjectIsRegExp
syntax bool js_objectisregexp(jscontext *cx, js::handleobject obj); name type description cx jscontext * a context.
JS_PSGS
name type description name const char * the javascript name for the property.
JS_ParseJSON
syntax jsbool js_parsejson(jscontext *cx, const jschar *chars, uint32 len, jsval *vp); jsbool js_parsejsonwithreviver(jscontext *cx, const jschar *chars, uint32 len, jsval reviver, jsval *vp); name type description cx jscontext * pointer to a js context.
JS_PopArguments
syntax void js_poparguments(jscontext *cx, void *mark); name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS_PutEscapedString
syntax size_t js_putescapedstring(jscontext *cx, char *buffer, size_t size, jsstring *str, char quote); size_t js_putescapedflatstring(char *buffer, size_t size, jsflatstring *str, char quote); name type description cx jscontext * a context.
JS_Remove*Root
syntax jsbool js_removevalueroot(jscontext *cx, jsval *vp); jsbool js_removestringroot(jscontext *cx, jsstring **spp); jsbool js_removeobjectroot(jscontext *cx, jsobject **opp); jsbool js_removegcthingroot(jscontext *cx, void **rp); name type description cx jscontext * a context.
JS_RemoveRootRT
syntax jsbool js_removerootrt(jsruntime *rt, void *rp); name type description rt jsruntime * pointer to the runtime with which the root was registered.
JS_ReportError
syntax void js_reporterror(jscontext *cx, const char *format, ...); bool js_reportwarning(jscontext *cx, const char *format, ...); name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS_ReportOutOfMemory
syntax void js_reportoutofmemory(jscontext *cx); void js_reportallocationoverflow(jscontext *cx); // added in spidermonkey 1.8 name type description cx jscontext * the context in which to report the error.
JS_ReportPendingException
syntax bool js_reportpendingexception(jscontext *cx); name type description cx jscontext * the context in which the exception was thrown.
JS_RestoreExceptionState
syntax void js_restoreexceptionstate(jscontext *cx, jsexceptionstate *state); name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS_SameValue
1, v2) { if (v1 === 0 && v2 === 0) return 1 / v1 === 1 / v2; if (v1 !== v1 && v2 !== v2) return true; return v1 === v2; } syntax // added in spidermonkey 45 bool js_samevalue(jscontext *cx, js::handle<js::value> v1, js::handle<js::value> v2, bool *same); // obsolete since jsapi 39 bool js_samevalue(jscontext *cx, jsval v1, jsval v2, bool *same); name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS_SaveExceptionState
syntax jsexceptionstate * js_saveexceptionstate(jscontext *cx); name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS_SaveFrameChain
syntax bool js_saveframechain(jscontext *cx); void js_restoreframechain(jscontext *cx); name type description cx jscontext * the context to query.
JS_SealObject
syntax jsbool js_sealobject(jscontext *cx, jsobject *obj, jsbool deep); name type description cx jscontext * a context.
JS_SetArrayLength
syntax bool js_setarraylength(jscontext *cx, js::handle<jsobject*> obj, uint32_t length); name type description cx jscontext * the context in which to change the length of the array.
JS_SetCheckObjectAccessCallback
syntax jscheckaccessop js_setcheckobjectaccesscallback( jsruntime *rt, jscheckaccessop acb); name type description rt jsruntime * the runtime to configure.
JS_SetDefaultLocale
syntax bool js_setdefaultlocale(jsruntime *rt, const char *locale); void js_resetdefaultlocale(jsruntime *rt); name type description rt jsruntime * pointer to a js runtime locale const char * string represents locale.
JS_SetElement
32_t index, int32_t v); bool js_setelement(jscontext *cx, js::handleobject obj, uint32_t index, uint32_t v); bool js_setelement(jscontext *cx, js::handleobject obj, uint32_t index, double v); /* obsolete since jsapi 29 */ bool js_setelement(jscontext *cx, js::handleobject obj, uint32_t index, js::mutablehandlevalue vp); name type description cx jscontext * the context in which to set the element.
JS_SetExtraGCRoots
callback syntax typedef void jstracedataop (jstracer *trc, void *data); argument meaning trc tracing data, to be passed through to js_calltracer.
JS_SetGCParametersBasedOnAvailableMemory
syntax void js_setgcparametersbasedonavailablememory(jsruntime *rt, uint32_t availmem); name type description rt jsruntime * the runtime to configure.
JS_SetGCZeal
syntax void js_setgczeal(jscontext *cx, uint8_t zeal, uint32_t frequency); name type description cx jscontext * a context.
JS_SetGlobalObject
syntax void js_setglobalobject(jscontext *cx, jsobject *obj); name type description cx jscontext * the context to configure.
JS_SetICUMemoryFunctions
syntax bool js_seticumemoryfunctions(js_icuallocfn allocfn, js_icureallocfn reallocfn, js_icufreefn freefn); type description allocfn js_icuallocfn an allocation function.
JS_SetNativeStackQuota
syntax void js_setnativestackquota(jsruntime *cx, size_t systemcodestacksize, size_t trustedscriptstacksize = 0, size_t untrustedscriptstacksize = 0); name type description rt jsruntime * the runtime.
JS_SetObjectPrincipalsFinder
syntax jsobjectprincipalsfinder js_setobjectprincipalsfinder(jsruntime *rt, jsobjectprincipalsfinder fop); name type description rt jsruntime * the runtime to configure.
JS_SetOptions
syntax uint32 js_setoptions(jscontext *cx, uint32 options); name type description cx jscontext * a context on which to set options.
JS_SetParent
syntax bool js_setparent(jscontext *cx, js::handleobject obj, js::handleobject parent); name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS_SetPendingException
syntax void js_setpendingexception(jscontext *cx, js::handlevalue v); name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS_SetPrincipalsTranscoder
syntax jsprincipalstranscoder js_setprincipalstranscoder(jsruntime *rt, jsprincipalstranscoder px); name type description rt jsruntime * the runtime to configure.
JS_SetProperty
*cx, js::handleobject obj, const char *name, js::handlevalue v); bool js_setucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, js::handlevalue v); bool js_setpropertybyid(jscontext *cx, js::handleobject obj, js::handleid id, js::handlevalue v); // added in spidermonkey 1.8.1 name type description cx jscontext * pointer to a js context from which to derive runtime information.
JS_SetPropertyAttributes
syntax jsbool js_setpropertyattributes(jscontext *cx, jsobject *obj, const char *name, unsigned int attrs, jsbool *foundp); jsbool js_setucpropertyattributes(jscontext *cx, jsobject *obj, const jschar *name, size_t namelen, unsigned int attrs, jsbool *foundp); name type description cx jscontext * the context in which to set the property attributes.
JS_SetRegExpInput
syntax bool js_setregexpinput(jscontext *cx, js::handleobject obj, js::handlestring input, bool multiline); name type description cx jscontext * the context.
JS_SetScriptStackQuota
syntax void js_setscriptstackquota(jscontext *cx, size_t quota); name type description cx jscontext * the context to configure.
JS_SetThreadStackLimit
syntax void js_setthreadstacklimit(jscontext *cx, jsuword limitaddr) name type description cx jscontext * the context to configure.
JS_StrictlyEqual
syntax // added in spidermonkey 45 bool js_strictlyequal(jscontext *cx, js::handle<js::value> v1, js::handle<js::value> v2, bool *equal); // obsolete since jsapi 39 bool js_strictlyequal(jscontext *cx, jsval v1, jsval v2, bool *equal); name type description cx jscontext * the context in which to perform the conversion.
JS_StringEqualsAscii
syntax bool js_stringequalsascii(jscontext *cx, jsstring *str, const char *asciibytes, bool *match); bool js_flatstringequalsascii(jsflatstring *str, const char *asciibytes); name type description cx jscontext * a context.
JS_StringHasBeenInterned
syntax bool js_stringhasbeeninterned(jscontext *cx, jsstring *str); name type description str jsstring * a string to examine.
JS_StringHasLatin1Chars
syntax bool js_stringhaslatin1chars(jsstring *str); name type description str jsstring * string to examine.
JS_StringIsFlat
syntax bool js_stringisflat(jsstring *str); name type description str jsstring * string to examine.
JS_StringToVersion
syntax jsversion js_stringtoversion(const char *string); name type description string const char * version string to convert.
JS_SuspendRequest
syntax jsrefcount js_suspendrequest(jscontext *cx); void js_resumerequest(jscontext *cx, jsrefcount savedepth); name type description cx jscontext * the context whose current request is to be suspended or resumed.
JS_ThrowStopIteration
syntax bool js_throwstopiteration(jscontext *cx); name type description cx jscontext * the context in which to throw the stopiteration object.
JS_ToggleOptions
syntax uint32 js_toggleoptions(jscontext *cx, uint32 options); name type description cx jscontext * a context on which to modify options.
JS_Unlock
syntax void js_unlock(jsruntime *rt); name type description rt jsruntime * pointer to the runtime to unlock.
JS_ValueToBoolean
syntax jsbool js_valuetoboolean(jscontext *cx, jsval v, jsbool *bp); name type description cx jscontext * the context in which to perform the conversion.
JS_ValueToInt32
syntax jsbool js_valuetoint32(jscontext *cx, jsval v, int32 *ip); name type description cx jscontext * the context in which to perform the conversion.
JS_ValueToSource
syntax jsstring * js_valuetosource(jscontext *cx, js::handle<js::value> v); name type description cx jscontext * the context in which to perform the conversion.
JS_VersionToString
syntax const char * js_versiontostring(jsversion version); name type description version jsversion version value to convert.
JS_YieldRequest
syntax void js_yieldrequest(jscontext *cx); name type description cx jscontext * the jscontext that is currently in a request on the calling thread.
JS_freeop
syntax void js_freeop(jsfreeop *fop, void *p); name type description fop jsfreeop * a pointer to jsfreeop structure to be used to get the implementation of free.
JS_malloc
syntax void * js_malloc(jscontext *cx, size_t nbytes); void * js_realloc(jscontext *cx, void *p, size_t oldbytes, size_t newbytes); char * js_strdup(jscontext *cx, const char *s); void js_free(jscontext *cx, void *p); name type description cx jscontext * pointer to a js context.
JS_updateMallocCounter
syntax void js_updatemalloccounter(jscontext *cx, size_t nbytes); name type description cx jscontext * pointer to a js context to decrement the malloc counter.
Stored value
the javascript engine sets aside a field of type jsval for the stored value of most object properties, even properties that have getters.
TPS Bookmark Lists
folder contents the contents for a folder are given as an array of objects, representing various bookmark types, described below.
Web Replay
in general, redirections are needed for any function that is (a) not compiled as part of gecko, and either (b) may behave differently between recording and replaying, or (c) depends on data produced by other redirected functions (for example, corefoundation types like cfarrayref and cfstringref).
The Rust programming language
in addition, rust offers zero-cost abstractions, move semantics, guaranteed memory safety, threads with no data races, trait-based generics, pattern matching, type inference, and efficient c bindings, with a minimum runtime size.
Setting up an update server
<?xml version="1.0" encoding="utf-8"?> <updates> <update type="minor" displayversion="2000.0a1" appversion="2000.0a1" platformversion="2000.0a1" buildid="21181002100236"> <patch type="complete" url="http://127.0.0.1:8000/<mar name>" hashfunction="sha512" hashvalue="<hash>" size="<size>"/> </update> </updates> if you've downloaded the mar you're using, you'll find the sha512 value in a file called sha512sums in the root of the release directory ...
AT Development
then comtypes gives access to msaa and iaccessible2.
Feed content access API
that code looks like this: feedtestresultlistener.prototype = { handleresult: function(result) { var feed = result.doc; feed.queryinterface(components.interfaces.nsifeed); // open a new window var win = window.open("", "feedtest_window"); var doc = win.document.wrappedjsobject; doc.open(); // write the html header and page title doc.write("<html><head><title>feed: " + feed.title.t...
Mork
MozillaTechMork
there are two types of meta-rows, those of rows and those of tables.
extIExtension
method overview fixme: attributes attribute type description id readonly attribute astring the id of the extension.
extISessionStorage
return type method boolean has(in astring aname) void set(in astring aname, in nsivariant avalue) nsivariant get(in astring aname, in nsivariant adefaultvalue) attributes attribute type description events readonly attribute extievents the events object for the storage supports: "change" methods has() determines if a storage...
Generating GUIDs
guids are used in mozilla programming for identifying several types of entities, including xpcom interfaces (this type of guids is callled iid), components (cid), and legacy add-ons—like extensions and themes—that were created prior to firefox 1.5.
Avoiding leaks in JavaScript XPCOM components
however, it's easy to inadvertently create this same type of leak when using closures.
Using XPCOM Components
mponent object and pass in the contract id for the component you want and ask for either a singleton or an instance of that component to be returned: var cmgr = components.classes["@mozilla.org/cookiemanager;1"] .getservice(); the resulting cookiemanager object then provides access to all of the methods for that component that have been defined in idl and compiled into the type library.
Creating XPCOM components
preface who should read this book organization of the tutorial following along with the examples conventions acknowledgements an overview of xpcom the xpcom solution gecko components interfaces interfaces and encapsulation the nsisupports base interface xpcom identifiers cid contract id factories xpidl and type libraries xpcom services xpcom types method types reference counting status codes variable mappings common xpcom error codes using xpcom components component examples cookie manager the webbrowserfind component the weblock component component use in mozilla finding mozilla components using xpcom components in your cpp xpconnect: using xpcom compone...
Making cross-thread calls using runnables
so we declare an asynchronous version of the same function: typedef void (*picallback)(const nscstring& result); // callback function void calculatepiasynchronously(int digits, picallback callback); creating a runnable nsrunnable is a helper class: it already implements threadsafe refcounting, so all you need to do is override the run() function.
Interfacing with the XPCOM cycle collector
(we call nsibar the canonical isupports type for nsfoo.) add a line ns_interface_map_entries_cycle_collection(nsfoo) to the interface map of nsfoo in nsfoo.cpp.
Components.interfaces
properties of the components.interfaces object are used where xpcom methods expect a parameter of type nsid.
Components.isSuccessCode
syntax var succeeded = components.issuccesscode(returncode); parameters returncode the return code (of type nsresult) to be checked.
Components.results
*/ } class.prototype = { /* ...
Components.stack
components.stack is a read only property of type nsistackframe (idl definition) that represents a snapshot of the current javascript callstack.
Components.utils.exportFunction
for the full details refer to the documentation for xray vision, but for example: functions are not visible in the xrays of javascript object types.
Components.utils.waiveXrays
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.
Components object
utils.getglobalforobject returns the global object with which a given object is associated (through its prototype chain at birth, for example).
Other Resources
other resources embedding mozilla xpconnect - javascript-xpcom bridge blackconnect - java-xpcom bridge (no longer supported) xpidl to java types - from blackconnect ...
XPConnect wrappers
there are several types of wrapped natives, but i won't cover those here.
XPCShell Reference
-v version this allows you to specify a specific version of js to use, and should be set to an integral value specified by the jsversion enumerated type.
Language bindings
sicomponentmanager 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.
Core XPCOM functions
platform independent representation of a file path.ns_newnativelocalfilethe ns_newnativelocalfile function creates an instance of nsilocalfile that provides a platform independent representation of a file path.ns_reallocreallocates a block of memory using the xpcom memory manager.ns_shutdownxpcomthe ns_shutdownxpcom function terminates use of xpcom in the calling process.nsresultthe nsresult data type is a strongly-typed enum used to represent a value returned by an xpcom function; these are typically error or status codes.
NS_ConvertASCIItoUTF16
if size_type(-1) is passed for newlen, then the current length of the string is used.
NS_ConvertUTF16toUTF8
if size_type(-1) is passed for newlen, then the current length of the string is used.
NS_ConvertUTF8toUTF16
if size_type(-1) is passed for newlen, then the current length of the string is used.
NS_LossyConvertUTF16toASCII
if size_type(-1) is passed for newlen, then the current length of the string is used.
BeginReading
const char_type* beginreading() const; remarks the resulting character array is not necessarily null-terminated.
Cut
void cut( index_type acutstart, size_type acutlength ); parameters acutstart [in] the starting index of the section to remove, measured in storage units.
Length
size_type length() const; ...
BeginReading
const char_type* beginreading() const; remarks the resulting character array is not necessarily null-terminated.
Cut
void cut( index_type acutstart, index_type acutlength ); parameters acutstart [in] the starting index of the section to remove, measured in storage units.
Length
size_type length() const; ...
nsAdoptingCString
if size_type(-1) is passed for newlen, then the current length of the string is used.
nsAdoptingString
if size_type(-1) is passed for newlen, then the current length of the string is used.
nsAutoRef
in order to use nsautoref<t> for a class t associated with a particular resource type, the type of the handle to the resource and the method for releasing the resource must be provided for class t.
nsAutoString
if size_type(-1) is passed for newlen, then the current length of the string is used.
nsCAutoString
if size_type(-1) is passed for newlen, then the current length of the string is used.
nsCString
if size_type(-1) is passed for newlen, then the current length of the string is used.
nsCountedRef
in order to use nscountedref<t> for a class t associated with a particular resource type, the type of the handle to the resource and the methods for referencing and releasing the resource must be provided for class t.
nsDependentCSubstring
if size_type(-1) is passed for newlen, then the current length of the string is used.
nsDependentSubstring
if size_type(-1) is passed for newlen, then the current length of the string is used.
get
const char_type* get() const; example code nsembedcstring str("hello world"); printf("%s\n", str.get()); ...
get
const char_type* get() const; example code void getbar(nsastring &result); void func() { nsembedstring str; getbar(str); const prunichar *data = str.get(); ...
nsFixedCString
if size_type(-1) is passed for newlen, then the current length of the string is used.
nsFixedString
if size_type(-1) is passed for newlen, then the current length of the string is used.
nsPromiseFlatCString
if size_type(-1) is passed for newlen, then the current length of the string is used.
nsPromiseFlatString
if size_type(-1) is passed for newlen, then the current length of the string is used.
nsString
if size_type(-1) is passed for newlen, then the current length of the string is used.
amIWebInstallInfo
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void install(); attributes attribute type description installs nsivariant an array of addoninstall objects.
imgICache
findentryproperties() find properties used to get properties such as 'type' and 'content-disposition' 'type' is a nsisupportscstring containing the images' mime type such as 'image/png' 'content-disposition' will be a nsisupportscstring containing the header if you call this before any data has been loaded from a uri, it will succeed, but come back empty.
jsdIStackFrame
method overview boolean eval(in astring bytes, in autf8string filename, in unsigned long line, out jsdivalue result); attributes attribute type description callee jsdivalue function object running in this stack frame.
mozIJSSubScriptLoader
options an object that may include any of these parameters: property type description target object the object to use as the scope object for the script being executed.
mozIPersonalDictionary
boolean check(in wstring word, in wstring lang); void endsession(); void getcorrection(in wstring word, [array, size_is(count)] out wstring words, out pruint32 count); void ignoreword(in wstring word); void load(); void removecorrection(in wstring word,in wstring correction, in wstring lang); void removeword(in wstring word, in wstring lang); void save(); attributes attribute type description wordlist nsistringenumerator get the (lexicographically sorted) list of words.
mozIPlaceInfo
toolkit/components/places/public/moziasynchistory.idlscriptable this interface provides additional info for a places entry 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) attributes attribute type description frecency long read only: the frecency of the place.
mozIPlacesAutoComplete
behavior_typed 1 << 5 search for typed pages.
mozIRegistry
these are placeholders for the types of components you're designing and implementing.
mozISpellCheckingEngine
ry(in nsifile dir); boolean check(in wstring word); void getdictionarylist([array, size_is(count)] out wstring dictionaries, out pruint32 count); void removedirectory(in nsifile dir); void suggest(in wstring word,[array, size_is(count)] out wstring suggestions, out pruint32 count); attributes attribute type description copyright wstring a string indicating the copyright of the engine.
mozIStorageBindingParamsArray
method overview void addparams(in mozistoragebindingparams aparameters); mozistoragebindingparams newbindingparams(); attributes attribute type description length unsigned long the number of mozistoragebindingparams objects in the array.
mozIStorageStatement
parameter(in unsigned long aparamindex); void bindblobparameter(in unsigned long aparamindex, [array,const,size_is(avaluesize)] in octet avalue, in unsigned long avaluesize); mozistoragependingstatement executeasync(mozistoragestatementcallback acallback); boolean executestep(); boolean step(); void execute(); attributes attribute type description columncount unsigned long number of columns returned.
mozIStorageStatementWrapper
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void initialize(in mozistoragestatement astatement); void reset(); boolean step(); void execute(); attributes attribute type description statement mozistoragestatement the statement that is wrapped.
mozIStorageVacuumParticipant
method overview boolean onbeginvacuum(); void onendvacuum(in boolean asucceeded); attributes attribute type description databaseconnection mozistorageconnection a connection to the database file to be vacuumed.
nsIAbstractWorker
1.0 66 introduced gecko 1.9.1 inherits from: nsidomeventtarget last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) attributes attribute type description onerror nsidomeventlistener the error listener for the worker.
nsIAccessible
getaccessiblerelated this method returns an accessible related to this one by the given relation type.
nsIAccessibleCaretMoveEvent
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) attributes attribute type description caretoffset long return caret offset.
nsIAccessibleEditableText
cuttext(in long startpos, in long endpos); void deletetext(in long startpos, in long endpos); void inserttext(in astring text, in long position); void pastetext(in long position); void setattributes(in long startpos, in long endpos, in nsisupports attributes); unimplemented void settextcontents(in astring text); attributes attribute type description associatededitor nsieditor returns an editor associated with the accessible.
nsIAccessibleHyperLink
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview nsiaccessible getanchor(in long index); note: renamed from getobject in gecko 1.9 nsiuri geturi(in long index); boolean isselected(); obsolete since gecko 1.9 boolean isvalid(); obsolete since gecko 1.9 attributes attribute type description anchorcount long the number of anchors within this hyperlink.
nsIAccessibleHyperText
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview nsiaccessiblehyperlink getlink(in long linkindex); long getlinkindex(in long charindex); long getselectedlinkindex(); obsolete since gecko 1.9 attributes attribute type description linkcount long the number of links contained within this hypertext object.
nsIAccessibleRelation
method overview nsiaccessible gettarget(in unsigned long index); nsiarray gettargets(); attributes attribute type description relationtype unsigned long returns the type of the relation.
nsIAccessibleSelectable
inherits from: nsisupports last changed in gecko 1.7 method overview void addchildtoselection(in long index); void clearselection(); nsiarray getselectedchildren(); boolean ischildselected(in long index); nsiaccessible refselection(in long index); void removechildfromselection(in long index); boolean selectallselection(); attributes attribute type description selectioncount long the number of accessible children currently selected.
nsIAccessibleStateChangeEvent
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview boolean isenabled(); boolean isextrastate(); attributes attribute type description state unsigned long returns the state of accessible (see constants declared in nsiaccessiblestates).
nsIAccessibleTable
long columnindex); boolean iscolumnselected(in long columnindex); boolean isprobablyforlayout(); boolean isrowselected(in long rowindex); void selectcolumn(in long columnindex); void selectrow(in long rowindex); void unselectcolumn(in long columnindex); void unselectrow(in long rowindex); attributes attribute type description caption nsiaccessible the caption accessible for the table.
nsIAccessibleTableCell
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview boolean isselected(); attributes attribute type description columnextent long return the number of columns occupied by this cell.
nsIAccessibleTableChangeEvent
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) attributes attribute type description numrowsorcols long return the number of rows or cols.
nsIAccessibleTextChangeEvent
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview boolean isinserted(); attributes attribute type description length unsigned long returns length of changed text.
nsIAccessibleValue
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview boolean setcurrentvalue(in double value); obsolete since gecko 1.9 attributes attribute type description currentvalue double maximumvalue double read only.
nsIAccessibleWin32Object
inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description hwnd voidptr handle to the external window implementing iaccessible.
nsIAppShell
nt(in prboolref arealevent, in voidptrref aevent); obsolete since gecko 1.9 void listentoeventqueue(in nsieventqueue aqueue, in prbool alisten); obsolete since gecko 1.9 void resumenative(); void run(); void runinstablestate(in nsirunnable arunnable); void spindown(); obsolete since gecko 1.9 void spinup(); obsolete since gecko 1.9 void suspendnative(); attributes attribute type description eventloopnestinglevel unsigned long the current event loop nesting level.
nsIAppStartup
void exitlastwindowclosingsurvivalarea(); void getstartupinfo(); void hidesplashscreen(); obsolete since gecko 1.9.1 void initialize(in nsisupports nativeappsupportorsplashscreen); obsolete since gecko 1.9.1 void quit(in pruint32 amode); void restartinsafemode(in pruint32 aquitmode); void run(); attributes attribute type description interrupted boolean true if the startup process was interrupted by an interactive prompt.
nsIApplicationCacheChannel
1.0 66 introduced gecko 1.9.1 inherits from: nsiapplicationcachecontainer last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void markofflinecacheentryasforeign(); attributes attribute type description chooseapplicationcache boolean when true, the channel will choose an application cache if one was not explicitly provided and none is available from the notification callbacks.
nsIApplicationCacheContainer
1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) attributes attribute type description applicationcache nsiapplicationcache the application cache with which the object is associated.
nsIApplicationUpdateService
nderbird 3.3 / seamonkey 2.1) method overview void adddownloadlistener(in nsirequestobserver listener); astring downloadupdate(in nsiupdate update, in boolean background); void pausedownload(); void removedownloadlistener(in nsirequestobserver listener); nsiupdate selectupdate([array, size_is(updatecount)] in nsiupdate updates, in unsigned long updatecount); attributes attribute type description backgroundchecker nsiupdatechecker the update checker being used for background update checking.
nsIArray
method overview nsisimpleenumerator enumerate(); unsigned long indexof(in unsigned long startindex, in nsisupports element); void queryelementat(in unsigned long index, in nsiidref uuid, [iid_is(uuid), retval] out nsqiresult result); attributes attribute type description length unsigned long the number of elements in the array.
nsIAuthInformation
attributes attribute type description authenticationscheme autf8string the authentication scheme used for this request, if applicable.
nsIAutoCompleteInput
hanged in gecko 1.9 (firefox 3) method overview acstring getsearchat(in unsigned long index); void onsearchbegin(); void onsearchcomplete(); boolean ontextentered(); boolean ontextreverted(); void selecttextrange(in long startindex, in long endindex); attributes attribute type description completedefaultindex boolean if a search result has its defaultindex set, this will optionally try to complete the text in the textbox to the entire text of the result at the default index as the user types.
nsIAutoCompleteItem
inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description classname string class name used to define some style through css like the colors, an icon url, and so on.
nsIAutoCompleteListener
inherits from: nsisupports last changed in gecko 1.7 method overview void onautocomplete(in nsiautocompleteresults result, in autocompletestatus status); void onstatus(in wstring statustext); attributes attribute type description param nsisupports private parameter used by the autocomplete widget.
nsIBidiKeyboard
o-right and right-to-left directions (that is users who use arabic, iranian (persian), or israel (hebrew) keyboard layout, beside an us (english) layout.) inherits from: nsisupports last changed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) method overview boolean islangrtl(); void setlangfrombidilevel(in pruint8 alevel); attributes attribute type description havebidikeyboards boolean indicates whether or not the system has at least one keyboard for each direction (left-to-right and right-to-left) installed.
nsIBinaryInputStream
xpcom/io/nsibinaryinputstream.idlscriptable this interface allows consumption of primitive data types from a "binary stream" containing untagged, big-endian binary data, that is as produced by an implementation of nsibinaryoutputstream.
nsIBinaryOutputStream
xpcom/io/nsibinaryoutputstream.idlscriptable this interface allows writing of primitive data types (integers, floating-point values, booleans, and so on.) to a stream in a binary, untagged, fixed-endianness format.
nsIBoxObject
okandfeelmetric(in wstring propertyname); obsolete since gecko 1.9 wstring getproperty(in wstring propertyname); nsisupports getpropertyassupports(in wstring propertyname); void removeproperty(in wstring propertyname); void setproperty(in wstring propertyname, in wstring propertyvalue); void setpropertyassupports(in wstring propertyname, in nsisupports value); attributes attribute type description element nsidomelement read only.
nsIBrowserBoxObject
attributes attribute type description docshell nsidocshell read only.
nsICRLInfo
inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description lastfetchurl autf8string the url this crl was last fetched from.
nsICacheDeviceInfo
inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description description string get a human readable description of the cache device.
nsICacheEntryDescriptor
nt(in string key); void markvalid(); nsiinputstream openinputstream(in unsigned long offset); nsioutputstream openoutputstream(in unsigned long offset); void setdatasize(in unsigned long size); void setexpirationtime(in pruint32 expirationtime); void setmetadataelement(in string key, in string value); void visitmetadata(in nsicachemetadatavisitor visitor); attributes attribute type description accessgranted nscacheaccessmode get the access granted to this descriptor.
nsICacheEntryInfo
inherits from: nsisupports last changed in gecko 1.7 method overview boolean isstreambased(); attributes attribute type description clientid string get the client id associated with this cache entry.
nsICacheService
in boolean streambased); acstring createtemporaryclientid(in nscachestoragepolicy storagepolicy); obsolete since gecko 1.9.2 void evictentries(in nscachestoragepolicy storagepolicy); void init(); obsolete since gecko 1.8 void shutdown(); obsolete since gecko 1.8 void visitentries(in nsicachevisitor visitor); attributes attribute type description cacheiotarget nsieventtarget the event target for cache i/o operation notifications.
nsICacheSession
ncopencacheentry(in acstring key, in nscacheaccessmode accessrequested, in nsicachelistener listener, [optional] in boolean nowait); void evictentries(); prbool isstorageenabled(); nsicacheentrydescriptor opencacheentry(in acstring key, in nscacheaccessmode accessrequested, in boolean blockingmode); void doomentry(in acstring key, in nsicachelistener listener); attributes attribute type description doomentriesifexpired prbool expired entries will be doomed or evicted if this attribute is set to true.
nsICachingChannel
method overview boolean isfromcache(); obsolete since gecko 2.0 attributes attribute type description cacheasfile boolean specifies whether or not the data should be cached to a file.
nsIClipboardDragDropHooks
inherits from: nsisupports last changed in gecko 1.7 embedders who want to have these hooks made available should implement nsiclipboarddragdrophooks and use the command manager to send the appropriate commands with these parameters/settings: command: cmd_clipboarddragdrophook params value type possible values "addhook" isupports nsiclipboarddragdrophooks as nsisupports "removehook" isupports nsiclipboarddragdrophooks as nsisupports note: overrides/hooks need to be added to each window (as appropriate).
nsICommandLineHandler
clh;1 command-line-handler m-edit @mozilla.org/composer/clh;1 command-line-handler m-irc @mozilla.org/chatzilla/clh;1 command-line-handler y-final @mozilla.org/browser/clh-final;1 method overview void handle(in nsicommandline acommandline); attributes attribute type description helpinfo autf8string when the application is launched with the -help argument, this attribute is retrieved and displayed to the user (on stdout).
nsIConsoleMessage
attributes attribute type description message wstring the message in a string format.
nsIContainerBoxObject
attributes attribute type description docshell nsidocshell read only.
nsIContentPref
nsicontentpref dom/interfaces/base/nsicontentprefservice2.idlscriptable a content preference 1.0 66 introduced gecko 20.0 inherits from: nsisupports last changed in gecko 20.0 (firefox 20.0 / thunderbird 20.0 / seamonkey 2.17) attributes attribute type description domain astring read only.
nsIContentPrefService2
if the preference is known not to exist, the value attribute of the returned object will be undefined (nsidatatype.vtype_void()).
nsIContentView
method overview void scrollby(in float dxpx, in float dypx); void scrollto(in float xpx, in float ypx); void setscale(in float xscale, in float yscale); attributes attribute type description contentheight float read only.
nsIContentViewManager
method overview void getcontentviewsin(in float axpx, in float aypx, in float atopsize, in float arightsize, in float abottomsize, in float aleftsize, [optional] out unsigned long alength, [retval, array, size_is(alength)] out nsicontentview aresult); attributes attribute type description rootcontentview nsicontentview the root content view.
nsIContentViewer
[noscript,notxpcom,nostdcall] void setnavigationtiming(in nsdomnavigationtimingptr atiming); void setpagemode(in boolean apagemode, in nsiprintsettings aprintsettings); void show(); void stop(); void unload(); obsolete since gecko 1.8 attributes attribute type description container nsisupports domdocument nsidomdocument enablerendering boolean obsolete since gecko 2.0 historyentry nsishentry get the history entry that this viewer will save itself into when destroyed.
nsIControllers
ong controllerid); unsigned long getcontrollercount(); nsicontroller getcontrollerforcommand(in string command); unsigned long getcontrollerid(in nsicontroller controller); void insertcontrollerat(in unsigned long index, in nsicontroller controller); void removecontroller(in nsicontroller controller); nsicontroller removecontrollerat(in unsigned long index); attributes attribute type description commanddispatcher nsidomxulcommanddispatcher obsolete since gecko 1.9 methods appendcontroller() adds a controller to the end of the list.
nsICookie
last changed in gecko 1.7 inherits from: nsisupports attributes attribute type description expires pruint64 expiration time in seconds since midnight (00:00:00), january 1, 1970 utc.
nsICookie2
last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsicookie attributes attribute type description creationtime print64 the creation time of the cookie, in microseconds since midnight (00:00:00), january 1, 1970 utc.
nsICrashReporter
attributes attribute type description enabled boolean enable or disable the crashreporter at runtime.
nsIDNSRecord
acstring getnextaddrasstring(); boolean hasmore(); void rewind(); attributes attribute type description canonicalname acstring for example, www.mozilla.org --> rheet.mozilla.org.
nsIDNSService
method overview nsicancelable asyncresolve(in autf8string ahostname, in unsigned long aflags, in nsidnslistener alistener, in nsieventtarget alistenertarget); void init(); obsolete since gecko 1.8 nsidnsrecord resolve(in autf8string ahostname, in unsigned long aflags); void shutdown(); obsolete since gecko 1.8 attributes attribute type description myhostname autf8string read only.
nsIDOMChromeWindow
n gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void beginwindowmove(in nsidomevent mousedownevent); void getattention(); void getattentionwithcyclecount(in long acyclecount); void maximize(); void minimize(); void notifydefaultbuttonloaded(in nsidomelement defaultbutton); void restore(); void setcursor(in domstring cursor); attributes attribute type description browserdomwindow nsibrowserdomwindow the related nsibrowserdomwindow instance which provides access to yet another layer of utility functions by chrome script.
nsIDOMElement
ibutenode(in nsidomattr oldattr) void removeattributens(in domstring namespaceuri, in domstring localname) void setattribute(in domstring name, in domstring value) nsidomattr setattributenode(in nsidomattr newattr) nsidomattr setattributenodens(in nsidomattr newattr) void setattributens(in domstring namespaceuri, in domstring qualifiedname, in domstring value) attributes attribute type description tagname domstring the element tag name.
nsIDOMFile
the nsidomfile interface retrieves data from a file submitted to a form using the input type "file".
nsIDOMFileException
last changed in gecko 1.9 (firefox 3) attributes attribute type description code unsigned short the error code describing the error condition that took place; see the constants list for details.
nsIDOMFontFaceList
1.0 66 introduced gecko 7.0 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) method overview nsidomfontface item(in unsigned long index); attributes attribute type description length unsigned long the number of items in the list.
nsIDOMGeoGeolocation
orcallback errorcallback, [optional] in nsidomgeopositionoptions options); unsigned short watchposition(in nsidomgeopositioncallback successcallback, [optional] in nsidomgeopositionerrorcallback errorcallback, [optional] in nsidomgeopositionoptions options); attributes attribute type description lastposition nsidomgeoposition the most recently retrieved location as seen by the provider.
nsIDOMGeoPosition
1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) attributes attribute type description address nsidomgeopositionaddress the address of the user's current location, if available.
nsIDOMGeoPositionCoords
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports attributes attribute type description latitude double the user's current latitude, in degrees.
nsIDOMGeoPositionError
last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports attributes attribute type description code short numerical error code; see error constants for a complete list.
nsIDOMGeoPositionOptions
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports attributes attribute type description enablehighaccuracy boolean if true, high accuracy mode is used.
nsIDOMHTMLTimeRanges
last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsisupports method overview float start(in unsigned long index); float end(in unsigned long index); attributes attribute type description length unsigned long the number of ranges represented by the nsidomhtmltimeranges object.
nsIDOMMozNetworkStats
to create an instance, use: var networkstatsmanager = components.classes["@mozilla.org/networkstats;1"] .createinstance(components.interfaces.nsidomnetworkstats); attributes attribute type description connectiontype domstring connection type of the stats.
nsIDOMMozNetworkStatsData
1.0 66 introduced gecko 18.0 inherits from: nsisupports last changed in gecko 18.0 (firefox 18.0 / thunderbird 18.0 / seamonkey 2.15) attributes attribute type description rxbytes unsigned long the number of bytes received on the connection.
nsIDOMNavigatorDesktopNotification
attributes attribute type description moznotification nsidomdesktopnotificationcenter read only.
nsIDOMOfflineResourceList
last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports method overview void mozadd(in domstring uri); boolean mozhasitem(in domstring uri); domstring mozitem(in unsigned long index); void mozremove(in domstring uri); void swapcache(); void update(); attributes attribute type description mozitems nsidomofflineresourcelist the list of dynamically-managed entries in the offline resource list.
nsIDOMStorage
method overview void clear(); domstring getitem(in domstring key); domstring key(in unsigned long index); void removeitem(in domstring key); void setitem(in domstring key, in domstring data); attributes attribute type description length unsigned long the number of keys stored in the session store.
nsIDOMStorage2
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview void clear(); domstring getitem(in domstring key); domstring key(in unsigned long index); void removeitem(in domstring key); void setitem(in domstring key, in domstring data); attributes attribute type description length unsigned long the number of keys stored in local storage.
nsIDOMStorageItem
attributes attribute type description secure boolean if true, the item was stored for an https page.
nsIDOMStorageWindow
attributes attribute type description globalstorage nsidomstoragelist global storage, accessible by domain.
nsIDOMUserDataHandler
void handle( in unsigned short operation, in domstring key, in nsivariant data, in nsidomnode src, in nsidomnode dst ); parameters operation one of the node_* operation type constants from the above table.
nsIDOMWindow2
attributes attribute type description applicationcache nsidomofflineresourcelist the application cache object for this window.
nsIDOMWindowInternal
boolean wholeword, [optional] in boolean searchinframes, [optional] in boolean showdialog) domstring atob(in domstring aasciistring) domstring btoa(in domstring abase64data) nsivariant showmodaldialog(in nsivariant aargs, [optional] in domstring aoptions) void postmessage(in domstring message, in domstring targetorigin) attributes attribute type description window nsidomwindowinternal readonly: the window object itself.
nsIDOMXULControlElement
66 introduced gecko 1.0 inherits from: nsidomxulelement last changed in gecko 1.0 attributes attribute type description disabled boolean indicates whether the element is disabled or not.
nsIDOMXULElement
introduced gecko 1.0 inherits from: nsidomelement last changed in gecko 1.9 (firefox 3) method overview void blur(); void click(); void docommand(); void focus(); nsidomnodelist getelementsbyattribute(in domstring name, in domstring value); nsidomnodelist getelementsbyattributens(in domstring namespaceuri, in domstring name, in domstring value); attributes attribute type description align domstring gets/sets the value of the element's align attribute.
nsIDOMXULLabeledControlElement
inherits from: nsidomxulcontrolelement last changed in gecko 1.7 attributes attribute type description accesskey domstring this should be set to a character that is used as a shortcut key.
nsIDOMXULSelectControlElement
trolitemelement appenditem(in domstring label, in domstring value); long getindexofitem(in nsidomxulselectcontrolitemelement item); nsidomxulselectcontrolitemelement getitematindex(in long index); nsidomxulselectcontrolitemelement insertitemat(in long index, in domstring label, in domstring value); nsidomxulselectcontrolitemelement removeitemat(in long index); attributes attribute type description itemcount unsigned long read only.
nsIDOMXULSelectControlItemElement
inherits from: nsidomxulelement last changed in gecko 1.7 attributes attribute type description accesskey domstring command domstring control nsidomxulselectcontrolelement read only.
nsIDebug2
xpcom/base/nsidebug2.idlscriptable adds access to additional information in debug builds of mozilla code by expanding upon the features in nsidebug 1.0 66 introduced gecko 1.9.2 inherits from: nsidebug last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) attributes attribute type description assertioncount long the number of assertions since process start.
nsIDialogCreator
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void opendialog(in unsigned long atype, in acstring aname, in acstring afeatures, in nsidialogparamblock aarguments, [optional] in nsidomelement aframeelement); constants constant value description unknown_dialog 0 generic_dialog 1 select_dialog 2 methods opendialog() void opendialog( in unsigned long atype, in acstring aname, in acstring afeatures, in nsidialogparamblock aarguments, in nsidomelement aframeelement optional ); parameters atype aname afeatures aarguments aframeelement optional ...
nsIDialogParamBlock
inherits from: nsisupports last changed in gecko 1.7 method overview print32 getint( in print32 inindex ); wstring getstring( in print32 inindex ); void setint( in print32 inindex, in print32 inint ); void setnumberstrings( in print32 innumstrings ); void setstring( in print32 inindex, in wstring instring); attributes attribute type description objects nsimutablearray a place where you can store an nsimutablearray to pass nsisupports.
nsIDirIndexParser
attributes attribute type description comment string the comment given, if any.
nsIDirectoryEnumerator
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void close(); attributes attribute type description nextfile nsifile the next file in the sequence.
nsIDirectoryIterator
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void init(in nsifilespec parent, in boolean resolvesymlink); boolean exist(); void next(); attributes attribute type description currentspec nsifilespec init() void init( in nsifilespec parent, in boolean resolvesymlink ); parameters parent resolvesymlink exist() boolean exists(); next() void next(); ...
nsIDirectoryServiceProvider2
inherits from: nsidirectoryserviceprovider last changed in gecko 0.9.6 method overview nsisimpleenumerator getfiles(in string prop); methods getfiles() the directory service calls this when it gets a request for a prop and the requested type is nsisimpleenumerator.
nsIDocumentLoader
obsolete since gecko 1.8 nsiloadgroup getloadgroup(); obsolete since gecko 1.8 boolean isbusy(); obsolete since gecko 1.8 void stop(); attributes attribute type description container nsisupports read only.
nsIDownloadHistory
there is a separate interface specifically for downloads in case embedders choose to track downloads differently from other types of history.
nsIDownloadManagerUI
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void getattention(); void show([optional] in nsiinterfacerequestor awindowcontext, [optional] in unsigned long aid, [optional] in short areason); attributes attribute type description visible boolean true if the download manager ui is visible; otherwise false.
nsIDownloadProgressListener
oad adownload); void onstatechange(in nsiwebprogress awebprogress, in nsirequest arequest, in unsigned long astateflags, in nsresult astatus, in nsidownload adownload); void onstatuschange(in nsiwebprogress awebprogress, in nsirequest arequest, in nsresult astatus, in wstring amessage, in nsidownload adownload); obsolete since gecko 1.9.1 attributes attribute type description document nsidomdocument document the document of the download manager frontend.
nsIEditorBoxObject
attributes attribute type description docshell nsidocshell read only.
nsIEditorDocShell
method overview void makeeditable(in boolean inwaitforuriload); attributes attribute type description editable boolean this docshell is editable.
nsIEditorIMESupport
obsolete since gecko 2.0 attributes attribute type description composing boolean whether this editor has active ime transaction.
nsIException
inherits from: nsisupports last changed in gecko 1.7 method overview string tostring(); attributes attribute type description columnnumber pruint32 valid column numbers begin at 0.
ExtensionManager (Toolkit)
examples here is how to retrive all the extensions installed: var em = cc['@mozilla.org/extensions/manager;1'] .getservice(ci.nsiextensionmanager); const nsiupdateitem = ci.nsiupdateitem; var extension_type = nsiupdateitem.type_extension; items = em.getitemlist(extension_type, {}); items.foreach(function(item, index, array) { alert(item.name + " / " + item.id + " version: " + item.version); }); ...
nsIFTPChannel
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports attributes attribute type description lastmodifiedtime prtime the time at which the ftp channel was last updated.
nsIFactory
xpcom/components/nsifactory.idlscriptable this interface is a class factory that allows for the creation of nsisupports derived classes without specifying a concrete class type.
nsIFeedElementBase
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) attributes attribute type description attributes nsisaxattributes all the attributes found on the element.
nsIFeedEntry
1.0 66 introduced gecko 1.8 inherits from: nsifeedcontainer last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) attributes attribute type description content nsifeedtextconstruct the full text of the entry's content.
nsIFeedGenerator
1.0 66 introduced gecko 1.8 inherits from: nsifeedelementbase last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) attributes attribute type description agent astring the name of the software that created the feed.
nsIFeedPerson
1.0 66 introduced gecko 1.8 inherits from: nsifeedelementbase last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) attributes attribute type description email astring the person's email address.
nsIFeedProcessor
mponents.classes["@mozilla.org/feed-processor;1"] .createinstance(components.interfaces.nsifeedprocessor); method overview void parseasync(in nsirequestobserver requestobserver, in nsiuri uri); void parsefromstream(in nsiinputstream stream, in nsiuri uri); void parsefromstring(in astring str, in nsiuri uri); attributes attribute type description listener nsifeedresultlistener the feed result listener that will respond to feed events.
nsIFeedProgressListener
note: if the feed type is one of the entry or item-only types, this event will never be called.
nsIFeedResult
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void registerextensionprefix(in astring anamespace, in astring aprefix); attributes attribute type description bozo boolean the feed processor sets the bozo bit when a feed triggers a fatal error during xml parsing.
nsIFileURL
inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) attributes attribute type description file nsifile get/set nsifile corresponding to this url.
nsIFormHistory2
hod overview void addentry(in astring name, in astring value); boolean entryexists(in astring name, in astring value); boolean nameexists(in astring name); void removeallentries(); void removeentriesbytimeframe(in long long abegintime, in long long aendtime); void removeentriesforname(in astring name); void removeentry(in astring name, in astring value); attributes attribute type description dbconnection mozistorageconnection returns the underlying db connection the form history module is using.
nsIFrameLoaderOwner
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview [noscript, notxpcom] alreadyaddrefed_nsframeloader getframeloader(); void swapframeloaders(in nsiframeloaderowner aotherowner); attributes attribute type description frameloader nsiframeloader the frame loader owned by this nsiframeloaderowner.
nsIHttpChannelInternal
.0 / seamonkey 2.3) method overview void getrequestversion(out unsigned long major, out unsigned long minor); void getresponseversion(out unsigned long major, out unsigned long minor); void httpupgrade(in acstring aprotocolname, in nsihttpupgradelistener alistener); void setcookie(in string acookieheader); void setupfallbackchannel(in string afallbackkey); attributes attribute type description canceled boolean returns true if and only if the channel has been canceled.
nsIIFrameBoxObject
attributes attribute type description docshell nsidocshell read only.
nsIIdleService
to create an instance, use: var idleservice = components.classes["@mozilla.org/widget/idleservice;1"] .getservice(components.interfaces.nsiidleservice); method overview void addidleobserver(in nsiobserver observer, in unsigned long time); void removeidleobserver(in nsiobserver observer, in unsigned long time); attributes attribute type description idletime unsigned long the amount of time in milliseconds that has passed since the last user activity.
nsIInstallLocation
installlocation("add-on id") method overview astring getidforlocation(in nsifile file); nsifile getitemfile(in astring id, in astring path); nsifile getitemlocation(in astring id); nsifile getstagefile(in astring id); boolean itemismanagedindependently(in astring id); void removefile(in nsifile file); nsifile stagefile(in nsifile file, in astring id); attributes attribute type description canaccess boolean whether or not the user can write to the install location with the current access privileges.
nsIJSID
method overview boolean equals(in nsijsid other); const nsid* getid(); violates the xpcom interface guidelines void initialize(in string idstring); string tostring(); attributes attribute type description id nsidptr read only.
nsILocale
nsilocale_ctype - character classification and case conversion.
nsILoginInfo
w nsilogininfo clone(); boolean equals(in nsilogininfo alogininfo); void init(in astring ahostname, in astring aformsubmiturl, in astring ahttprealm, in astring ausername, in astring apassword, in astring ausernamefield, in astring apasswordfield); boolean matches(in nsilogininfo alogininfo, in boolean ignorepassword); attributes attribute type description formsubmiturl astring the origin, not url, a form-based login was submitted to.
Using nsILoginManager
, usernamefield, passwordfield ); examples creating a login for a web page var formlogininfo = new nslogininfo( 'http://www.example.com', 'http://login.example.com', null, 'joe', 'secret123', 'uname', 'pword' ); this login would correspond to a html form such as: <form action="http://login.example.com/foo/authenticate.cgi"> <div>please log in.</div> <label>username:</label> <input type="text" name="uname"> <label>password:</label> <input type="password" name="pword"> </form> creating a site authentication login var authlogininfo = new nslogininfo( 'http://www.example.com', null, 'exampleco login', 'alice', 'secret321', "", "" ); this would correspond to a login on http://www.example.com when the server sends a reply such as: http/1.0 401 authorization required s...
nsILoginManagerCrypto
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview astring decrypt(in astring ciphertext); astring encrypt(in astring plaintext); attributes attribute type description isloggedin boolean current login state of the token used for encryption.
nsILoginManagerStorage
in nsifile aoutputfile); void modifylogin(in nsilogininfo oldlogin, in nsisupports newlogindata); void removealllogins(); 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); attributes attribute type description uibusy boolean true when a master password prompt is being shown.
nsILoginMetaInfo
attributes attribute type description guid astring the guid to uniquely identify the login.
nsIMemoryMultiReporter
attributes attribute type description explicitnonheap print64 the sum of all of this multi-reporter's measurements that have a path that starts with "explicit" and are of the kind kind_nonheap.
nsIMemoryReporterManager
reporters(); void init(); void registermultireporter(in nsimemorymultireporter reporter); void registerreporter(in nsimemoryreporter reporter); void unregistermultireporter(in nsimemorymultireporter reporter); void unregisterreporter(in nsimemoryreporter reporter); attributes attribute type description explicit print64 gets the total size of explicit memory allocations, both at the operating system level (for example, via mmap, virtualalloc) and at the heap level (for example, via malloc(), calloc(), operator new).
nsIMenuBoxObject
s last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) to get access to the box object for a given menu, use code like this: var boxobject = xulmenu.boxobject.queryinterface(components.interfaces.nsimenuboxobject); method overview boolean handlekeypress(in nsidomkeyevent keyevent); void openmenu(in boolean openflag); attributes attribute type description activechild nsidomelement the currently active menu or menuitem child of the menu box.
nsIMessageSender
parameters name type description messagename string the name of the message.
nsIMicrosummary
anged in gecko 1.9 (firefox 3) warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void addobserver(in nsimicrosummaryobserver observer); boolean equals(in nsimicrosummary aother); void removeobserver(in nsimicrosummaryobserver observer); void update(); attributes attribute type description content astring the content of the microsummary.
nsIMicrosummaryGenerator
0 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview long calculateupdateinterval(in nsidomnode apagecontent); boolean equals(in nsimicrosummarygenerator aother); astring generatemicrosummary(in nsidomnode apagecontent); attributes attribute type description loaded boolean has the generator itself (which may be a remote resource) been loaded.
nsIMimeHeaders
r mimeheaders = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsimimeheaders); method overview string extractheader([const] in string headername, in boolean getallofthem); void initialize([const] in string allheaders, in long allheaderssize); attributes attribute type description allheaders string read only.
nsIMsgAccount
inherits from: nsisupports last changed in gecko 1.7 method overview void addidentity(in nsimsgidentity identity); void clearallvalues(); void init(); void removeidentity(in nsimsgidentity identity); astring tostring(); attributes attribute type description defaultidentity nsimsgidentity identities nsisupportsarray read only.
nsIMsgAccountManagerExtension
inherits from: nsisupports method overview boolean showpanel(in nsimsgincomingserver server); attributes attribute type description name acstring name of the account manager extension.
nsIMsgSearchValue
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgsearchvalue.idl #include "nsmsgsearchcore.idl" interface nsimsgfolder; [scriptable, uuid(783758a0-cdb5-11dc-95ff-0800200c9a66)] interface nsimsgsearchvalue : nsisupports { // type of object attribute nsmsgsearchattribvalue attrib; // accessing these will throw an exception if the above // attribute does not match the type!
nsIMsgSendLater
.getservice(components.interfaces.nsimsgsendlater); method overview void sendunsentmessages(in nsimsgidentity identity); void removelistener(in nsimsgsendlaterlistener listener); void addlistener(in nsimsgsendlaterlistener listener); nsimsgfolder getunsentmessagesfolder](in nsimsgidentity identity); attributes attribute type description msgwindow nsimsgwindow methods sendunsentmessages() sends all unsent messages for an identity.
nsIMsgThread
rat(in long index); nsimsgdbhdr getroothdr(out long index); void removechildat(in long index); void removechildhdr(in nsimsgdbhdr child, in nsidbchangeannouncer announcer); void markchildread(in boolean bread); nsimsgdbhdr getfirstunreadchild(); nsisimpleenumerator enumeratemessages(in nsmsgkey parent); attributes attribute type description threadkey nsmsgkey unsigned long key designating this thread.
nsIMsgWindow
method overview void displayhtmlinmessagepane(in astring title, in astring body, in boolean clearmsghdr); void stopurls(); void closewindow(); attributes attribute type description windowcommands nsimsgwindowcommands this allows the backend code to send commands to the ui, such as clearmsgpane.
nsINavHistoryResult
method overview void addobserver(in nsinavhistoryresultobserver aobserver, in boolean aownsweak); void removeobserver(in nsinavhistoryresultobserver aobserver); attributes attribute type description root nsinavhistorycontainerresultnode the root of the results.
nsINavHistoryResultTreeViewer
method overview nsinavhistoryresultnode nodefortreeindex(in unsigned long aindex); unsigned long treeindexfornode(in nsinavhistoryresultnode anode); attributes attribute type description collapseduplicates boolean controls whether duplicate adjacent elements are collapsed into a single item in the tree.
nsINavHistoryResultViewer
void nodereplaced(in nsinavhistorycontainerresultnode parent, in nsinavhistoryresultnode olditem, in nsinavhistoryresultnode newitem, in unsigned long index); void nodeinserted(in nsinavhistorycontainerresultnode aparent, in nsinavhistoryresultnode anode , in unsigned long anewindex); void sortingchanged(in unsigned short sortingmode); attributes attribute type description result nsinavhistoryresult the nsinavhistoryresult this viewer monitors.
nsIPasswordManager
.getservice(components.interfaces.nsipasswordmanager); method overview void adduser(in autf8string ahost, in astring auser, in astring apassword); void removeuser(in autf8string ahost, in astring auser); void addreject(in autf8string ahost); void removereject(in autf8string ahost); attributes attribute type description enumerator nsisimpleenumerator readonly: an enumeration of the stored usernames and passwords as nsipassword objects.
nsIPipe
inherits from: nsisupports last changed in gecko 1.6 method overview void init(in boolean nonblockinginput, in boolean nonblockingoutput, in unsigned long segmentsize, in unsigned long segmentcount, in nsimemory segmentallocator); attributes attribute type description inputstream nsiasyncinputstream the pipe's input end, which also implements nsisearchableinputstream.
nsIPlacesView
method overview nsinavhistoryresultnode[] getdragableselection(); nsinavhistoryresultnode[][] getremovableselectionranges(); nsinavhistoryresult getresult(); nsinavhistorycontainerresultnode getresultnode(); nsinavhistoryresultnode[] getselectionnodes(); void selectall(); attributes attribute type description hasselection boolean whether or not there are selected items.
nsIPrefLocalizedString
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void setdatawithlength(in unsigned long length, [size_is(length)] in wstring data); wstring tostring(); attributes attribute type description data wstring provides access to string data stored in this property.
nsIPrincipal
boolean subsumes(in nsiprincipal other); attributes attribute type description certificate nsisupports the certificate associated with this principal, if any.
nsIPrinterEnumerator
void displaypropertiesdlg(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.
nsIPrivateBrowsingService
method overview void removedatafromdomain(in autf8string adomain); attributes attribute type description autostarted boolean indicates whether or not private browsing was started automatically at application launch time.
nsIProcess
n unsigned long count, [optional] in nsiobserver observer, [optional] in boolean holdweak); void runw(in boolean blocking, [array, size_is(count)] in wstring args, in unsigned long count); void runwasync([array, size_is(count)] in wstring args, in unsigned long count, [optional] in nsiobserver observer, [optional] in boolean holdweak); attributes attribute type description exitvalue long the value returned by the process upon exit.
nsIProfileLock
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void unlock(); attributes attribute type description directory nsilocalfile the main profile directory.
nsIProperty
inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description name astring get the name of the property.
nsIPropertyElement
inherits from: nsisupports last changed in gecko 1.0 attributes attribute type description key autf8string the key used to refer to this property.
nsIPushSubscription
method overview void getkey(in domstring name, [optional] out uint32_t keylen, [array, size_is(keylen), retval] out uint8_t key); bool quotaapplies(); bool isexpired(); attributes attribute type description endpoint domstring the subscription url.
nsIRequest
method overview void cancel(in nsresult astatus); boolean ispending(); void resume(); void suspend(); attributes attribute type description loadflags nsloadflags the load flags of this request.
nsIResumableChannel
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void asyncopenat(in nsistreamlistener listener, in nsisupports ctxt, in unsigned long startpos, in nsiresumableentityid entityid); obsolete since gecko 1.8 void resumeat(in unsigned long long startpos, in acstring entityid); attributes attribute type description entityid acstring the entity id for this uri.
nsIRunnable
nsirunnable is generated from nsirunnable.idl here is the prototype of nsirunnable.idl /** * represents a task which can be dispatched to a thread for execution.
nsISOCKSSocketInfo
inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description destinationaddr prnetaddrptr the destination server address.
nsISSLSocketControl
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void proxystartssl(); void starttls(); attributes attribute type description forcehandshake boolean obsolete since gecko 1.9 notificationcallbacks nsiinterfacerequestor methods proxystartssl() starts an ssl proxy connection.
nsIScreen
omponents.interfaces.nsiscreen); method overview void getavailrect(out long left, out long top, out long width, out long height); void getrect(out long left, out long top, out long width, out long height); void lockminimumbrightness(in unsigned long brightness); void unlockminimumbrightness(in unsigned long brightness); attributes attribute type description colordepth long the screen's color depth; this is the number of bits used to represent a color.
nsIScriptError2
method overview void initwithwindowid(in wstring message, in wstring sourcename, in wstring sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in string category, in unsigned long long innerwindowid); attributes attribute type description innerwindowid unsigned long long the inner window id with which the error is associated.
nsIScriptableInputStream
note: it is also important to consider how a language bindings may interpret the string data type.
nsIScriptableUnicodeConverter
astring converttounicode(in acstring asrc); astring convertfrombytearray([const,array,size_is(acount)] in octet adata, in unsigned long acount); void converttobytearray(in astring astring,[optional] out unsigned long alen,[array, size_is(alen),retval] out octet adata); nsiinputstream converttoinputstream(in astring astring); attributes attribute type description charset string current character set.
nsIScrollable
this is a generic interface without concern for the type of content that may be inside.
nsISearchSubmission
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) attributes attribute type description postdata nsiinputstream the post data associated with a search submission, wrapped in a mime input stream.
nsISecurityCheckedComponent
for example, this capability allows code to set the value of <input type="file"> and access an arbitrary file on disk.
nsISelection
idomrange getrangeat(in long index); void modify(in domstring alter, in domstring direction, in domstring granularity); void removeallranges(); void removerange(in nsidomrange range); void selectallchildren(in nsidomnode parentnode); void selectionlanguagechange(in boolean langrtl); domstring tostring(); attributes attribute type description anchornode nsidomnode returns the node in which the selection begins.
nsISelection2
void scrollintoview(in short aregion, in boolean aissynchronous, in short avpercent, in short ahpercent); attributes attribute type description type short returns the type of the selection (see nsiselectioncontroller for available constants).
nsIServerSocket
attributes attribute type description port long returns the port of this server socket.
nsISessionStore
astringvalue); void setwindowstate(in nsidomwindow awindow, in astring astate, in boolean aoverwrite); void setwindowvalue(in nsidomwindow awindow, in astring akey, in astring astringvalue); nsidomnode undoclosetab(in nsidomwindow awindow, in unsigned long aindex); nsidomwindow undoclosewindow(in unsigned long aindex); attributes attribute type description canrestorelastsession boolean is it possible to restore the previous session.
nsIStackFrame
inherits from: nsisupports last changed in gecko 1.7 method overview string tostring(); attributes attribute type description caller nsistackframe read only.
nsIStructuredCloneContainer
method overview nsivariant deserializetovariant(); astring getdataasbase64(); void initfrombase64(in astring adata,in unsigned long aformatversion); void initfromvariant(in nsivariant adata); attributes attribute type description formatversion unsigned long get the version of the structured clone algorithm which was used to generate this container's serialized buffer.
nsISupports
queryinterface() the queryinterface method provides runtime type discovery.
nsISupportsCString
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data acstring provides access to the native type represented by the object.
nsISupportsChar
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data char provides access to the native type represented by the object.
nsISupportsDouble
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data double provides access to the native type represented by the object.
nsISupportsFloat
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data float provides access to the native type represented by the object.
nsISupportsID
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data nsidptr provides access to the native type represented by the object.
nsISupportsInterfacePointer
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data nsisupports provides access to the native type represented by the object.
nsISupportsPRBool
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data prbool provides access to the native type represented by the object.
nsISupportsPRInt16
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data print16 provides access to the native type represented by the object.
nsISupportsPRInt32
66 introduced gecko 1.0 inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data print32 provides access to the native type represented by the object.
nsISupportsPRInt64
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data print64 provides access to the native type represented by the object.
nsISupportsPRTime
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data prtime provides access to the native type represented by the object.
nsISupportsPRUint16
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data pruint16 provides access to the native type represented by the object.
nsISupportsPRUint32
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data pruint32 provides access to the native type represented by the object.
nsISupportsPRUint64
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data pruint64 provides access to the native type represented by the object.
nsISupportsPRUint8
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data pruint8 provides access to the native type represented by the object.
nsISupportsPriority
method overview void adjustpriority(in long delta); attributes attribute type description priority long the object's priority.
nsISupportsString
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data astring provides access to the native type represented by the object.
nsISupportsVoid
inherits from: nsisupportsprimitive last changed in gecko 1.0 method overview string tostring(); attributes attribute type description data voidptr this attribute provides access to the native type represented by the object.
nsITaggingService
overview void taguri(in nsiuri auri, in nsivariant atags); void untaguri(in nsiuri auri, in nsivariant atags); nsivariant geturisfortag(in astring atag); nsivariant gettagsforuri(in nsiuri auri, [optional] out unsigned long length, [retval, array, size_is(length)] out wstring atags); attributes attribute type description alltags nsivariant retrieves all tags used to tag uris in the data-base (sorted by name).
nsITaskbarPreview
method overview void invalidate(); attributes attribute type description active boolean indicates whether or not the preview is marked as active (currently selected) in the taskbar.
nsITaskbarPreviewButton
attributes attribute type description disabled boolean if true, the button is disabled.
nsITaskbarPreviewController
method overview boolean drawpreview(in nsidomcanvasrenderingcontext2d ctx); boolean drawthumbnail(in nsidomcanvasrenderingcontext2d ctx, in unsigned long width, in unsigned long height); boolean onactivate(); void onclick(in nsitaskbarpreviewbutton button); void onclose(); attributes attribute type description height unsigned long the height in pixels of the preview image.
nsITaskbarTabPreview
method overview void ensureregistration(); violates the xpcom interface guidelines nativewindow gethwnd(); violates the xpcom interface guidelines void move(in nsitaskbartabpreview anext); attributes attribute type description icon imgicontainer the icon displayed next to the title in the preview.
nsITaskbarWindowPreview
method overview nsitaskbarpreviewbutton getbutton(in unsigned long index); attributes attribute type description enablecustomdrawing boolean if true, the nsitaskbarpreviewcontroller object's nsitaskbarpreviewcontroller.drawpreview() and nsitaskbarpreviewcontroller.drawthumbnail() methods will be called to draw the preview.
nsITextInputProcessorCallback
example of simple js-ime: var simpleime = { _hasfocus: false, _hasrightstocompose: false, _tip: null, _callback: function simpleime_callback(atip, anotification) { try { switch (anotification.type) { case "request-to-commit": atip.commitcomposition(); break; case "request-to-cancel": atip.cancelcomposition(); break; case "notify-focus": this._hasfocus = true; break; case "notify-blur": this._hasfocus = false; break; case "notify-detached": this._hasfocus = false...
nsIThread
last changed in gecko 1.9 (firefox 3) inherits from: nsieventtarget method overview void shutdown() boolean haspendingevents() boolean processnextevent(in boolean maywait) attributes attribute type description prthread prthread the nspr thread object corresponding to the nsithread.
nsIThreadInternal
last changed in gecko 1.9 (firefox 3) inherits from: nsithread method overview void popeventqueue(); void pusheventqueue(in nsithreadeventfilter filter); attributes attribute type description observer nsithreadobserver get/set the current thread observer; set to null to disable observing.
nsIThreadManager
nsithread newthread(in unsigned long creationflags); attributes attribute type description currentthread nsithread the currently executing thread.
nsIThreadPool
method overview void shutdown(); attributes attribute type description idlethreadlimit unsigned long get/set the maximum number of idle threads that are kept alive.
nsIToolkitProfile
method overview nsiprofilelock lock(out nsiprofileunlocker aunlocker); void remove(in boolean removefiles); attributes attribute type description localdir nsilocalfile the location of the profile local directory, which may be the same as the root directory.
nsIToolkitProfileService
method overview nsitoolkitprofile createprofile(in nsilocalfile arootdir, in autf8string aname); void flush(); nsitoolkitprofile getprofilebyname(in autf8string aname); nsiprofilelock lockprofilepath(in nsilocalfile adirectory, in nsilocalfile atempdirectory); attributes attribute type description profilecount unsigned long the number of user profiles currently in existence.
nsITraceableChannel
this.responsebody; // we'll set this to the this.responsestatuscode; this.deferreddone = { promise: null, resolve: null, reject: null }; this.deferreddone.promise = new promise(function(resolve, reject) { this.resolve = resolve; this.reject = reject; }.bind(this.deferreddone)); object.freeze(this.deferreddone); this.promisedone = this.deferreddone.promise; } tracinglistener.prototype = { ondataavailable: function(arequest, acontext, ainputstream, aoffset, acount) { var istream = new binaryinputstream(ainputstream) // binaryainputstream var sstream = new storagestream(8192, acount, null); // storagestream // not sure why its 8192 but thats how eveyrone is doing it, we should ask why var ostream = new binaryoutputstream(sstream.getoutputstream(0)); // binaryoutputstream ...
nsITransaction
inherits from: nsisupports last changed in gecko 1.7 method overview void dotransaction(); boolean merge(in nsitransaction atransaction); void redotransaction(); void undotransaction(); attributes attribute type description istransient boolean the transaction's transient state.
nsITransactionList
inherits from: nsisupports last changed in gecko 1.7 method overview nsitransactionlist getchildlistforitem(in long aindex); nsitransaction getitem(in long aindex); long getnumchildrenforitem(in long aindex); boolean itemisbatch(in long aindex); attributes attribute type description numitems long the number of transactions contained in this list.
nsITransactionManager
listener); void beginbatch(); void clear(); void dotransaction(in nsitransaction atransaction); void endbatch(); nsitransactionlist getredolist(); nsitransactionlist getundolist(); nsitransaction peekredostack(); nsitransaction peekundostack(); void redotransaction(); void removelistener(in nsitransactionlistener alistener); void undotransaction(); attributes attribute type description maxtransactioncount long sets the maximum number of transaction items the transaction manager will maintain at any time.
nsITransportSecurityInfo
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) attributes attribute type description errormessage wstring error message on connection failure.
nsITreeBoxObject
orcellitem(in long row, in nsitreecolumn col, in acstring element, out long x, out long y, out long width, out long height); boolean iscellcropped(in long row, in nsitreecolumn col); void rowcountchanged(in long index, in long count); void beginupdatebatch(); void endupdatebatch(); void clearstyleandimagecaches(); attributes attribute type description columns nsitreecolumns readonly: obtain the columns.
nsITreeColumns
nsitreecolumn getcolumnat(in long index); nsitreecolumn getcolumnfor(in nsidomelement element); nsitreecolumn getfirstcolumn(); nsitreecolumn getkeycolumn(); nsitreecolumn getlastcolumn(); nsitreecolumn getnamedcolumn(in astring id); nsitreecolumn getprimarycolumn(); nsitreecolumn getsortedcolumn(); void invalidatecolumns(); void restorenaturalorder(); attributes attribute type description count long the number of columns.
nsITreeContentView
last changed in gecko 1.8.0 inherits from: nsisupports method overview long getindexofitem(in nsidomelement item); nsidomelement getitematindex(in long index); attributes attribute type description root nsidomelement the element in the dom which this view uses as root content.
nsITreeSelection
void invalidateselection(); void invertselection(); boolean isselected(in long index); void rangedselect(in long startindex, in long endindex, in boolean augment); void select(in long index); void selectall(); void timedselect(in long index, in long delay); void toggleselect(in long index); attributes attribute type description count long the number of rows currently selected in this tree.
nsIURI
sword @ hostname : portnumber /pathname?query=value #ref method overview nsiuri clone(); nsiuri cloneignoringref(); boolean equals(in nsiuri other); boolean equalsexceptref(in nsiuri other); autf8string resolve(in autf8string relativepath); boolean schemeis(in string scheme); attributes attribute type description asciihost acstring the uri host with an ascii compatible encoding.
nsIURIFixupInfo
inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description consumer nsisupports consumer that asked for the fixed up uri.
nsIURL
l); try { var myurl = myuri.queryinterface(components.interfaces.nsiurl); } catch(e) { // the uri is not an url } or using instanceof: if (myuri instanceof components.interfaces.nsiurl) { // your code here } method overview autf8string getcommonbasespec(in nsiuri auritocompare); autf8string getrelativespec(in nsiuri auritocompare); attributes attribute type description directory autf8string directory portion of a url.
nsIUpdateManager
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview nsiupdate getupdateat(in long index); void saveupdates(); attributes attribute type description activeupdate nsiupdate an nsiupdate object describing the currently in use update.
nsIUserInfo
attributes attribute type description linux mac osx os/2 windows domain string read only.
nsIWebBrowserFind
method overview boolean findnext(); attributes attribute type description entireword boolean whether to match entire words only.
nsIWebBrowserFindInFrames
attributes attribute type description currentsearchframe nsidomwindow frame at which to start the search.
nsIWifiAccessPoint
1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) attributes attribute type description mac acstring the wifi access point's mac address.
nsIWinAppHelper
method overview void fixreg(); obsolete since gecko 1.9 void postupdate(in nsilocalfile logfile); obsolete since gecko 1.9.2 attributes attribute type description usercanelevate boolean read only.
nsIWinTaskbar
nsijumplistbuilder createjumplistbuilder(); nsitaskbartabpreview createtaskbartabpreview(in nsidocshell shell, in nsitaskbarpreviewcontroller controller); nsitaskbarprogress gettaskbarprogress(in nsidocshell shell); nsitaskbarwindowpreview gettaskbarwindowpreview(in nsidocshell shell); void setgroupidforwindow(in nsidomwindow aparent, in astring aidentifier); attributes attribute type description available boolean returns true if the operating system supports windows 7 or later taskbar features; you can use this instead of in-place operating system version checking.
nsIWindowsShellService
inherits from: nsishellservice last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview string getregistryentry(in long ahkeyconstant, in string asubkeyname, in string avaluename); obsolete since gecko 1.8 void restorefilesettings(in boolean aforallusers); obsolete since gecko 1.9 void shortcutmaintenance(); attributes attribute type description desktopbackgroundcolor unsigned long the desktop background color, visible when no background image is used, or if the background image is centered and does not fill the entire screen.
nsIWorker
method overview void postmessage(in domstring amessage, [optional] in nsiworkermessageport amessageport); attributes attribute type description onmessage nsidomeventlistener an object to receive notifications when messages are received on the worker's message port.
nsIWorkerGlobalScope
1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) attributes attribute type description location nsiworkerlocation read only.
nsIWorkerScope
1.0 66 introduced gecko 1.9.1 inherits from: nsiworkerglobalscope last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void postmessage(in domstring amessage, [optional] in nsiworkermessageport amessageport); void close(); attributes attribute type description onclose nsidomeventlistener a listener object to be called when the worker stops running.
nsIXMLHttpRequestEventTarget
1.0 66 introduced gecko 1.9.1 inherits from: nsidomeventtarget last changed in gecko 5.0 (firefox 5.0 / thunderbird 5.0 / seamonkey 2.2) attributes attribute type description onabort nsidomeventlistener a javascript function object that gets invoked if the operation is canceled by the user.
nsIXMLHttpRequestUpload
1.0 66 introduced gecko 1.9.1 inherits from: nsidomeventtarget last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) attributes attribute type description onabort nsidomeventlistener onerror nsidomeventlistener onload nsidomeventlistener onloadstart nsidomeventlistener onprogress nsidomeventlistener see also nsixmlhttprequest nsixmlhttprequesteventtarget xmlhttprequest using xmlhttprequest ...
nsIXPCException
js/src/xpconnect/idl/xpcexception.idlscriptable these exception objects are the preferred types of exceptions when implementing xpcom interfaces in javascript.
nsIXSLTException
inherits from: nsiexception last changed in gecko 1.7 attributes attribute type description sourcenode nsidomnode the context node, may be null.
nsIXULAppInfo
attributes attribute type description appbuildid acstring the application's build id/date, for example "2004051604".
nsIXmlRpcFault
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void init(in print32 faultcode, in string faultsring); string tostring(); attributes attribute type description faultcode print32 read only.
nsIZipEntry
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) attributes attribute type description compression unsigned short the type of compression used for the item.
nsIZipReader
file zipfile); obsolete since gecko 1.9 void open(in nsifile zipfile); void openinner(in nsizipreader zipreader, in autf8string zipentry); void openinner(in nsizipreader zipreader, in string zipentry); obsolete since gecko 10 void test(in autf8string aentryname); void test(in string aentryname); obsolete since gecko 10 attributes attribute type description file nsifile the file that represents the zip with which this zip reader was initialized.
nsIZipWriter
aqueue); void close(); nsizipentry getentry(in autf8string azipentry); boolean hasentry(in autf8string azipentry); void open(in nsifile afile, in print32 aioflags); void processqueue(in nsirequestobserver aobserver, in nsisupports acontext); void removeentry(in autf8string azipentry, in boolean aqueue); attributes attribute type description comment acstring gets or sets the comment associated with the currently open zip file.
nsMsgFilterFileAttribValue
lnews/ base/ search/ public/ nsimsgfilterlist.idl const nsmsgfilterfileattribvalue attribnone = 0; const nsmsgfilterfileattribvalue attribversion = 1; const nsmsgfilterfileattribvalue attriblogging = 2; const nsmsgfilterfileattribvalue attribname = 3; const nsmsgfilterfileattribvalue attribenabled = 4; const nsmsgfilterfileattribvalue attribdescription = 5; const nsmsgfilterfileattribvalue attribtype = 6; const nsmsgfilterfileattribvalue attribscriptfile = 7; const nsmsgfilterfileattribvalue attribaction = 8; const nsmsgfilterfileattribvalue attribactionvalue = 9; const nsmsgfilterfileattribvalue attribcondition = 10; const nsmsgfilterfileattribvalue attribcustomid = 11; ...
nsMsgJunkStatus
defined in comm-central/ mailnews/ base/ public/ mailnewstypes2.idl typedef unsigned long nsmsgjunkstatus; typedef unsigned long nsmsgjunkscore; ...
nsMsgKey
defined in comm-central/ mailnews/ base/ public/ mailnewstypes2.idl typedef unsigned long nsmsgkey; ...
nsMsgLabelValue
defined in comm-central/ mailnews/ base/ public/ mailnewstypes2.idl typedef unsigned long nsmsglabelvalue; ...
nsMsgPriorityValue
defined in comm-central/ mailnews/ base/ public/ mailnewstypes2.idl typedef long nsmsgpriorityvalue; [scriptable, uuid(94c0d8d8-2045-11d3-8a8f-0060b0fc04d2)] interface nsmsgpriority { const nsmsgpriorityvalue notset = 0; const nsmsgpriorityvalue none = 1; const nsmsgpriorityvalue lowest = 2; const nsmsgpriorityvalue low = 3; const nsmsgpriorityvalue normal = 4; const nsmsgpriorityvalue high = 5; const nsmsgpriorityvalue highest = 6; // the default for a priority picker const nsmsgpriorityvalue default = 4; }; ...
nsMsgSearchAttrib
defined in comm-central/ mailnews/ base/ search/ public/ nsmsgsearchcore.idl typedef long nsmsgsearchattribvalue; /** * definitions of search attribute types.
nsMsgSearchOp
defined in comm-central/ mailnews/ base/ search/ public/ nsmsgsearchcore.idl typedef long nsmsgsearchopvalue; [scriptable, uuid(9160b196-6fcb-4eba-aaaf-6c806c4ee420)] interface nsmsgsearchop { const nsmsgsearchopvalue contains = 0; /* for text attributes */ const nsmsgsearchopvalue doesntcontain = 1; const nsmsgsearchopvalue is = 2; /* is and isn't also apply to some non-text attrs */ const nsmsgsearchopvalue isnt = 3; const nsmsgsearchopvalue isempty = 4; const nsmsgsearchopvalue isbefore = 5; /* for date attributes */ const nsmsgsearchopvalue isafter = 6; const nsmsgsearchopvalue ishigherthan = 7; /* for priority.
nsMsgSearchValue
defined in comm-central/ mailnews/ base/ search/ public/ nsmsgsearchcore.idl use this to specify the value of a search term [ptr] native nsmsgsearchvalue(nsmsgsearchvalue); %{c++ typedef struct nsmsgsearchvalue { nsmsgsearchattribvalue attribute; union { nsmsgpriorityvalue priority; prtime date; pruint32 msgstatus; /* see msg_flag in msgcom.h */ pruint32 size; nsmsgkey key; print32 age; /* in days */ nsimsgfolder *folder; nsmsglabelvalue label; pruint32 junkstatus; pruint32 junkpercent; } u; char *string; } nsmsgsearchvalue; ...
nsMsgSearchWidgetValue
defined in comm-central/ mailnews/ base/ search/ public/ nsmsgsearchcore.idl fes use this to help build the search dialog box typedef long nsmsgsearchwidgetvalue; /* fes use this to help build the search dialog box */ [scriptable,uuid(903dd2e8-304e-11d3-92e6-00a0c900d445)] interface nsmsgsearchwidget { const nsmsgsearchwidgetvalue text = 0; const nsmsgsearchwidgetvalue date = 1; const nsmsgsearchwidgetvalue menu = 2; const nsmsgsearchwidgetvalue int = 3; /* added to account for age in days which requires an integer field */ const nsmsgsearchwidgetvalue none = 4; }; ...
XPCOM Interface Reference by grouping
tils nsidynamiccontainer nsieditor event nsidomevent nsidomeventgroup nsidomeventlistener nsidomeventtarget nsidommousescrollevent nsidommoztouchevent nsidomorientationevent nsidomprogressevent nsidomsimplegestureevent nsidragdrophandler nsidragservice nsidragsession html nsiaccessibilityservice nsiaccessiblecoordinatetype nsiaccessibledocument nsiaccessibleeditabletext nsiaccessibleevent nsiaccessiblehyperlink nsiaccessiblehypertext nsiaccessibleimage nsiaccessibleprovider nsiaccessibleretrieval nsiaccessiblerole nsiaccessiblescrolltype nsiaccessibleselectable nsiaccessiblestates nsiaccessibletable nsiaccessibletext nsiaccessibletreecache nsiaccessib...
nsIMsgSearchValue
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgsearchvalue.idl #include "nsmsgsearchcore.idl" interface nsimsgfolder; [scriptable, uuid(783758a0-cdb5-11dc-95ff-0800200c9a66)] interface nsimsgsearchvalue : nsisupports { // type of object attribute nsmsgsearchattribvalue attrib; // accessing these will throw an exception if the above // attribute does not match the type!
nsICookie2 MOZILLA 1 8 BRANCH
last changed in gecko 1.9 (firefox 3) inherits from: nsicookie2 attributes attribute type description ishttponly boolean holds true if the cookie is an http only cookie.
nsMsgSearchOpValue
nsmsgsearchopvalue defined in comm-central/ mailnews/ base/ search/ public/ nsmsgsearchcore.idl 146 typedef long nsmsgsearchopvalue; 147 148 [scriptable, uuid(9160b196-6fcb-4eba-aaaf-6c806c4ee420)] 149 interface nsmsgsearchop { 150 const nsmsgsearchopvalue contains = 0; /* for text attributes */ 151 const nsmsgsearchopvalue doesntcontain = 1; 152 const nsmsgsearchopvalue is = 2; /* is and isn't also apply to some non-text attrs */ 153 const nsmsgsearchopvalue isnt = 3; 154 const nsmsgsearchopvalue isempty = 4; 155 156 const nsmsgsearchopvalue isbefore = 5; /* for date attributes */ 157 const nsmsgsearchopvalue isafter = 6; 158 159 const nsmsgsearchopvalue ishigherthan = 7; /* for priority.
nsStaticModuleInfo
getmodule this member provides a function pointer of type nsgetmoduleproc that returns a nsimodule instance.
Frequently Asked Questions
comparing an nscomptr to a raw xpcom interface pointer declaring an nscomptr to a forward-declared class not linking to xpcom not including nscomptr.h different settings of nscap_feature_debug_ptr_types runtime errors ns_assertion "queryinterface needed" may be caused by a class that derives from a given interface, when you forgetting to also specify the interface name in the ns_impl_isupports / ns_impl_threadsafe_isupports macro.
Status, Recent Changes, and Plans
made getter_addrefs( nscomptr& ) apply the same type-safety check that the simple assignment forms do.
Using nsIDirectoryService
briefly, nsidirectoryservice uses "providers" of type nsidirectoryserviceprovider to provide file locations.
XPCOM tasks
5.1 should we provide type-safe templatized containers, e.g., over nsisupportsarray?
already_AddRefed
you may want to use this as a return type from a function that has already produced an addrefed pointer as a result.
Xptcall Porting Guide
these are discriminated unions describing the type and value of each parameter of the target function.
Autoconfiguration in Thunderbird
all config files must be served as content-type: text/xml (or application/xml), otherwise the file will be ignored.
MailNews fakeserver
the other two components are specific to the protocol type and found under similar files in the same directory (e.g., smtpd.js).
Mail composition back end
nsimessage *msgtoreplace, - if the delivery mode is set to nsmsgsaveasdraft, this is a pointer to the the nsimessage object for the message that needs to be replaced const char *attachment1_type, const char *attachment1_body, pruint32 attachment1_body_length, - the full text of the first attachment is provided via `attachment1_type' `attachment1_body' and `attachment1_body_length'.
Main Windows
things appear confusing for several reasons: much of the code is written to be portable, so instead of duplicating it, its been put in overlays that are loaded over many different types of windows.
Thunderbird API documentation
hidden prefs libmime libmime module libmime content type handlers mail and rdf using the multiple accounts api spam filtering ...
Thunderbird Binaries
described below are three types of generally available thunderbird packages - releases, early preview releases, and nightly builds (including trunk development builds) - and their downloaded locations.
Creating a Custom Column
/keymaster/gatekeeper/there.is.only.xul"> <tree id="threadtree"> <treecols id="threadcols"> <splitter class="tree-splitter" /> <treecol id="colreplyto" persist="hidden ordinal width" currentview="unthreaded" flex="2" label="reply-to" tooltiptext="click to sort by the reply-to header" /> </treecols> </tree> <!-- include our javascript file --> <script type="text/javascript" src="chrome://replyto_col/content/replyto_col.js"/> </overlay> that's it!
Add Toolbar Button
example xul overlay file: <?xml version="1.0"?> <?xml-stylesheet href="chrome://demo/skin/overlay.css" type="text/css" ?> <overlay id="messengerwindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/x-javascript" src="overlay.js" /> <toolbarpalette id="mailtoolbarpalette"> <toolbarbutton id="demo-button" class="demo-button toolbarbutton-1" label="demo" type="button" oncommand="demo.load();" /> </toolbarpalette> </overlay> add this to the css file you referenced in your xul file: #demo-button, [place="palette"] > #demo-button { list-style-image: url("chrome://demo/skin/icon.png") !important; } ...
Thunderbird extensions
an overview of thunderbird components developer reference docs: folder classes db views (message list) message summary database mailnews protocols mailnews filters error reporting tools steel library (obsolete as of thunderbird 52, use https://github.com/protz/thunderbird-stdlib) developing new account types useful newsgroup discussions (anything that's very old should be regarded suspiciously, because there has been significant api rewrite over the past years making most techniques considerably easier) thunderbird api docs (mostly a collection of out-of-date pages, relevance is rather dubious) general links finding the code for a feature mozillazin...
Using Mozilla code in other projects
nspr the netscape portable runtime provides a platform-neutral api for system level and libc-type functions.
Using the Mozilla source server
using the source server in windbg in the windbg command line, type .srcfix and hit enter.
XPI
when xpi files are served via http, the application/x-xpinstall mime type should be matched with the xpi file extension.
PKCS #11 Netscape Trust Objects - Network Security Services
attribute type description cka_class ck_object_class cko_netscape_trust cka_issuer byte array der-encoding of the certificate issuer name.
Blocking By Domain - Plugins
plugin detection mechanisms such as navigator.mimetypes and navigator.plugins will also behave as if the plugin were not installed.
Plug-in Side Plug-in API - Plugins
np_getmimedescription registers the mime types supported by the plug-in (unix, mac os).
Scripting plugins - Plugins
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: <embed type="application/plugin-mimetype"> <script> var embed = document.embeds[0]; embed.nativemethod(); alert(embed.nativeproperty); embed.nativeproperty.anothernativemethod(); </script> the api extensions the api extensions are based on four new structs: npstring npvariant npn_releasevariantvalue npn_getstringidentifier npn_getstringidentifiers npn_getintidentifier npn_ide...
Preferences System
d | examples | troubleshooting reference: prefwindow | prefpane | preferences | preference | xul attributes use code for a typical preferences window may look like this: <prefwindow id="apppreferences" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <prefpane id="pane1" label="&pane1.title;"> <preferences> <preference id="pref1" name="pref.name" type="bool"/> </preferences> ..
Inspecting web app manifests - Firefox Developer Tools
cessfully deployed, you'll get the following output shown: deploying a manifest to get a manifest deployed successfully, you need to include a <link> element in the <head> of your document that points to your .webmanifest file: <link rel="manifest" href="/manifest.webmanifest"> the .webmanifest extension is recommended in the spec, and should be served with an application/manifest+json mime type, although browsers generally tend to support manifests with other appropriate extensions like .json (mime type: application/json).
Examine, modify, and watch variables - Firefox Developer Tools
just click on the variable's current value and you'll be able to type there: watch an expression watch expressions are expressions that are evaluated each time execution pauses.
Set watch expressions - Firefox Developer Tools
to set a watch expression, expand the watch expressions sidebar, then click "add watch expression." type the expression you'd like to watch into the text field.
Set a breakpoint - Firefox Developer Tools
there are many different types of breakpoint that can be set in the debugger; this article covers standard (unconditional) breakpoints and conditional breakpoints.
Use a source map - Firefox Developer Tools
javascript running in a page is often machine-generated, as when compiled from a language like coffeescript or typescript.
Set a logpoint - Firefox Developer Tools
rather than sprinkle console.log() statements throughout your code, you can use a special type of breakpoint, the logpoint.
Source map errors - Firefox Developer Tools
source-map-fehler: typeerror: networkerror when attempting to fetch resource.
Tutorial: Show Allocations Per Call Path - Firefox Developer Tools
</div> <script> function makefactory(type) { return function factory(content) { var elt = document.createelement(type); elt.textcontent = content; return elt; }; } var divfactory = makefactory('div'); var spanfactory = makefactory('span'); function divsandspans() { for (i = 0; i < 10; i++) { var div = divfactory('div #' + i); div.appendchild(spanfactory('span #' + i)); document.bo...
Deprecated tools - Firefox Developer Tools
some non-audioparam properties, like an oscillatornode's type property, were displayed and editable as well.
JSON viewer - Firefox Developer Tools
if you open a json file in the browser, or view a remote url with the content-type set to application/json, it is parsed and given syntax highlighting.
Memory - Firefox Developer Tools
the aggregate view shows memory usage as a table of allocated types.
Edit CSS filters - Firefox Developer Tools
type a name for your preset, and then click the plus sign to add it to the list of presets.
Edit Shape Paths in CSS - Firefox Developer Tools
editing basic shapes the options given to you by the tool will differ depending on the type of basic shape that you are editing.
Work with animations - Firefox Developer Tools
if you hover over the bar, a tooltip appears, giving you more detailed information about the animation or transition, including: the type of animation: css transition, css animation, or web animations api the duration of the animation the animation's start and end delay the animation's easing (or timing function).
Animating CSS properties - Firefox Developer Tools
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.
Cache Storage - Firefox Developer Tools
under the cache storage type within the storage inspector you can see the contents of any dom caches created using the cache api.
Cookies - Firefox Developer Tools
when you select an origin inside the cookies storage type from the storage tree, all the cookies present for that origin will be listed in a table.
Extension Storage - Firefox Developer Tools
this storage type is only shown when debugging extensions.
Web Audio Editor - Firefox Developer Tools
some non-audioparam properties, like an oscillatornode's type property, are displayed, and you can edit these as well.
about:debugging (before Firefox 68) - Firefox Developer Tools
opening the about:debugging page there are several different ways to open about:debugging: type "about:debugging" in the firefox url bar.
about:debugging - Firefox Developer Tools
opening the about:debugging page there are two ways to open about:debugging: type about:debugging in the firefox url bar.
Firefox Developer Tools
responsive design mode see how your website or app will look and behave on different devices and network types.
ANGLE_instanced_arrays.drawArraysInstancedANGLE() - Web APIs
syntax void ext.drawarraysinstancedangle(mode, first, count, primcount); parameters mode a glenum specifying the type primitive to render.
ANGLE_instanced_arrays - Web APIs
the angle_instanced_arrays extension is part of the webgl api and allows to draw the same object, or groups of similar objects multiple times, if they share the same vertex data, primitive count and type.
AnalyserNode.frequencyBinCount - Web APIs
syntax var arraylength = analysernode.frequencybincount; value an unsigned integer, equal to the number of values that analysernode.getbytefrequencydata() and analysernode.getfloatfrequencydata() copy into the provided typedarray.
AnalyserNode.getFloatFrequencyData() - Web APIs
<!doctype html> <body> <script> const audioctx = new audiocontext(); //create audio source //here, we use an audio file, but this could also be e.g.
Animation.effect - Web APIs
WebAPIAnimationeffect
the target effect may be either an effect object of a type based on animationeffectreadonly, such as keyframeeffect, or null.
AnimationEvent.initAnimationEvent() - Web APIs
syntax animationevent.initanimationevent(typearg, canbubblearg, cancelablearg, animationnamearg, elapsedtimearg); parameters typearg a domstring identifying the specific type of animation event that occurred.
Attr.prefix - Web APIs
WebAPIAttrprefix
when a document is served with an xml mime type.
AudioBuffer - Web APIs
objects of these types are designed to hold small audio snippets, typically less than 45 s.
AudioBufferSourceNode.loop - Web APIs
you can run the full example live (or view the source.) function getdata() { source = audioctx.createbuffersource(); request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; source.playbackrate.value = playbackcontrol.value; source.connect(audioctx.destination); source.loop = true; }, function(e){"error with decoding audio da...
AudioBufferSourceNode.loopEnd - Web APIs
function getdata() { source = audioctx.createbuffersource(); request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; songlength = buffer.duration; source.buffer = mybuffer; source.playbackrate.value = playbackcontrol.value; source.connect(audioctx.destination); source.loop = true; loopstart...
AudioBufferSourceNode.loopStart - Web APIs
function getdata() { source = audioctx.createbuffersource(); request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; songlength = buffer.duration; source.buffer = mybuffer; source.playbackrate.value = playbackcontrol.value; source.connect(audioctx.destination); source.loop = true; loopstartc...
AudioBufferSourceNode.playbackRate - Web APIs
<input class="playback-rate-control" type="range" min="0.25" max="3" step="0.05" value="1"> <span class="playback-rate-value">1.0</span> function getdata() { source = audioctx.createbuffersource(); request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(...
AudioBufferSourceNode.start() - Web APIs
exceptions typeerror a negative value was specified for one or more of the three time parameters.
AudioContext.createJavaScriptNode() - Web APIs
example the following script illustrates the use of createjavascriptnode(): var sinewave = function(context) { var that = this; this.x = 0; // initial sample number this.context = context; this.node = context.createjavascriptnode(1024, 1, 1); this.node.onaudioprocess = function(e) { that.process(e) }; } sinewave.prototype.process = function(e) { var data = e.outputbuffer.getchanneldata(0); for (var i = 0; i < data.length; ++i) { data[i] = math.sin(this.x++); } } sinewave.prototype.play = function() { this.node.connect(this.context.destination); } sinewave.prototype.pause = function() { this.node.disconnect(); } see also generating tones with the web audio api exploring the html5 web audio: vi...
AudioContext.createMediaStreamSource() - Web APIs
ta = function(e) { video.play(); video.muted = true; }; // create a mediastreamaudiosourcenode // feed the htmlmediaelement into it var audioctx = new audiocontext(); var source = audioctx.createmediastreamsource(stream); // create a biquadfilter var biquadfilter = audioctx.createbiquadfilter(); biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = range.value; // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination, so we can play the // music and adjust the volume using the mouse cursor source.connect(biquadfilter); biquadfilter.connect(audioctx.destination); // ...
AudioContext.createMediaStreamTrackSource() - Web APIs
navigator.mediadevices.getusermedia ({audio: true, video: false}) .then(function(stream) { audio.srcobject = stream; audio.onloadedmetadata = function(e) { audio.play(); audio.muted = true; }; let audioctx = new audiocontext(); let source = audioctx.createmediastreamsource(stream); let biquadfilter = audioctx.createbiquadfilter(); biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 3000; biquadfilter.gain.value = 20; source.connect(biquadfilter); biquadfilter.connect(audioctx.destination); }) .catch(function(err) { // handle getusermedia() error }); specifications specification status comment web audio apithe definition of 'createmediastreamtracksource()' in that specification.
AudioContextLatencyCategory - Web APIs
the audiocontextlatencycategory type is an enumerated set of strings which are used to select one of a number of default values for acceptable maximum latency of an audio context.
AudioNodeOptions - Web APIs
audionodeoptions is inherited from by the option objects of the different types of audio node constructors.
AudioParam.setValueAtTime() - Web APIs
a typeerror is thrown if this value is negative.
AudioParam.value - Web APIs
WebAPIAudioParamvalue
usage notes value precision and variation the data type used internally to store value is a single-precision (32-bit) floating point number, while javascript uses 64-bit double-precision floating point numbers.
AudioScheduledSourceNode.onended - Web APIs
the function receives as input a single parameter, which is an object of type event describing the event that occurred.
AudioScheduledSourceNode - Web APIs
the audioscheduledsourcenode interface—part of the web audio api—is a parent interface for several types of audio source node interfaces which share the ability to be started and stopped, optionally at specified times.
AudioTrack.kind - Web APIs
WebAPIAudioTrackkind
syntax var trackkind = audiotrack.kind; value a domstring specifying the type of content the media represents.
AudioTrackList.length - Web APIs
each track can be accessed by treating the audiotracklist as an array of objects of type audiotrack.
AudioWorkletGlobalScope.registerProcessor - Web APIs
typeerror the processorctor is not a callable constructor, or the parameterdescriptors property of the constructor exists and doesn't return an array of audioparamdescriptor-based objects.
AudioWorkletProcessor.process - Web APIs
the 3 most common types of audio node are: a source of output.
AuthenticatorAttestationResponse.attestationObject - Web APIs
examples var publickey = { challenge: /* from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(16), name: "jdoe@example.com", displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { var attestationobj = newcredentialinfo.response.attestationobject; // this will be a cbor encoded arraybuffer // do something with the response // (sending it back to the relying party server maybe?) }).catch(function (err) { console.error(err); }...
AuthenticatorAttestationResponse.getTransports() - Web APIs
examples var publickey = { challenge: /* from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(16), name: "jdoe@example.com", displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { var transports = newcredentialinfo.response.gettransports(); console.table(transports); // may be something like ["internal", "nfc", "usb"] }).catch(function (err) { console.error(err); }); specifications specification status comment ...
AuthenticatorAttestationResponse - Web APIs
examples var publickey = { challenge: /* from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(16), name: "jdoe@example.com", displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { var response = newcredentialinfo.response; // do something with the response // (sending it back to the relying party server maybe?) }).catch(function (err) { console.error(err); }); specifications specification status comment ...
AuthenticatorResponse - Web APIs
eed with the control of the credential }).catch(function (err) { console.error(err); }); getting an authenticatorattestationresponse var publickey = { challenge: /* from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(16), name: "jdoe@example.com", displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { var attestationresponse = newcredentialinfo.response; }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definit...
Background Tasks API - Web APIs
interfaces the background tasks api adds only one new interface: idledeadline an object of this type is passed to the idle callback to provide an estimate of how long the idle period is expected to last, as well as whether or not the callback is running because its timeout period has expired.
BaseAudioContext.createConvolver() - Web APIs
// grab audio track via xhr for convolver node var soundsource, concerthallbuffer; ajaxrequest = new xmlhttprequest(); ajaxrequest.open('get', 'concert-crowd.ogg', true); ajaxrequest.responsetype = 'arraybuffer'; ajaxrequest.onload = function() { var audiodata = ajaxrequest.response; audioctx.decodeaudiodata(audiodata, function(buffer) { concerthallbuffer = buffer; soundsource = audioctx.createbuffersource(); soundsource.buffer = concerthallbuffer; }, function(e){"error with decoding audio data" + e.err}); } ajaxrequest.send(); ...
BaseAudioContext.createIIRFilter() - Web APIs
the createiirfilter() method of the baseaudiocontext interface creates an iirfilternode, which represents a general infinite impulse response (iir) filter which can be configured to serve as various types of filter.
BaseAudioContext.createOscillator() - Web APIs
// create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.type = 'square'; oscillator.frequency.setvalueattime(3000, audioctx.currenttime); // value in hertz oscillator.connect(audioctx.destination); oscillator.start(); specifications specification status comment web audio apithe definition of 'createoscillator' in that specification.
BaseAudioContext.createScriptProcessor() - Web APIs
e = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio track via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // give the node a function to process audio events scriptnode.onaudioprocess = function(audioprocessingev...
BaseAudioContext.createWaveShaper() - Web APIs
function makedistortioncurve(amount) { var k = typeof amount === 'number' ?
BasicCardResponse - Web APIs
var supportedinstruments = [{ supportedmethods: 'basic-card', data: { supportednetworks: ['visa', 'mastercard', 'amex', 'jcb', 'diners', 'discover', 'mir', 'unionpay'], supportedtypes: ['credit', 'debit'] } }]; var details = { total: {label: 'donation', amount: {currency: 'usd', value: '65.00'}}, displayitems: [ { label: 'original donation amount', amount: {currency: 'usd', value: '65.00'} } ], shippingoptions: [ { id: 'standard', label: 'standard shipping', amount: {currency: 'usd', value: '0.00'}, selected: true ...
BiquadFilterNode.Q - Web APIs
= audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(biquadfilter); biquadfilter.connect(convolver); convolver.connect(gainnode); gainnode.connect(audioctx.destination); // manipulate the biquad filter biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = 25; biquadfilter.type = "peaking"; biquadfilter.frequency.value = 1000; biquadfilter.q.value = 100; biquadfilter.gain.value = 25; specifications specification status comment web audio apithe definition of 'q' in that specification.
BiquadFilterNode.detune - Web APIs
= audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(biquadfilter); biquadfilter.connect(convolver); convolver.connect(gainnode); gainnode.connect(audioctx.destination); // manipulate the biquad filter biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = 25; biquadfilter.detune.value = 100; specifications specification status comment web audio apithe definition of 'detune' in that specification.
BiquadFilterNode.frequency - Web APIs
= audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(biquadfilter); biquadfilter.connect(convolver); convolver.connect(gainnode); gainnode.connect(audioctx.destination); // manipulate the biquad filter biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = 25; specifications specification status comment web audio apithe definition of 'frequency' in that specification.
BiquadFilterNode.gain - Web APIs
= audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(biquadfilter); biquadfilter.connect(convolver); convolver.connect(gainnode); gainnode.connect(audioctx.destination); // manipulate the biquad filter biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = 25; specifications specification status comment web audio apithe definition of 'gain' in that specification.
BiquadFilterNode.getFrequencyResponse() - Web APIs
"freq-response-output"> </ul> var freqresponseoutput = document.queryselector('.freq-response-output'); finally, after creating our biquad filter, we use getfrequencyresponse() to generate the response data and put it in our arrays, then loop through each data set and output them in a human-readable list at the bottom of the page: var biquadfilter = audioctx.createbiquadfilter(); biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = range.value; ...
Blob.text() - Web APIs
WebAPIBlobtext
blob.text() always uses utf-8 as encoding, while filereader.readastext() can use a different encoding depending on the blob's type and a specified encoding name.
Bluetooth.requestDevice() - Web APIs
exceptions typeerror the provided options do not makes sense.
Bluetooth - Web APIs
WebAPIBluetooth
events bluetooth.onavailabilitychanged an event handler that runs when an event of type availabilitychanged has fired.
Body.arrayBuffer() - Web APIs
WebAPIBodyarrayBuffer
function readfile(file) { return new response(file).arraybuffer(); } <input type="file" onchange="readfile(this.files[0])"> specifications specification status comment fetchthe definition of 'arraybuffer()' in that specification.
Body.blob() - Web APIs
WebAPIBodyblob
note: if the response has a response.type of "opaque", the resulting blob will have a blob.size of 0 and a blob.type of empty string "", which renders it useless for methods like url.createobjecturl.
BroadcastChannel: message event - Web APIs
sender <h1>sender</h1> <label for="message">type a message to broadcast:</label><br/> <textarea id="message" name="message" rows="1" cols="40">hello</textarea> <button id="broadcast-message" type="button">broadcast message</button> body { border: 1px solid black; padding: .5rem; height: 150px; font-family: "fira sans", sans-serif; } h1 { font: 1.6em "fira sans", sans-serif; margin-bottom: 1rem; } textarea { pa...
BroadcastChannel.onmessageerror - Web APIs
the onmessageerror event handler of the broadcastchannel interface is an eventlistener, called whenever an messageevent of type messageerror is fired on the broadcastchannel instance — that is, when it receives a message that cannot be deserialized.
CSSKeyframeRule - Web APIs
it implements the cssrule interface with a type value of 8 (cssrule.keyframe_rule).
CSSKeyframesRule - Web APIs
it implements the cssrule interface with a type value of 7 (cssrule.keyframes_rule).
CSSKeywordValue.CSSKeywordValue() - Web APIs
ee the log in the console and to inspect the style attribute on this div.</div> let keyword = new csskeywordvalue('initial'); let myelement = document.getelementbyid('myelement').attributestylemap; myelement.set('display', keyword); console.log( myelement.get('display').value); // 'initial' console.dir( keyword ); specifications specification status comment css typed om level 1the definition of 'csskeywordvalue' in that specification.
CSSKeywordValue.value - Web APIs
let indicator = document.getelementbyid('indicator'); indicator.attributestylemap.set('display', new csskeywordvalue('initial')); indicator.attributestylemap.get('display').value // 'initial' specifications specification status comment css typed om level 1the definition of 'undefined' in that specification.
CSSMathProduct.CSSMathProduct() - Web APIs
specifications specification status comment css typed om level 1the definition of 'cssmathproduct()' in that specification.
CSSMathProduct.values - Web APIs
specifications specification status comment css typed om level 1the definition of 'values' in that specification.
CSSMathSum.CSSMathSum() - Web APIs
specifications specification status comment css typed om level 1the definition of 'cssmathsum()' in that specification.
CSSMathSum.values - Web APIs
WebAPICSSMathSumvalues
specifications specification status comment css typed om level 1the definition of 'values' in that specification.
CSSMediaRule - Web APIs
it implements the cssconditionrule interface, and therefore the cssgroupingrule and the cssrule interface with a type value of 4 (cssrule.media_rule).
CSSNamespaceRule - Web APIs
it implements the cssrule interface, with a type value of 10 (cssrule.namespace_rule).
CSSNumericValue.parse() - Web APIs
let numvalue = cssnumericvalue.parse("42.0px"); specifications specification status comment css typed om level 1the definition of 'parse' in that specification.
CSSPageRule - Web APIs
it implements the cssrule interface with a type value of 6 (cssrule.page_rule).
CSSPositionValue - Web APIs
the csspositionvalue interface of the the css typed object model api represents values for properties that take a position, for example object-position.
CSSPrimitiveValue.getCounterValue() - Web APIs
exceptions type description domexception an invalid_access_err is raised if the css value doesn't contain a counter value (e.g.
CSSPrimitiveValue.getRGBColorValue() - Web APIs
exceptions type description domexception an invalid_access_err is raised if the attached property can't return an rgb color value (i.e.
CSSPrimitiveValue.getRectValue() - Web APIs
exceptions type description domexception an invalid_access_err is raised if the css value doesn't contain a rect value.
CSSPrimitiveValue.getStringValue() - Web APIs
exceptions type description domexception an invalid_access_err is raised if the css value doesn't contain a string value.
CSSPrimitiveValue - Web APIs
cssprimitivevalue.primitivetype read only an unsigned short representing the type of the value.
CSSStyleDeclaration.item() - Web APIs
this method doesn't throw exceptions as long as you provide arguments; the empty string is returned if the index is out of range and a typeerror is thrown if no argument is provided.
CSSStyleRule.styleMap - Web APIs
specifications specification status comment css typed om level 1the definition of 'stylemap' in that specification.
CSSStyleRule - Web APIs
it implements the cssrule interface with a type value of 1 (cssrule.style_rule).
CSSStyleValue.parse() - Web APIs
const css = cssstylevalue.parse( 'transform', 'translate3d(10px,10px,0) scale(0.5)'); csstransformvalue {0: csstranslate, 1: cssscale, length: 2, is2d: false} specifications specification status comment css typed om level 1the definition of 'parse()' in that specification.
CSSStyleValue.parseAll() - Web APIs
specifications specification status comment css typed om level 1the definition of 'parseall()' in that specification.
CSSSupportsRule - Web APIs
it implements the cssconditionrule interface, and therefore the cssrule and cssgroupingrule interfaces with a type value of 12 (cssrule.supports_rule).
CSSUnitValue.value - Web APIs
let pos = new csspositionvalue( new cssunitvalue( 5, "px" ), new cssunitvalue( 10, "px" )); console.log( pos.x.value ); // 5 console.log( pos.y.value ); // 10 specifications specification status comment css typed om level 1the definition of 'cssunitvalue.value' in that specification.
CSSUnparsedValue.CSSUnparsedValue() - Web APIs
examples let value = new cssunparsedvalue( ['4deg'] ), values = new cssunparsedvalue( ['1em', '#445566', '-45px'] ); console.log( value ); // cssunparsedvalue {0: "4deg", length: 1} console.log( values ); // cssunparsedvalue {0: "1em", 1: "#445566", 2: "-45px", length: 3} specifications specification status comment css typed om level 1the definition of 'cssunparsedvalue' in that specification.
CSSUnparsedValue.forEach() - Web APIs
specifications specification status comment css typed om level 1the definition of 'foreach()' in that specification.
CSSUnparsedValue.keys() - Web APIs
specifications specification status comment css typed om level 1the definition of 'keys()' in that specification.
CSSUnparsedValue.length - Web APIs
examples in this example we employ the cssunparsedvalue.cssunparsedvalue() constructor, then query the length: let values = new cssunparsedvalue( ['1em', '#445566', '-45px'] ); console.log( values.length ) // 3 specifications specification status comment css typed om level 1the definition of 'length' in that specification.
CSSUnparsedValue.values() - Web APIs
specifications specification status comment css typed om level 1the definition of 'values()' in that specification.
CSSValue - Web APIs
WebAPICSSValue
cssvalue.cssvaluetyperead only an unsigned short representing a code defining the type of the value.
CSSVariableReferenceValue() - Web APIs
specifications specification status comment css typed om level 1the definition of 'cssvariablereferencevalue()' in that specification.
CSSVariableReferenceValue.fallback - Web APIs
specifications specification status comment css typed om level 1the definition of 'fallback' in that specification.
CSSVariableReferenceValue.variable - Web APIs
specifications specification status comment css typed om level 1the definition of 'variable' in that specification.
Cache.addAll() - Web APIs
WebAPICacheaddAll
exceptions exception happens when typeerror the url scheme is not http or https.
CacheStorage - Web APIs
the interface: provides a master directory of all the named caches that can be accessed by a serviceworker or other type of worker or window scope (you’re not limited to only using it with service workers, even though the service workers spec defines it).
CanvasImageSource - Web APIs
it’s just an internal helper type to simplify the specification.
CanvasPattern.setTransform() - Web APIs
so for example you could replace the svgmatrix in the above example with the following: const matrix = new dommatrix([1, .2, .8, 1, 0, 0]); edit the code below and see your changes update live in the canvas: playable code <canvas id="canvas" width="400" height="200" class="playable-canvas"></canvas> <svg id="svg1" style="display:none"></svg> <div class="playable-buttons"> <input id="edit" type="button" value="edit" /> <input id="reset" type="button" value="reset" /> </div> <textarea id="code" class="playable-code" style="height:120px"> var img = new image(); img.src = 'https://mdn.mozillademos.org/files/222/canvas_createpattern.png'; img.onload = function() { var pattern = ctx.createpattern(img, 'repeat'); pattern.settransform(matrix.rotate(-45).scale(1.5)); ctx.fillstyle = pat...
CanvasRenderingContext2D.addHitRegion() - Web APIs
(if you don't see the full smiley, check the browser compatibility table to see if your current browser supports hit regions already; you might need to activate a preference.) playable code <canvas id="canvas" width="400" height="200" class="playable-canvas"></canvas> <div class="playable-buttons"> <input id="edit" type="button" value="edit" /> <input id="reset" type="button" value="reset" /> </div> <textarea id="code" class="playable-code" style="height:250px"> ctx.beginpath(); ctx.arc(100, 100, 75, 0, 2 * math.pi, false); ctx.linewidth = 5; ctx.stroke(); // eyes ctx.beginpath(); ctx.arc(70, 80, 10, 0, 2 * math.pi, false); ctx.arc(130, 80, 10, 0, 2 * math.pi, false); ctx.fill(); ctx.addhitregion({id: "eyes"}...
CanvasRenderingContext2D.arcTo() - Web APIs
html <div> <label for="radius">radius: </label> <input name="radius" type="range" id="radius" min=0 max=100 value=50> <label for="radius" id="radius-output">50</label> </div> <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); const controlout = document.getelementbyid('radius-output'); const control = document.getelementbyid('radius'); control.oninput = () => { con...
CanvasRenderingContext2D.drawImage() - Web APIs
type_mismatch_err the specified source element isn't supported.
CanvasRenderingContext2D.miterLimit - Web APIs
playable code <canvas id="canvas" width="400" height="200" class="playable-canvas"></canvas> <div class="playable-buttons"> <input id="edit" type="button" value="edit" /> <input id="reset" type="button" value="reset" /> </div> <textarea id="code" class="playable-code"> ctx.beginpath(); ctx.moveto(0,0); ctx.linewidth = 15; ctx.lineto(100, 100); ctx.stroke();</textarea> var canvas = document.getelementbyid("canvas"); var ctx = canvas.getcontext("2d"); var textarea = document.getelementbyid("code"); var reset = document.getelementbyid("re...
CanvasRenderingContext2D.scrollPathIntoView() - Web APIs
html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.beginpath(); ctx.fillrect(10, 10, 30, 30); ctx.scrollpathintoview(); edit the code below to see your changes update live in the canvas: playable code <canvas id="canvas" width="400" height="200" class="playable-canvas"> <input id="button" type="range" min="1" max="12"> </canvas> <div class="playable-buttons"> <input id="edit" type="button" value="edit" /> <input id="reset" type="button" value="reset" /> </div> <textarea id="code" class="playable-code"> ctx.beginpath(); ctx.rect(10, 10, 30, 30); ctx.scrollpathintoview();</textarea> var canvas = document.getelementbyid("canvas"); var ctx = canvas.getcontext("2d"); var textarea = do...
Compositing and clipping - Web APIs
globalcompositeoperation = type this sets the type of compositing operation to apply when drawing new shapes, where type is a string identifying which of the twelve compositing operations to use.
Drawing text - Web APIs
a textbaseline example edit the code below and see your changes update live in the canvas: ctx.font = '48px serif'; ctx.textbaseline = 'hanging'; ctx.stroketext('hello world', 0, 100); playable code <canvas id="canvas" width="400" height="200" class="playable-canvas"></canvas> <div class="playable-buttons"> <input id="edit" type="button" value="edit" /> <input id="reset" type="button" value="reset" /> </div> <textarea id="code" class="playable-code"> ctx.font = "48px serif"; ctx.textbaseline = "hanging"; ctx.stroketext("hello world", 0, 100);</textarea> var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); var textarea = document.getelementbyid('code'); var reset = document.getelementbyid...
ChildNode.remove() - Web APIs
WebAPIChildNoderemove
z/js_piece/blob/master/dom/childnode/remove()/remove().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('remove')) { return; } object.defineproperty(item, 'remove', { configurable: true, enumerable: true, writable: true, value: function remove() { this.parentnode.removechild(this); } }); }); })([element.prototype, characterdata.prototype, documenttype.prototype]); specifications specification status comment domthe definition of 'childnode.remove' in that specification.
Client.postMessage() - Web APIs
this can be any structured-clonable type.
Client.url - Web APIs
WebAPIClienturl
example self.addeventlistener('notificationclick', function(event) { console.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: 'window' }).then(function(clientlist) { for (var i = 0; i < clientlist.length; i++) { var client = clientlist[i]; if (client.url == '/' && 'focus' in client) return client.focus(); } if (clients.openwindow) return clients.openwindow('/'); })); }); specifications specification status comment service workersthe definition of 'url'...
Client - Web APIs
WebAPIClient
client.type read only the client's type as a string.
Clients.matchAll() - Web APIs
WebAPIClientsmatchAll
type: sets the type of clients you want matched.
Clients.openWindow() - Web APIs
data: { url: self.location.origin + '/some/path' }, // data: { url: 'http://example.com' }, }; self.registration.shownotification('you\'ve got messages!', notificationobject); } // notification click event listener self.addeventlistener('notificationclick', e => { // close the notification popout e.notification.close(); // get all the window clients e.waituntil(clients.matchall({ type: 'window' }).then(clientsarr => { // if a window tab matching the targeted url already exists, focus that; const hadwindowtofocus = clientsarr.some(windowclient => windowclient.url === e.notification.data.url ?
Clients - Web APIs
WebAPIClients
an options argument allows you to control the types of clients returned.
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.
CloseEvent - Web APIs
1003 unsupported data the connection is being terminated because the endpoint received data of a type it cannot accept (for example, a text-only endpoint received binary data).
CompositionEvent.CompositionEvent() - Web APIs
syntax const myevent = new compositionevent(typearg [, compositioneventinit]) values typearg is a domstring representing the name of the event.
CompositionEvent.data - Web APIs
the data read-only property of the compositionevent interface returns the characters generated by the input method that raised the event; its exact nature varies depending on the type of event that generated the compositionevent object.
CompositionEvent.initCompositionEvent() - Web APIs
syntax compositioneventinstance.initcompositionevent(typearg, canbubblearg, cancelablearg, viewarg, dataarg, localearg) parameters typearg a domstring representing the type of composition event; this will be one of compositionstart, compositionupdate, or compositionend.
CompositionEvent - Web APIs
compositionevent.data read only returns the characters generated by the input method that raised the event; its varies depending on the type of event that generated the compositionevent object.
ConstrainDOMString - Web APIs
however, for the sake of documentation clarity, the intermediate type (present only because of quirks in webidl syntax) is ignored here.
ContentIndex.getAll() - Web APIs
type: optional the mime type of the image.
ContentIndex - Web APIs
// our content const item = { id: 'post-1', url: '/posts/amet.html', title: 'amet consectetur adipisicing', description: 'repellat et quia iste possimus ducimus aliquid a aut eaque nostrum.', icons: [{ src: '/media/dark.png', sizes: '128x128', type: 'image/png', }], category: 'article' }; // our asynchronous function to add indexed content async function registercontent(data) { const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) { return; } // register content try { await registration.index.add(data); } catch (e) { console.log('failed to register conte...
ContentIndexEvent - Web APIs
constructor contentindexevent() creates and returns a new contentindexevent object whose type and other options are configured as specified.
Content Index API - Web APIs
// our content const item = { id: 'post-1', url: '/posts/amet.html', title: 'amet consectetur adipisicing', description: 'repellat et quia iste possimus ducimus aliquid a aut eaque nostrum.', icons: [{ src: '/media/dark.png', sizes: '128x128', type: 'image/png', }], category: 'article' }; // our asynchronous function to add indexed content async function registercontent(data) { const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) { return; } // register content try { await registration.index.add(data); } catch (e) { console.log('failed to register conte...
ConvolverNode.buffer - Web APIs
// grab audio track via xhr for convolver node var soundsource, concerthallbuffer; ajaxrequest = new xmlhttprequest(); ajaxrequest.open('get', 'concert-crowd.ogg', true); ajaxrequest.responsetype = 'arraybuffer'; ajaxrequest.onload = function() { var audiodata = ajaxrequest.response; audioctx.decodeaudiodata(audiodata, function(buffer) { concerthallbuffer = buffer; soundsource = audioctx.createbuffersource(); soundsource.buffer = concerthallbuffer; }, function(e){"error with decoding audio data" + e.err}); } ajaxrequest.send(); ...
ConvolverNode.normalize - Web APIs
// grab audio track via xhr for convolver node var soundsource, concerthallbuffer; ajaxrequest = new xmlhttprequest(); ajaxrequest.open('get', 'concert-crowd.ogg', true); ajaxrequest.responsetype = 'arraybuffer'; ajaxrequest.onload = function() { var audiodata = ajaxrequest.response; audioctx.decodeaudiodata(audiodata, function(buffer) { concerthallbuffer = buffer; soundsource = audioctx.createbuffersource(); soundsource.buffer = concerthallbuffer; }, function(e){"error with decoding audio data" + e.err}); } ajaxrequest.send(); ...
CrashReportBody - Web APIs
some sample json might look like this: { "type": "crash", "age": 42, "url": "https://example.com/", "user_agent": "mozilla/5.0 (x11; linux x86_64; rv:60.0) gecko/20100101 firefox/60.0", "body": { "reason": "oom" } } note: crash reports are always delivered to the endpoint group named default; there is currently no way to override this.
Credential - Web APIs
credential.type read only returns a domstring containing the credential's type.
Credential Management API - Web APIs
to address these problems, the credential management api provides ways for a website to store and retrieve different types of credentials.
CredentialsContainer.create() - Web APIs
syntax var promise = credentialscontainer.create([options]) parameters options an object of type credentialcreationoptions that contains options for the requested new credentials object.
Crypto - Web APIs
WebAPICrypto
crypto.getrandomvalues() fills the passed typedarray with cryptographically sound random values.
CryptoKey - Web APIs
WebAPICryptoKey
properties cryptokey.type string which may take one of the following values: "secret": this key is a secret key for use with a symmetric algorithm.
CustomEvent.initCustomEvent() - Web APIs
syntax event.initcustomevent(type, canbubble, cancelable, detail); parameters type is a domstring containing the name of the event.
CustomEvent - Web APIs
event.type read only the name of the event.
DOMConfiguration - Web APIs
pre-defined parameters: "canonical-form", "cdata-sections", "check-character-normalization", "comments", "datatype-normalization", "element-content-whitespace", "entities", "error-handler", "infoset", "namespaces", "namespace-declarations", "normalize-characters","schema-location", "schema-type", "split-cdata-sections", "validate", "validate-if-schema", "well-formed" properties domconfiguration.parameternames read only is a domstringlist methods domconfiguration.cansetparameter() returns a boolean domconfiguration.getparameter() returns a domuserdata domconfiguration.setparameter() sets a parameter specification http://www.w3.org/tr/dom-level-3-cor...mconfiguration ...
DOMImplementation.createHTMLDocument() - Web APIs
view live examples the returned document is pre-constructed with the following html: <!doctype html> <html> <head> <title>title</title> </head> <body> </body> </html> specifications specification status comment domthe definition of 'domimplementation.createhtmldocument' in that specification.
DOMPointReadOnly.fromPoint() - Web APIs
const point2d = dompointreadonly.frompoint({x: 25, y: 25}) creating a 3d point using an existing point this example creates a point, origpoint, of type dompoint, using new dompoint().
DOMRect - Web APIs
WebAPIDOMRect
the type of box represented by the domrect is specified by the method or property that returned it.
DOMRectReadOnly - Web APIs
note that this constructor cannot be called by 3rd party javascript; doing so returns an "illegal constructor" typeerror.
DOMStringList - Web APIs
a type returned by some apis which contains a list of domstring (strings).
DOMTimeStamp - Web APIs
the domtimestamp type represents an absolute or relative number of milliseconds, depending on the specification in which it appears.
DOMTokenList.forEach() - Web APIs
class="a b c"></span> javascript let span = document.queryselector("span"); let classes = span.classlist; let iterator = classes.values(); classes.foreach( function(value, key, listobj) { span.textcontent += `${value} ${key}/${this} ++ `; }, "arg" ); result polyfill this polyfill adds compatibility to all browsers supporting es5: if (window.domtokenlist && !domtokenlist.prototype.foreach) { domtokenlist.prototype.foreach = function (callback, thisarg) { thisarg = thisarg || window; for (var i = 0; i < this.length; i++) { callback.call(thisarg, this[i], i, this); } }; } specifications specification status comment domthe definition of 'foreach() (as iterable<node>)' in that specification.
DOMTokenList.keys() - Web APIs
WebAPIDOMTokenListkeys
the keys are of type unsigned integer.
DOMTokenList.replace() - Web APIs
to use with earlier versions of ie, refer to the polyfill at element.classlist#polyfill domtokenlist.prototype.replace = function (a, b) { if (this.contains(a)) { this.add(b); this.remove(a); return true; } return false; } specifications specification status comment domthe definition of 'replace()' in that specification.
DOMUserData - Web APIs
note that although it can be an object, in mozilla, it may be returned as a string or other type, if it was set as such a type (e.g., node.setuserdata() and node.getuserdata()).
DataTransfer.dropEffect - Web APIs
for example, when the user hovers over a target drop element, the browser's cursor may indicate which type of operation will occur.
DataTransfer.effectAllowed - Web APIs
<!doctype html> <html lang=en> <title>examples of datatransfer.{dropeffect,effectallowed} properties</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> <script> function dragstart_handler(ev) { console.log("dragstart: dropeffect = " + ev.datatr...
DataTransfer.mozClearDataAt() - Web APIs
syntax void datatransfer.mozcleardataat([type], index); arguments type a string representing the type of the drag data to remove from the drag data object.
DataTransfer.setDragImage() - Web APIs
demo <!doctype html> <html lang=en> <title>example of datatransfer.setdragimage()</title> <meta name="viewport" content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> <script> function dragstart_handler(ev) { console.log("dragstart"); // set the drag's format and da...
DataTransferItem - Web APIs
datatransferitem.type read only the drag data item's type, typically a mime type.
DedicatedWorkerGlobalScope.onmessageerror - Web APIs
the onmessageerror event handler of the dedicatedworkerglobalscope interface is an eventlistener, called whenever an messageevent of type messageerror is fired on the worker—that is, when it receives a message that cannot be deserialized.
DedicatedWorkerGlobalScope - Web APIs
these events are of type messageevent and will be called when the worker receives a message from the document that started it (i.e.
DeviceMotionEvent.DeviceMotionEvent() - Web APIs
syntax var devicemotionevent = new devicemotionevent(type[, options]) parameters type must be "devicemotion".
DeviceOrientationEvent.DeviceOrientationEvent() - Web APIs
syntax var deviceorientationevent = new deviceorientationevent(type[, options]) parameters type either "deviceorientation" or "deviceorientationabsolute".
DirectoryReaderSync - Web APIs
but directoryentrysync (as well as fileentrysync) is not a data type that you can pass between a calling app and web worker thread.
Document: DOMContentLoaded event - Web APIs
function dosomething() { console.info('dom loaded'); } if (document.readystate === 'loading') { // loading hasn't finished yet document.addeventlistener('domcontentloaded', dosomething); } else { // `domcontentloaded` has already fired dosomething(); } live example html <div class="controls"> <button id="reload" type="button">reload</button> </div> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="30"></textarea> </div> css body { display: grid; grid-template-areas: "control log"; } .controls { grid-area: control; display: flex; align-items: center; justify-content: center; } .event-log { grid-area: log; } .event-log-conten...
Document.anchors - Web APIs
WebAPIDocumentanchors
example if (document.anchors.length >= 5) { dump("found too many anchors"); } the following is an example that auto populates a table of contents with every anchor on the page: <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>test</title> <script> function init() { var toc = document.getelementbyid("toc"); var i, li, newanchor; for (i = 0; i < document.anchors.length; i++) { li = document.createelement("li"); newanchor = document.createelement('a'); newanchor.href = "#" + document.anchors[i].name; newanchor.innerhtml = document.anchors[i].text; li.appendchild(ne...
Document.caretRangeFromPoint() - Web APIs
cument.caretpositionfrompoint) { range = document.caretpositionfrompoint(e.clientx, e.clienty); textnode = range.offsetnode; offset = range.offset; } else if (document.caretrangefrompoint) { range = document.caretrangefrompoint(e.clientx, e.clienty); textnode = range.startcontainer; offset = range.startoffset; } // only split text_nodes if (textnode && textnode.nodetype == 3) { let replacement = textnode.splittext(offset); let br = document.createelement('br'); textnode.parentnode.insertbefore(br, replacement); } } let paragraphs = document.getelementsbytagname("p"); for (let i = 0; i < paragraphs.length; i++) { paragraphs[i].addeventlistener('click', insertbreakatpoint, false); } result ...
Document.characterSet - Web APIs
users can override the developer-specified encoding inside the content-type header or inline like <meta charset="utf-8">, such as with firefox's view → text encoding menu.
Document.cookie - Web APIs
WebAPIDocumentcookie
the reason for the syntax of the document.cookie accessor property is due to the client-server nature of cookies, which differs from other client-client storage methods (like, for instance, localstorage): the server tells the client to store a cookie http/1.0 200 ok content-type: text/html set-cookie: cookie_name1=cookie_value1 set-cookie: cookie_name2=cookie_value2; expires=sun, 16 jul 3567 06:23:41 gmt [content of the page here] the client sends back to the server its cookies previously stored get /sample_page.html http/1.1 host: www.example.org cookie: cookie_name1=cookie_value1; cookie_name2=cookie_value2 accept: */* specifications specification sta...
Document.createProcessingInstruction() - Web APIs
example var doc = new domparser().parsefromstring('<foo />', 'application/xml'); var pi = doc.createprocessinginstruction('xml-stylesheet', 'href="mycss.css" type="text/css"'); doc.insertbefore(pi, doc.firstchild); console.log(new xmlserializer().serializetostring(doc)); // displays: <?xml-stylesheet href="mycss.css" type="text/css"?><foo/> specifications specification status comment domthe definition of 'createprocessinginstruction()' in that specification.
Document.createTextNode() - Web APIs
example <!doctype html> <html lang="en"> <head> <title>createtextnode example</title> <script> function addtextnode(text) { var newtext = document.createtextnode(text), p1 = document.getelementbyid("p1"); p1.appendchild(newtext); } </script> </head> <body> <button onclick="addtextnode('yes!
Document.getElementsByName() - Web APIs
example <!doctype html> <html lang="en"> <title>example: using document.getelementsbyname</title> <input type="hidden" name="up"> <input type="hidden" name="down"> <script> var up_names = document.getelementsbyname("up"); console.log(up_names[0].tagname); // displays "input" </script> </html> notes the name attribute can only be applied in (x)html documents.
Document.getElementsByTagName() - Web APIs
<!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>getelementsbytagname example</title> <script> function getallparaelems() { var allparas = document.getelementsbytagname('p'); var num = allparas.length; alert('there are ' + num + ' paragraph in this document'); } function div1paraelems() { var div1 = document.getelementbyid('div1'); var...
Document.implementation - Web APIs
for example, the domimplementation interface includes a createdocumenttype method with which dtds can be created for one or more documents managed by the implementation.
Document.mozSetImageElement() - Web APIs
<style type="text/css"> #mybox { background-image: -moz-element(#canvasbg); text-align: center; width: 400px; height: 400px; cursor: pointer; } </style> the css defined by the <style> block above is used by our <div> to use an element with the id "canvasbg" as its background.
Document.open() - Web APIs
WebAPIDocumentopen
this call, for example opens github.com in a new window, with its opener set to null: document.open('https://www.github.com','', 'noopener=true') two-argument document.open() browsers used to support a two-argument document.open(), with the following signature: document.open(type, replace) where type specified the mime type of the data you are writing (e.g.
Document.popupNode - Web APIs
for other types of popups, the value is not changed.
Document: readystatechange event - Web APIs
bubbles no cancelable no interface event event handler property onreadystatechange examples live example html <div class="controls"> <button id="reload" type="button">reload</button> </div> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="30"></textarea> </div> css body { display: grid; grid-template-areas: "control log"; } .controls { grid-area: control; display: flex; align-items: center; justify-content: center; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } #reload { height: 2rem; } ...
Document.registerElement() - Web APIs
optionsoptional an object with properties prototype to base the custom element on, and extends, an existing tag to extend.
Document.title - Web APIs
WebAPIDocumenttitle
example <!doctype html> <html> <head> <title>hello world!</title> </head> <body> <script> alert(document.title); // displays "hello world!" document.title = "goodbye world!"; alert(document.title); // displays "goodbye world!" </script> </body> </html> notes this property applies to html, svg, xul, and other documents in gecko.
Document.write() - Web APIs
WebAPIDocumentwrite
this happens when opening a local file with the .xhtml file extension or for any document served with an application/xhtml+xml mime type.
Document.writeln() - Web APIs
WebAPIDocumentwriteln
this is the case if opening a local file with a .xhtml file extension or for any document served with an application/xhtml+xml mime type.
DocumentFragment - Web APIs
parentnode.children read only returns a live htmlcollection containing all objects of type element that are children of the documentfragment object.
DocumentOrShadowRoot.activeElement - Web APIs
other times the focused element might be a <select> element (menu) or an <input> element, of type "button", "checkbox", or "radio".
DocumentOrShadowRoot.caretPositionFromPoint() - Web APIs
; if (document.caretpositionfrompoint) { range = document.caretpositionfrompoint(e.clientx, e.clienty); textnode = range.offsetnode; offset = range.offset; } else if (document.caretrangefrompoint) { range = document.caretrangefrompoint(e.clientx, e.clienty); textnode = range.startcontainer; offset = range.startoffset; } // only split text_nodes if (textnode.nodetype == 3) { var replacement = textnode.splittext(offset); var br = document.createelement('br'); textnode.parentnode.insertbefore(br, replacement); } } window.onload = function (){ var paragraphs = document.getelementsbytagname("p"); for (i=0 ; i < paragraphs.length; i++) { paragraphs[i].addeventlistener("click", insertbreakatpoint, false); } }; specifications spec...
DocumentOrShadowRoot.msElementsFromRect() - Web APIs
syntax object.mselementsfromrect(left, top, width, height, retval) parameters left [in] type: floating-point top[in] type: floating-point width[in] type: floating-point height [in] type: floating-point retval [out, reval] type: nodelist example to find all of the elements under a given point, use mselementsfrompoint(x, y).
DocumentTimeline.DocumentTimeline() - Web APIs
this bit of code would start all the cats animating 500 milliseconds into their animations: var cats = document.queryselectorall('.sharedtimelinecat'); cats = array.prototype.slice.call(cats); var sharedtimeline = new documenttimeline({ origintime: 500 }); cats.foreach(function(cat) { var catkeyframes = new keyframeeffect(cat, keyframes, timing); var catanimation = new animation(catkeyframes, sharedtimeline); catanimation.play(); }); specifications specification status comment web animationsthe definition of 'documenttimeline()' in t...
EXT_color_buffer_half_float - Web APIs
ext.framebuffer_attachment_component_type_ext ?
EXT_disjoint_timer_query - Web APIs
types this extension exposes a new type: gluint64ext unsigned 64-bit integer number.
EXT_frag_depth - Web APIs
examples enable the extension: gl.getextension('ext_frag_depth'); now the output variable gl_fragdepthext is available to set a depth value of a fragment from within the fragment shader: <script type="x-shader/x-fragment"> void main() { gl_fragcolor = vec4(1.0, 0.0, 1.0, 1.0); gl_fragdepthext = 0.5; } </script> specifications specification status comment ext_frag_depththe definition of 'ext_frag_depth' in that specification.
EXT_shader_texture_lod - Web APIs
x, vec2 dpdy) vec4 texture2dprojgradext(sampler2d sampler, vec3 p, vec2 dpdx, vec2 dpdy) vec4 texture2dprojgradext(sampler2d sampler, vec4 p, vec2 dpdx, vec2 dpdy) vec4 texturecubegradext(samplercube sampler, vec3 p, vec3 dpdx, vec3 dpdy) examples enabling the extensions: gl.getextension('ext_shader_texture_lod'); shader code that avoids artifacts when wrapping texture coordinates: <script type="x-shader/x-fragment"> #extension gl_ext_shader_texture_lod : enable #extension gl_oes_standard_derivatives : enable uniform sampler2d mytexture; varying vec2 texcoord; void main(){ gl_fragcolor = texture2dgradext(mytexture, mod(texcoord, vec2(0.1, 0.5)), dfdx(texcoord), dfdy(texcoord)); } </script> specifications specification status comment...
EffectTiming.duration - Web APIs
exceptions typeerror the specified value is either a string other than "auto", a number less than zero, nan, or some other type of object entirely.
EffectTiming.fill - Web APIs
WebAPIEffectTimingfill
syntax var timingproperties = { 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 is, when it's not actively animating).
EffectTiming.iterations - Web APIs
exceptions typeerror an attempt was made to set the value of this property to a negative number or nan.
Element.attachShadow() - Web APIs
elements you can attach a shadow to note that you can't attach a shadow root to every type of element.
Element.computedStyleMap() - Web APIs
specifications specification status comment css typed om level 1the definition of 'computedstylemap()' in that specification.
Element.currentStyle - Web APIs
* http://creativecommons.org/publicdomain/zero/1.0/ */ if (!("currentstyle" in element.prototype)) { object.defineproperty(element.prototype, "currentstyle", { get: function() { return window.getcomputedstyle(this); } }); } specification not part of any specification.
Element: focusin event - Web APIs
bubbles yes cancelable no interface focusevent event handler property onfocusin sync / async sync composed yes examples live example html <form id="form"> <input type="text" placeholder="text input"> <input type="password" placeholder="password"> </form> javascript const form = document.getelementbyid('form'); form.addeventlistener('focusin', (event) => { event.target.style.background = 'pink'; }); form.addeventlistener('focusout', (event) => { event.target.style.background = ''; }); result specifications specification status comm...
Element: focusout event - Web APIs
bubbles yes cancelable no interface focusevent event handler property onfocusout sync / async sync composed yes examples live example html <form id="form"> <input type="text" placeholder="text input"> <input type="password" placeholder="password"> </form> javascript const form = document.getelementbyid('form'); form.addeventlistener('focusin', (event) => { event.target.style.background = 'pink'; }); form.addeventlistener('focusout', (event) => { event.target.style.background = ''; }); result specifications specification status comm...
Element.getAttributeNames() - Web APIs
syntax let attributenames = element.getattributenames(); example // iterate over element's attributes for (let name of element.getattributenames()) { let value = element.getattribute(name); console.log(name, value); } polyfill if (element.prototype.getattributenames == undefined) { element.prototype.getattributenames = function () { var attributes = this.attributes; var length = attributes.length; var result = new array(length); for (var i = 0; i < length; i++) { result[i] = attributes[i].name; } return result; }; } specifications specification status comment domthe definition ...
Element.hasAttribute() - Web APIs
example var foo = document.getelementbyid("foo"); if (foo.hasattribute("bar")) { // do something } polyfill ;(function(prototype) { prototype.hasattribute = prototype.hasattribute || function(name) { return !!(this.attributes[name] && this.attributes[name].specified); } })(element.prototype); notes dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes direct...
Element.hasAttributes() - Web APIs
examples let foo = document.getelementbyid('foo'); if (foo.hasattributes()) { // do something with 'foo.attributes' } polyfill ;(function(prototype) { prototype.hasattributes = prototype.hasattributes || function() { return (this.attributes.length > 0); } })(element.prototype); specifications specification status comment domthe definition of 'element.hasattributes()' in that specification.
Element.insertAdjacentElement() - Web APIs
typeerror the element specified is not a valid element.
Element.insertAdjacentText() - Web APIs
polyfill you can polyfill the insertadjacenttext() method in internet explorer 5.5 (maybe earlier) and higher with the following code: if (!element.prototype.insertadjacenttext) element.prototype.insertadjacenttext = function(type, txt){ this.insertadjacenthtml( type, (txt+'') // convert to string .replace(/&/g, '&amp;') // embed ampersand symbols .replace(/</g, '&lt;') // embed less-than symbols ) } specification specification status comment domthe definition of 'insertadjacenttex...
Element: keypress event - Web APIs
<div> <label for="sample">focus the input and type something:</label> <input type="text" name="text" id="sample"> </div> <p id="log"></p> const log = document.getelementbyid('log'); const input = document.queryselector('input'); input.addeventlistener('keypress', logkey); function logkey(e) { log.textcontent += ` ${e.code}`; } onkeypress equivalent input.onkeypress = logkey; specifications specification status ...
Element.name - Web APIs
WebAPIElementname
syntax htmlelement.name = string let elname = htmlelement.name let fcontrol = htmlformelement.elementname let controlcollection = htmlformelement.elements.elementname example <form action="" name="forma"> <input type="text" value="foo"> </form> <script type="text/javascript"> // get a reference to the first element in the form let formelement = document.forms['forma'].elements[0] // give it a name formelement.name = 'inputa' // show the value of the input alert(document.forms['forma'].elements['inputa'].value) </script> notes in internet explorer (ie), the name property of dom objects crea...
Element: overflow event - Web APIs
bubbles yes cancelable yes interface uievent event handler property unknown examples <div id="wrapper"> <div id="child"></div> </div> <br/> <label><input type="checkbox" id="toggle" checked/> overflow</label> <style> #wrapper { width: 20px; height: 20px; background: #000; padding: 5px; overflow: hidden; } #child { width: 40px; height: 40px; border: 2px solid grey; background: #ccc; } </style> <script> var wrapper = document.getelementbyid("wrapper"), child = document.getelementbyid("child"), t...
Element.prefix - Web APIs
WebAPIElementprefix
when a document is served with an xml mime type.
Element.querySelector() - Web APIs
find a specific element with specific values of an attribute in this first example, the first <style> element which either has no type or has type "text/css" in the html document body is returned: var el = document.body.queryselector("style[type='text/css'], style:not([type])"); the entire hierarchy counts this example demonstrates that the hierarchy of the entire document is considered when applying selectors, so that levels outside the specified baseelement are still considered when locating matches.
Element.requestFullscreen() - Web APIs
the rejection handler receives one of the following exception values: typeerror the typeerror exception may be delivered in any of the following situations: the document containing the element isn't fully active; that is, it's not the current active document.
Element.scrollHeight - Web APIs
</textarea> </p> <p> <input type="checkbox" id="agree" name="accept" /> <label for="agree">i agree</label> <input type="submit" id="nextstep" value="next" /> </p> </form> css #notice { display: inline-block; margin-bottom: 12px; border-radius: 5px; width: 600px; padding: 5px; border: 2px #7fdf55 solid; } #rules { width: 600px; height: 130px; padding: 5px; border: #2a9f00 solid 2px; border-radiu...
Element.scrollLeft - Web APIs
example html <div id="container"> <div id="content">click the button to slide right!</div> </div> <button id="slide" type="button">slide right</button> css #container { width: 100px; height: 100px; border: 1px solid #ccc; overflow-x: scroll; } #content { width: 250px; background-color: #ccc; } javascript const button = document.getelementbyid('slide'); button.onclick = function () { document.getelementbyid('container').scrollleft += 20; }; result specifications specification stat...
Element.scrollWidth - Web APIs
example <!doctype html> <html> <head> <title>example</title> <style> div { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } #adiv { width: 100px; } button { margin-bottom: 2em; } </style> </head> <body> <div id="adiv"> foobar-foobar-foobar-foobar ...
Element: select event - Web APIs
for example, in html, select events can be dispatched only on form <input type="text"> and <textarea> elements.
Element.setCapture() - Web APIs
<html> <head> <title>mouse capture example</title> <style type="text/css"> #mybutton { border: solid black 1px; color: black; padding: 2px; box-shadow: black 2px 2px; } </style> <script type="text/javascript"> function init() { var btn = document.getelementbyid("mybutton"); if (btn.setcapture) { btn.addeventlistener("mousedown", mousedown, false); btn.addeventlistener("mouseup", mouseup, fa...
Element: show event - Web APIs
bubbles no cancelable no interface event event handler property onshow examples <div contextmenu="test"></div> <menu type="context" id="test"> <menuitem label="alert" onclick="alert('the alert label has been clicked')" /> </menu> <script> document.getelementbyid("test").addeventlistener("show", function(e){ alert("the context menu will be displayed"); }, false); </script> specifications specification status html5the definition of 'show event' in that specification.
Element.tagName - Web APIs
WebAPIElementtagName
this string's capitalization depends on the document type: for dom trees which represent html documents, the returned tag name is always in the canonical upper-case form.
Element.toggleAttribute() - Web APIs
directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattributens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - polyfill if (!element.prototype.toggleattribute) { element.prototype.toggleattribute = function(name, force) { if(force !== void 0) force = !!force if (this.hasattribute(name)) { if (force) return true; this.removeattribute(name); return false; } if (force === false) return false; this.setattribute(name, ""); return true; }; } specification specification status ...
Element: underflow event - Web APIs
bubbles yes cancelable yes interface uievent event handler property unknown examples <div id="wrapper"> <div id="child"></div> </div> <br/> <label><input type="checkbox" id="toggle" checked/> overflow</label> <style> #wrapper { width: 20px; height: 20px; background: #000; padding: 5px; overflow: hidden; } #child { width: 40px; height: 40px; border: 2px solid grey; background: #ccc; } </style> <script> var wrapper = document.getelementbyid("wrapper"), child = document.getelementbyid("child"), t...
ElementCSSInlineStyle.style - Web APIs
the following code snippet demonstrates the difference between the values obtained using the element's style property and that obtained using the getcomputedstyle() method: <!doctype html> <html> <body style="font-weight:bold;"> <div style="color:red" id="myelement">..</div> </body> </html> var element = document.getelementbyid("myelement"); var out = ""; var elementstyle = element.style; var computedstyle = window.getcomputedstyle(element, null); for (prop in elementstyle) { if (elementstyle.hasownproperty(prop)) { out += " " + prop + " = '" + elementstyle[...
ElementCSSInlineStyle - Web APIs
note: elementcssinlinestyle is a mixin and not an interface; you can't actually create an object of type elementcssinlinestyle.
Encoding API - Web APIs
stringview – a c-like representation of strings based on typed arrays.
Event() - Web APIs
WebAPIEventEvent
syntax new event(typearg[, eventinit]); values typearg this is a domstring representing the name of the event.
Event.cancelable - Web APIs
WebAPIEventcancelable
function preventscrollwheel(event) { if (typeof event.cancelable !== 'boolean' || event.cancelable) { // the event can be canceled, so we do so.
Event.composed - Web APIs
WebAPIEventcomposed
most other types of events are not composed, and so will return false.
Event.eventPhase - Web APIs
WebAPIEventeventPhase
example html <h4>event propagation chain</h4> <ul> <li>click 'd1'</li> <li>analyse event propagation chain</li> <li>click next div and repeat the experience</li> <li>change capturing mode</li> <li>repeat the experience</li> </ul> <input type="checkbox" id="chcapture" /> <label for="chcapture">use capturing</label> <div id="d1">d1 <div id="d2">d2 <div id="d3">d3 <div id="d4">d4</div> </div> </div> </div> <div id="divinfo"></div> css div { margin: 20px; padding: 4px; border: thin black solid; } #divinfo { margin: 18px; padding: 8px; background-color:white; font-size:80%; } javascript ...
Event.initEvent() - Web APIs
WebAPIEventinitEvent
syntax event.initevent(type, bubbles, cancelable); type is a domstring defining the type of event.
Event.stopImmediatePropagation() - Web APIs
if several listeners are attached to the same element for the same event type, they are called in the order in which they were added.
EventListener - Web APIs
eventlistener.handleevent() a function that is called whenever an event of the specified type occurs.
EventSource.onmessage - Web APIs
event objects of onmessage event handers are of type messageevent.
EventTarget.dispatchEvent() - Web APIs
the dispatchevent() method throws unspecified_event_type_err if the event's type was not specified by initializing the event before the method was called, or if the event's type is null or an empty string.
ExtendableEvent() - Web APIs
syntax var extendableevent = new extendableevent(type, init); parameters type the type of the extendableevent, for example install, activate.
ExtendableMessageEvent - Web APIs
it can be any data type.
FetchEvent() - Web APIs
syntax var fetchevent = new fetchevent(type, init); parameters type a domstring object specifying which event the object represents.
FetchEvent - Web APIs
this is the event type for fetch events dispatched on the service worker global scope.
Fetch API - Web APIs
WebAPIFetch API
fetch mixin body provides methods relating to the body of the response/request, allowing you to declare what its content type is and how it should be handled.
File.getAsDataURL() - Web APIs
WebAPIFilegetAsDataURL
syntax var url = instanceoffile.getasdataurl(); returns a string representing a data: url example // fileinput is a htmlinputelement: <input type="file" id="myfileinput" multiple> var fileinput = document.getelementbyid("myfileinput"); // files is a filelist object (similar to nodelist) var files = fileinput.files; // array with acceptable file types var accept = ["image/png"]; // img is a htmlimgelement: <img id="myimg"> var img = document.getelementbyid("myimg"); // if we accept the first selected file type if (accept.indexof(files[0].mediatype) > -1) { // display the image // ...
File.lastModified - Web APIs
WebAPIFilelastModified
example reading from file input <input type="file" multiple id="fileinput"> const fileinput = document.queryselector('#fileinput'); fileinput.addeventlistener('change', (event) => { // files is a filelist object (similar to nodelist) const files = event.target.files; for (let file of files) { const date = new date(file.lastmodified); console.log(`${file.name} has a last modified date of ${date}`); } }); try the results...
File.lastModifiedDate - Web APIs
example // fileinput is a htmlinputelement: <input type="file" multiple id="myfileinput"> var fileinput = document.getelementbyid("myfileinput"); // files is a filelist object (simliar to nodelist) var files = fileinput.files; for (var i = 0; i < files.length; i++) { alert(files[i].name + " has a last modified date of " + files[i].lastmodifieddate); } reduced time precision to offer protection against timing attacks and fingerprinting, the precision of somefile.lastmodifieddate.gettime() mig...
File.name - Web APIs
WebAPIFilename
example <input type="file" multiple onchange="processselectedfiles(this)"> function processselectedfiles(fileinput) { var files = fileinput.files; for (var i = 0; i < files.length; i++) { alert("filename " + files[i].name); } } try the results out below: specifications specification status comment file apithe definition of 'name' in that specification.
File.webkitRelativePath - Web APIs
html content <input type="file" id="filepicker" name="filelist" webkitdirectory multiple /> <ul id="listing"></ul> javascript content document.getelementbyid("filepicker").addeventlistener("change", function(event) { let output = document.getelementbyid("listing"); let files = event.target.files; for (let i=0; i<files.length; i++) { let item = document.createelement("li"); item.innerhtml = files[i].webki...
FileReader: error event - Web APIs
bubbles no cancelable no interface progressevent event handler property filereader.onerror examples const fileinput = document.queryselector('input[type="file"]'); const reader = new filereader(); function handleselected(e) { const selectedfile = fileinput.files[0]; if (selectedfile) { reader.addeventlistener('error', () => { console.error(`error occurred reading file: ${selectedfile.name}`); }); reader.addeventlistener('load', () => { console.error(`file: ${selectedfile.name} read successfully`); }); reader.readasdataurl(selectedfile); ...
onerror - Web APIs
the filereader onerror handler receives an event object, not an error object, as a parameter, but an error can be accessed from the filereader object, as instanceoffilereader.error // callback from a <input type="file" onchange="onchange(event)"> function onchange(event) { var file = event.target.files[0]; var reader = new filereader(); reader.onerror = function(event) { alert("failed to read file!\n\n" + reader.error); reader.abort(); // (...does this do anything useful in an onerror handler?) }; reader.readastext(file); } ...
FileReader.onload - Web APIs
WebAPIFileReaderonload
example // callback from a <input type="file" onchange="onchange(event)"> function onchange(event) { var file = event.target.files[0]; var reader = new filereader(); reader.onload = function(e) { // the file's text will be printed here console.log(e.target.result) }; reader.readastext(file); } ...
FileSystemDirectoryEntry.removeRecursively() - Web APIs
the fileerror.code specifies what type of error occurred, as follows: fileerror.invalid_modification_err an attempt was made to remove the root directory; this is not permitted.
FileSystemEntry.isDirectory - Web APIs
there are other types of file descriptors on many operating systems.
FileSystemEntry.isFile - Web APIs
there are other types of file descriptors on many operating systems.
FileSystemFileEntry.createWriter() - Web APIs
function writetofileentry(entry, text) { entry.createwriter(function(filewriter) { let data = blob([text], { type: "text/plain" }); filewriter.write(data); }, function(fileerror) { /* do whatever to handle the error */ }); } the success callback for the createwriter() call takes the text which was passed in and creates a new blob object of type text/plain that contains the passed text.
FileSystemSync - Web APIs
attributes attribute type description name readonly domstring name of the file system.
FocusEvent.relatedTarget - Web APIs
the focusevent.relatedtarget read-only property is the secondary target, depending on the type of event: event name target relatedtarget blur the eventtarget losing focus the eventtarget receiving focus (if any).
FontFace.FontFace() - Web APIs
WebAPIFontFaceFontFace
takes the same type of values as the font-family descriptor of @font-face .
FontFaceSetLoadEvent.FontFaceSetLoadEvent() - Web APIs
syntax var fontfacesetloadevent = new fontfacesetloadevent(type[, options]) parameters type the literal value 'type' (quotation marks included).
FormData() - Web APIs
WebAPIFormDataFormData
a object: var formdata = new formdata(); // currently empty you could add a key/value pair to this using formdata.append: formdata.append('username', 'chris'); or you can specify the optional form argument when creating the formdata object, to prepopulate it with values from the specified form: <form id="myform" name="myform"> <div> <label for="username">enter name:</label> <input type="text" id="username" name="username"> </div> <div> <label for="useracc">enter account number:</label> <input type="text" id="useracc" name="useracc"> </div> <div> <label for="userfile">upload file:</label> <input type="file" id="userfile" name="userfile"> </div> <input type="submit" value="submit!"> </form> note: only successful form controls are included in a formd...
FormData - Web APIs
WebAPIFormData
it uses the same format a form would use if the encoding type were set to "multipart/form-data".
FormDataEntryValue - Web APIs
this type is returned by the formdata.get() and formdata.getall() methods.
FormDataEvent() - Web APIs
syntax new formdataevent(type[, formeventinit]); values type a domstring representing the name of the event.
Gamepad.buttons - Web APIs
WebAPIGamepadbuttons
on github.) note the code fork — in chrome navigator.getgamepads needs a webkit prefix and the button values are stores as an array of double values, whereas in firefox navigator.getgamepads doesn't need a prefix, and the button values are stored as an array of gamepadbutton objects; it is the gamepadbutton.value or gamepadbutton.pressed properties of these we need to access, depending on what type of buttons they are.
GamepadEvent() - Web APIs
syntax var gamepadevent = new gamepadevent(typearg, options) parameters typearg a domstring that must be one of gamepadconnected or gamepaddisconnected.
GamepadHapticActuator.pulse() - Web APIs
this can vary depending on the hardware type, but generally takes a value between 0.0 (no intensity) and 1.0 (full intensity).
GamepadHapticActuator - Web APIs
properties gamepadhapticactuator.type read only returns an enum representing the type of the haptic hardware.
GeolocationCoordinates.longitude - Web APIs
together with a domtimestamp indicating a time of measurement, the geolocationcoordinates object is part of the geolocationposition interface, which is the object type returned by geolocation api functions that obtain and return a geographical position.
GeolocationPositionError.code - Web APIs
syntax let typeerr = geolocationpositionerrorinstance.code value an unsigned short representing the error code.
Using the Geolocation API - Web APIs
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.
GeometryUtils - Web APIs
geometryutils is a raw interface and no object of this type can be created; it is implemented by text, element, csspseudoelement, and document objects.
GestureEvent - Web APIs
gesture event types gesturestart gesturechange gestureend specifications not part of any specification.
GlobalEventHandlers.onblur - Web APIs
html <input type="text" value="click here"> javascript let input = document.queryselector('input'); input.onblur = inputblur; input.onfocus = inputfocus; function inputblur() { input.value = 'focus has been lost'; } function inputfocus() { input.value = 'focus is here'; } result try clicking in and out of the form field, and watch its contents change accordingly.
GlobalEventHandlers.onchange - Web APIs
html <input type="text" placeholder="type something here, then click outside of the field." size="50"> <p id="log"></p> javascript let input = document.queryselector('input'); let log = document.getelementbyid('log'); input.onchange = handlechange; function handlechange(e) { log.textcontent = `the field's value is ${e.target.value.length} character(s) long.`; } result specification speci...
GlobalEventHandlers.ondrag - Web APIs
<!doctype html> <html lang=en> <title>examples of using the ondrag global event attribute</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function drag_handler(ev) { console.log("drag"); } function dragstart_handler(ev) { console.log("dragstart"); ev.datatransfer.setdata("text", ev.target.id); } function drop_handler(ev) { c...
GlobalEventHandlers.ondragend - Web APIs
<!doctype html> <html lang=en> <title>examples of using the drag and drop global event attribute</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function dragstart_handler(ev) { console.log("dragstart"); // change the source element's background color to signify drag has started ev.currenttarget.style.bor...
GlobalEventHandlers.ondragenter - Web APIs
<!doctype html> <html lang=en> <title>examples of using the drag and drop global event attribute</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function dragstart_handler(ev) { console.log("dragstart"); // change the source element's background color to signify drag has started ev.currenttarge...
GlobalEventHandlers.ondragexit - Web APIs
<!doctype html> <html lang=en> <title>examples of using the drag and drop global event attribute</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function dragstart_handler(ev) { console.log("dragstart"); // change the sourc...
GlobalEventHandlers.ondragleave - Web APIs
<!doctype html> <html lang=en> <title>examples of using the drag and drop global event attribute</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function dragstart_handler(ev) { console.log("dragstart"); // change the source element's border to signify drag has started ev.currenttarget.style.bo...
GlobalEventHandlers.ondragover - Web APIs
<!doctype html> <html lang=en> <title>examples of using the ondrag global event attribute</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function drag_handler(ev) { console.log("drag"); } function dragstart_handler(ev) { console.log("dragstart"); ev.datatransfer.setdata("text", ev.target.id); } fun...
GlobalEventHandlers.ondragstart - Web APIs
<!doctype html> <html lang=en> <title>examples of using the ondrag global event attribute</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function drag_handler(ev) { console.log("drag"); } function dragstart_handler(ev) { console.log("dragstart"); ev.datatransfer.setdata("text", ev.target.id);...
GlobalEventHandlers.ondrop - Web APIs
<!doctype html> <html lang=en> <title>examples of using the ondrag global event attribute</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function drag_handler(ev) { console.log("drag"); } function dragstart_handler(ev) { console.log("dragstart"); ev.datatransfer.setdata("text", ev.target.id); } function drop_handler(ev) { co...
GlobalEventHandlers.onfocus - Web APIs
html <input type="text" value="click here"> javascript let input = document.queryselector('input'); input.onblur = inputblur; input.onfocus = inputfocus; function inputblur() { input.value = 'focus has been lost'; } function inputfocus() { input.value = 'focus is here'; } result try clicking in and out of the form field, and watch its contents change accordingly.
GlobalEventHandlers.oninput - Web APIs
html <input type="text" placeholder="type something here to see its length." size="50"> <p id="log"></p> javascript let input = document.queryselector('input'); let log = document.getelementbyid('log'); input.oninput = handleinput; function handleinput(e) { log.textcontent = `the field's value is ${e.target.value.length} character(s) long.`; } result specifications specification statu...
GlobalEventHandlers.oninvalid - Web APIs
html <form id="form"> <p id="error" hidden>please fill out all fields.</p> <label for="city">city</label> <input type="text" id="city" required> <button type="submit">submit</button> </form> <p id="thanks" hidden>your data has been received.
GlobalEventHandlers.onload - Web APIs
examples window.onload = function() { init(); dosomethingelse(); }; <!doctype html> <html> <head> <title>onload test</title> // es5 <script> function load() { console.log("load event detected!"); } window.onload = load; </script> // es2015 <script> const load = () => { console.log("load event detected!"); } window.onload = load; </script> </head> <body> <p>the load event fires when th...
GlobalEventHandlers.onplay - Web APIs
example <p>this example demonstrates how to assign an "onplay" event to a video element.</p> <video controls onplay="alertplay()"> <source src="mov_bbb.mp4" type="video/mp4"> <source src="mov_bbb.ogg" type="video/ogg"> your browser does not support html5 video.
GlobalEventHandlers.onselect - Web APIs
the select event only fires after text inside an <input type="text"> or <textarea> is selected.
GlobalEventHandlers.onsubmit - Web APIs
html <form id="form"> <p id="error" hidden>please fill out all fields.</p> <label for="city">city</label> <input type="text" id="city" required> <button type="submit">submit</button> </form> <p id="thanks" hidden>your data has been received.
HTMLAnchorElement.rel - Web APIs
it is a domstring containing a space-separated list of link types indicating the relationship between the resource represented by the <a> element and the current document.
HTMLAnchorElement - Web APIs
htmlanchorelement.type is a domstring that reflects the type html attribute, indicating the mime type of the linked resource.
HTMLAreaElement.rel - Web APIs
it is a domstring containing a space-separated list of link types indicating the relationship between the resource represented by the <area> element and the current document.
HTMLAreaElement.relList - Web APIs
it is a live domtokenlist containing the set of link types indicating the relationship between the resource represented by the <area> element and the current document.
HTMLCanvasElement.mozOpaque - Web APIs
for example, you could conditionally set it to true if mimetype == 'image/jpeg', or similar, to gain performance in your application when translucency is not needed.
HTMLDialogElement.close() - Web APIs
dialog id="favdialog"> <form method="dialog"> <section> <p><label for="favanimal">favorite animal:</label> <select id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select></p> </section> <menu> <button id="cancel" type="reset">cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); ...
HTMLDialogElement: close event - Web APIs
bubbles no cancelable no interface event event handler property onclose examples live example html <dialog class="example-dialog"> <button class="close" type="reset">close</button> </dialog> <button class="open-dialog">open dialog</button> <div class="result"></div> css button, div { margin: .5rem; } js const result = document.queryselector('.result'); const dialog = document.queryselector('.example-dialog'); dialog.addeventlistener('close', (event) => { result.textcontent = 'dialog was closed'; }); const opendialog = document.queryselector('.open-dialog'); opendialog.addeventlistener('click', () => { if (typ...
HTMLDialogElement.open - Web APIs
dialog id="favdialog"> <form method="dialog"> <section> <p><label for="favanimal">favorite animal:</label> <select id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select></p> </section> <menu> <button id="cancel" type="reset">cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); ...
HTMLDialogElement.show() - Web APIs
dialog id="favdialog"> <form method="dialog"> <section> <p><label for="favanimal">favorite animal:</label> <select id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select></p> </section> <menu> <button id="cancel" type="reset">cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); ...
HTMLDialogElement.showModal() - Web APIs
dialog id="favdialog"> <form method="dialog"> <section> <p><label for="favanimal">favorite animal:</label> <select id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select></p> </section> <menu> <button id="cancel" type="reset">cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); ...
HTMLDialogElement - Web APIs
dialog id="favdialog"> <form method="dialog"> <section> <p><label for="favanimal">favorite animal:</label> <select id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select></p> </section> <menu> <button id="cancel" type="reset">cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); ...
HTMLElement: animationcancel event - Web APIs
erty instead of addeventlistener(): const animated = document.queryselector('.animated'); animated.onanimationcancel = () => { console.log('animation canceled'); }; animated.style.display = 'none'; live example html <div class="animation-example"> <div class="container"> <p class="animation">you chose a cold night to visit our planet.</p> </div> <button class="activate" type="button">activate animation</button> <div class="event-log"></div> </div> css .container { height: 3rem; } .event-log { width: 25rem; height: 2rem; border: 1px solid black; margin: 0.2rem; padding: 0.2rem; } .animation.active { animation-duration: 2s; animation-name: slidein; animation-iteration-count: 2; } @keyframes slidein { from { transform: translatex(100%) ...
HTMLElement: animationend event - Web APIs
ded'); }); the same, but using the onanimationend event handler property: const animated = document.queryselector('.animated'); animated.onanimationend = () => { console.log('animation ended'); }; live example html <div class="animation-example"> <div class="container"> <p class="animation">you chose a cold night to visit our planet.</p> </div> <button class="activate" type="button">activate animation</button> <div class="event-log"></div> </div> css .container { height: 3rem; } .event-log { width: 25rem; height: 2rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .animation.active { animation-duration: 2s; animation-name: slidein; animation-iteration-count: 2; } @keyframes slidein { from { margin-left: 100%; width: ...
HTMLElement: animationiteration event - Web APIs
t animated = document.queryselector('.animated'); let iterationcount = 0; animated.onanimationiteration = () => { iterationcount++; console.log(`animation iteration count: ${iterationcount}`); }; live example html <div class="animation-example"> <div class="container"> <p class="animation">you chose a cold night to visit our planet.</p> </div> <button class="activate" type="button">activate animation</button> <div class="event-log"></div> </div> css .container { height: 3rem; } .event-log { width: 25rem; height: 2rem; border: 1px solid black; margin: 0.2rem; padding: 0.2rem; } .animation.active { animation-duration: 2s; animation-name: slidein; animation-iteration-count: 2; } @keyframes slidein { from { transform: translatex(100%) ...
HTMLElement: animationstart event - Web APIs
log('animation started'); }); the same, but using onanimationstart: const animated = document.queryselector('.animated'); animated.onanimationstart = () => { console.log('animation started'); }; live example html <div class="animation-example"> <div class="container"> <p class="animation">you chose a cold night to visit our planet.</p> </div> <button class="activate" type="button">activate animation</button> <div class="event-log"></div> </div> css .container { height: 3rem; } .event-log { width: 25rem; height: 2rem; border: 1px solid black; margin: 0.2rem; padding: 0.2rem; } .animation.active { animation-duration: 2s; animation-name: slidein; animation-iteration-count: 2; } @keyframes slidein { from { transform: translatex(100%) ...
HTMLElement.click() - Web APIs
WebAPIHTMLElementclick
syntax element.click() example simulate a mouse-click when moving the mouse pointer over a checkbox: html <form> <input type="checkbox" id="mycheck" onmouseover="myfunction()" onclick="alert('click event occured')"> </form> javascript // on mouse-over, execute myfunction function myfunction() { document.getelementbyid("mycheck").click(); } specification specification status comment html living standard living standard document object model (dom) level 2 html specificat...
HTMLElement.offsetLeft - Web APIs
</span> <span id="longspan">long span that wraps within this div.</span> </div> <div id="box" style="position: absolute; border-color: red; border-width: 1; border-style: solid; z-index: 10"> </div> <script type="text/javascript"> var box = document.getelementbyid("box"); var longspan = document.getelementbyid("longspan"); box.style.left = longspan.offsetleft + document.body.scrollleft + "px"; box.style.top = longspan.offsettop + document.body.scrolltop + "px"; box.style.width = longspan.offsetwidth + "px"; box.style.height = longspan.offsetheight + "px"; </script> specification s...
HTMLElement: pointermove event - Web APIs
bubbles yes cancelable yes interface pointerevent event handler property onpointermove usage notes the event, which is of type pointerevent, provides all the information you need to know about the user's interaction with the pointing device, including the position, movement distance, button states, and much more.
HTMLEmbedElement - Web APIs
htmlembedelement.type is a domstring that reflects the type html attribute, containing the type of the resource.
HTMLFormControlsCollection.namedItem() - Web APIs
example html <form> <input id="my-form-control" type="textarea"> </form> javascript // returns the htmlinputelement representing #my-form-control elem1 = document.forms[0]['my-form-control']; specifications specification status comment html living standardthe definition of 'htmlformcontrolscollection.nameditem()' in that specification.
HTMLFormElement.encoding - Web APIs
the htmlformelement.encoding property is an alternative name for the enctype element on the dom htmlformelement object.
HTMLFormElement.length - Web APIs
the elements included by htmlformelement.elements and htmlformelement.length are the following: <button> <fieldset> <input> (with the exception that any whose type is "image" are omitted for historical reasons) <object> <output> <select> <textarea> no other elements are included in the list returned by elements, which makes it an excellent way to get at the elements most important when processing forms.
HTMLFormElement: reset event - Web APIs
html <form id="form"> <label>test field: <input type="text"></label> <br><br> <button type="reset">reset form</button> </form> <p id="log"></p> javascript function logreset(event) { log.textcontent = `form reset!
HTMLFormElement.submit() - Web APIs
<input> with attribute type="submit" will not be submitted with the form when using htmlformelement.submit(), but it would be submitted when you do it with original html form submit.
HTMLHtmlElement.version - Web APIs
returns version information about the document type definition (dtd) of a document.
HTMLHtmlElement - Web APIs
htmlhtmlelement.version is a domstring representing the version of the html document type definition (dtd) that governs this document.
HTMLHyperlinkElementUtils - Web APIs
there are no objects of this type, but several objects such as htmlanchorelement and htmlareaelement implement it.
srcdoc - Web APIs
examples var iframe = document.createelement("iframe"); iframe.srcdoc = `<!doctype html><p>hello world!</p>`; document.body.appendchild(iframe); specifications specification status comment html living standardthe definition of 'htmliframeelement: srcdoc' in that specification.
HTMLInputElement: invalid event - Web APIs
html <form action="#"> <ul> <li><label>enter an integer between 1 and 10: <input type="number" min="1" max="10" required></label></li> <li><input type="submit" value="submit"></li> </ul> </form><p id="log"></p> javascript const input = document.queryselector('input') const log = document.getelementbyid('log') input.addeventlistener('invalid', logvalue) function logvalue(e) { log.textcontent += e.target.value } result specifications specification status...
HTMLInputElement.select() - Web APIs
html <input type="text" id="text-box" size="20" value="hello world!"> <button onclick="selecttext()">select text</button> javascript function selecttext() { const input = document.getelementbyid('text-box'); input.focus(); input.select(); } result notes calling element.select() will not necessarily focus the input, so it is often used with htmlelement.focus().
HTMLInputElement.setRangeText() - Web APIs
html <input type="text" id="text-box" size="30" value="this text has not been updated."> <button onclick="selecttext()">update text</button> javascript function selecttext() { const input = document.getelementbyid('text-box'); input.focus(); input.setrangetext('already', 14, 17, 'select'); } result specifications specification status comment html living standardthe defini...
HTMLInputElement.webkitdirectory - Web APIs
html content <input type="file" id="filepicker" name="filelist" webkitdirectory multiple /> <ul id="listing"></ul> javascript content document.getelementbyid("filepicker").addeventlistener("change", function(event) { let output = document.getelementbyid("listing"); let files = event.target.files; for (let i=0; i<files.length; i++) { let item = document.createelement("li"); item.innerhtml = files[i].webki...
HTMLLabelElement.control - Web APIs
the read-only htmllabelelement.control property returns a reference to the control (in the form of an object of type htmlelement or one of its derivatives) with which the <label> element is associated, or null if the label isn't associated with a control.
HTMLLinkElement.as - Web APIs
the as property of the htmllinkelement interface returns a domstring representing the type of content being loaded by the html link, one of "script", "style", "image", "video", "audio", "track", "font", "fetch".
HTMLLinkElement.rel - Web APIs
it is a domstring containing a space-separated list of link types indicating the relationship between the resource represented by the <link> element and the current document.
HTMLLinkElement.relList - Web APIs
it is a live domtokenlist containing the set of link types indicating the relationship between the resource represented by the <link> element and the current document.
HTMLMediaElement: abort event - Web APIs
cancelable no interface event event handler property onabort examples const video = document.queryselector('video'); const videosrc = 'https://path/to/video.webm'; video.addeventlistener('abort', () => { console.log(`abort loading: ${videosrc}`); }); const source = document.createelement('source'); source.setattribute('src', videosrc); source.setattribute('type', 'video/webm'); video.appendchild(source); specifications specification status html living standard living standard html5 recommendation ...
HTMLMediaElement: loadedmetadata event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onloadedmetadata specification html5 media additional properties property type description mozchannels read only int the number of channels.
HTMLMediaElement.networkState - Web APIs
<audio id="example" preload="auto"> <source src="sound.ogg" type="audio/ogg" /> </audio> var obj = document.getelementbyid('example'); obj.addeventlistener('playing', function() { if (obj.networkstate === 2) { // still loading...
HTMLMediaElement.readyState - Web APIs
<audio id="example" preload="auto"> <source src="sound.ogg" type="audio/ogg" /> </audio> var obj = document.getelementbyid('example'); obj.addeventlistener('loadeddata', function() { if(obj.readystate >= 2) { obj.play(); } }); specifications specification status comment html living standardthe definition of 'htmlmediaelement.readystate' in that specification.
HTMLMediaElement.srcObject - Web APIs
const mediasource = new mediasource(); const video = document.createelement('video'); // older browsers may not have srcobject if ('srcobject' in video) { try { video.srcobject = mediasource; } catch (err) { if (err.name != "typeerror") { throw err; } // even if they do, they may only support mediastream video.src = url.createobjecturl(mediasource); } } else { video.src = url.createobjecturl(mediasource); } specifications specification status comment html living standardthe definition of 'srcobject' in that specification.
HTMLMediaElement - Web APIs
htmlmediaelement.canplaytype() given a string specifying a mime media type (potentially with the codecs parameter included), canplaytype() returns the string probably if the media should be playable, maybe if there's not enough information to determine whether the media will play or not, or an empty string if the media cannot be played.
HTMLMenuElement - Web APIs
removed the context type.
HTMLMetaElement - Web APIs
name type description content domstring gets or sets the value of meta-data property.
HTMLOListElement - Web APIs
htmlolistelement.type is a domstring value reflecting the type and defining the kind of marker to be used to display.
HTMLOptionsCollection - Web APIs
rget="_top"><rect x="181" y="1" width="210" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="286" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmloptionscollection</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties name type description length unsigned long as optionally allowed by the spec, this property isn't read-only.
HTMLElement.blur() - Web APIs
syntax element.blur(); examples remove focus from a text input html <input type="text" id="mytext" value="sample text"> <br><br> <button type="button" onclick="focusinput()">click me to gain focus</button> <button type="button" onclick="blurinput()">click me to lose focus</button> javascript function focusinput() { document.getelementbyid('mytext').focus(); } function blurinput() { document.getelementbyid('mytext').blur(); } result specification specification status comment html living standardthe definition of 'blur' in that specification.
HTMLOrForeignElement - Web APIs
note: htmlorforeignelement is a mixin and not an interface; you can't actually create an object of type htmlorforeignelement.
HTMLOutputElement - Web APIs
htmloutputelement.typeread only the domstring "output".
HTMLSelectElement.disabled - Web APIs
<input id="allow-drinks" type="checkbox"/> </label> <label for="drink-select">drink selection:</label> <select id="drink-select" disabled> <option value="1">water</option> <option value="2">beer</option> <option value="3">pepsi</option> <option value="4">whisky</option> </select> javascript var allowdrinkscheckbox = document.getelementbyid("allow-drinks"); var drinkselect = document.getelementbyid("drink-select"); allowdrinkscheckbox.addeventlistener("change", fun...
HTMLSelectElement.item() - Web APIs
examples html <form> <select id="myformcontrol" type="textarea"> <option id="o1">opt 1</option> <option id="o2">opt 2</option> </select> </form> javascript // returns the htmloptionelement representing #o2 elem1 = document.forms[0]['myformcontrol'][1]; specifications specification status comment html living standardthe definition of 'htmlselectelement.item()' in that specification.
HTMLSelectElement - Web APIs
htmlselectelement.typeread only a domstring represeting the form control's type.
HTMLStyleElement.media - Web APIs
example <!doctype html> <html> <head> <link id="linkedstyle" rel="stylesheet" href="document.css" type="text/css" media="screen" /> <style id="inlinestyle" rel="stylesheet" type="text/css" media="screen, print"> p { color: blue; } </style> </head> <body> <script> alert('linkedstyle: ' + document.getelementbyid('linkedstyle').media); // 'screen' alert('inlinestyle: ' + document.getelementbyid('inlinestyle').media); // 'screen, print' </script> </body> </html> specifications specification status comment html living standa...
HTMLStyleElement - Web APIs
htmlstyleelement.type is a domstring representing the type of style being applied by this statement.
onMSVideoFormatChanged - Web APIs
syntax value description event property object.onmsvideoformatchanged = handler; attachevent method object.attachevent("onmsvideoformatchanged", handler) addeventlistener method object.addeventlistener("", handler, usecapture) event handler parameters val[in], type=function see also htmlvideoelement microsoft api extensions ...
onMSVideoFrameStepCompleted - Web APIs
syntax value description event property object.onmsvideoframestepcompleted = handler; attachevent method object.attachevent("onmsvideoframestepcompleted", handler) addeventlistener method object.addeventlistener("", handler, usecapture) event handler parameters val[in], type=function see also htmlvideoelement microsoft api extensions ...
HashChangeEvent - Web APIs
if ( newhash != oldhash && typeof window.onhashchange === "function" ) { // execute the handler window.onhashchange({ type: "hashchange", oldurl: oldurl, newurl: newurl }); oldurl = newurl; oldhash = newhash; } }, 100); })(window); specifications specification status comment html living standardthe definition of 'hashchangeevent' in that...
Headers.append() - Web APIs
WebAPIHeadersappend
example creating an empty headers object is simple: var myheaders = new headers(); // currently empty you could add a header to this using append(): myheaders.append('content-type', 'image/jpeg'); myheaders.get('content-type'); // returns 'image/jpeg' if the specified header already exists, append() will change its value to the specified value.
Headers.entries() - Web APIs
WebAPIHeadersentries
example // create a test headers object var myheaders = new headers(); myheaders.append('content-type', 'text/xml'); myheaders.append('vary', 'accept-language'); // display the key/value pairs for (var pair of myheaders.entries()) { console.log(pair[0]+ ': '+ pair[1]); } the result is: content-type: text/xml vary: accept-language ...
Headers.keys() - Web APIs
WebAPIHeaderskeys
example // create a test headers object var myheaders = new headers(); myheaders.append('content-type', 'text/xml'); myheaders.append('vary', 'accept-language'); // display the keys for(var key of myheaders.keys()) { console.log(key); } the result is: content-type vary ...
Headers.values() - Web APIs
WebAPIHeadersvalues
example // create a test headers object var myheaders = new headers(); myheaders.append('content-type', 'text/xml'); myheaders.append('vary', 'accept-language'); // display the values for (var value of myheaders.values()) { console.log(value); } the result is: text/xml accept-language ...
IDBCursor.continue() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive.
IDBCursor.continuePrimaryKey() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive.
IDBCursor.delete() - Web APIs
WebAPIIDBCursordelete
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive.
IDBCursor.update() - Web APIs
WebAPIIDBCursorupdate
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive.
IDBCursorSync - Web APIs
method overview bool continue (in optional any key); void remove () raises (idbdatabaseexception); attributes attribute type description count readonly unsigned long long the total number of objects that share the current key.
IDBDatabase.createObjectStore() - Web APIs
exceptions this method may raise a domexception with a domerror of one of the following types: exception description invalidstateerror occurs if the method was not called from a versionchange transaction callback.
IDBDatabase.deleteObjectStore() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror occurs if the method was not called from a versionchange transaction callback.
IDBDatabaseException - Web APIs
attributes attribute type description code unsigned short the most appropriate error code for the condition.
IDBDatabaseSync - Web APIs
mstring name, in optional unsigned short mode) raises (idbdatabaseexception); void removeobjectstore (in domstring storename) raises (idbdatabaseexception); void setversion (in domstring version); idbtransactionsync transaction (in optional domstringlist storenames, in optional unsigned int timeout) raises (idbdatabaseexception); attributes attribute type description description readonly domstring the human-readable description of the connected database.
IDBEnvironmentSync - Web APIs
attributes attribute type description indexeddbsync readonly idbfactorysync provides a synchronous means of accessing the capabilities of indexed databases.
IDBFactory.cmp() - Web APIs
WebAPIIDBFactorycmp
return value an integer that indicates the result of the comparison; the table below lists the possible values and their meanings: returned value description -1 1st key is less than the 2nd key 0 1st key is equal to the 2nd key 1 1st key is greater than the 2nd key exceptions this method may raise a domexception of the following types: attribute description dataerror one of the supplied keys was not a valid key.
databases - Web APIs
exceptions this method may raise a domexception of the following types: attribute description securityerror the method is called from an opaque origin.
IDBIndex.count() - Web APIs
WebAPIIDBIndexcount
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive.
IDBIndex.get() - Web APIs
WebAPIIDBIndexget
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive.
IDBIndex.getKey() - Web APIs
WebAPIIDBIndexgetKey
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive.
IDBIndex.keyPath - Web APIs
WebAPIIDBIndexkeyPath
syntax var mykeypath = myindex.keypath; value any data type that can be used as a key path.
IDBIndexSync - Web APIs
e range, in optional unsigned short direction) raises (idbdatabaseexception); void openobjectcursor (in optional idbkeyrange range, in optional unsigned short direction) raises (idbdatabaseexception); any put (in any value, in optional any key) raises (idbdatabaseexception); void remove (in any key) raises (idbdatabaseexception); attributes attribute type description keypath readonly domstring the key path of this index.
IDBKeyRange.bound() - Web APIs
WebAPIIDBKeyRangebound
exceptions this method may raise a domexception of the following type: exception description dataerror the following conditions raise an exception: the lower or upper parameters were not passed a valid key.
IDBKeyRange.lower - Web APIs
WebAPIIDBKeyRangelower
syntax var lower = mykeyrange.lower value the lower bound of the key range (can be any type.) example the following example illustrates how you'd use a key range.
IDBKeyRange.lowerBound() - Web APIs
exceptions this method may raise a domexception of the following type: exception description dataerror the value parameter passed was not a valid key.
IDBKeyRange.only() - Web APIs
WebAPIIDBKeyRangeonly
exceptions this method may raise a domexception of the following types: exception description dataerror the value parameter passed was not a valid key.
IDBKeyRange.upper - Web APIs
WebAPIIDBKeyRangeupper
syntax var upper = mykeyrange.upper value the upper bound of the key range (can be any type.) example the following example illustrates how you'd use a key range.
IDBKeyRange.upperBound() - Web APIs
exceptions this method may raise a domexception of the following type: exception description dataerror the value parameter passed was not a valid key.
IDBKeyRange - Web APIs
the idbkeyrange interface of the indexeddb api represents a continuous interval over some data type that is used for keys.
IDBMutableFile - Web APIs
mutablefile.type read only the mime type of the handled file.
IDBObjectStore.add() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description readonlyerror the transaction associated with this operation is in read-only mode.
IDBObjectStore.clear() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description readonlyerror the transaction associated with this operation is in read-only mode.
IDBObjectStore.count() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror this idbobjectstore has been deleted.
IDBObjectStore.delete() - Web APIs
exceptions this method may raise a domexception of the following types: exception description transactioninactiveerror this object store's transaction is inactive.
IDBObjectStore.deleteIndex() - Web APIs
return value undefined exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror occurs if the method was not called from a versionchange transaction mode callback.
IDBObjectStore.get() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive.
IDBObjectStore.getKey() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive.
IDBObjectStore.index() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror the source object store has been deleted, or the transaction for the object store has finished.
IDBObjectStore.keyPath - Web APIs
syntax var mykeypath = objectstore.keypath; value any value type.
IDBObjectStore.openCursor() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror this idbobjectstore or idbindex has been deleted.
IDBObjectStore.openKeyCursor() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror this idbobjectstore or idbindex has been deleted.
IDBObjectStore.put() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description readonlyerror the transaction associated with this operation is in read-only mode.
IDBObjectStoreSync - Web APIs
direction) raises (idbdatabaseexception); idbindexsync openindex (in domstring name) raises (idbdatabaseexception); any put (in any value, in optional any key) raises (idbdatabaseexception); void remove (in any key) raises (idbdatabaseexception); void removeindex (in domstring indexname) raises (idbdatabaseexception); attributes attribute type description indexnames readonly domstringlist a list of the names of the indexes on this object store.
IDBRequest.error - Web APIs
WebAPIIDBRequesterror
it's an exception type for creating stores and indexes.
IDBRequest.onerror - Web APIs
the event handler takes one parameter, an error event with type="error".
IDBRequest.onsuccess - Web APIs
the event handler takes one parameter, a success event with type="success".
IDBTransaction.abort() - Web APIs
syntax transaction.abort(); exceptions this method may raise a domexception of the following type: exception description invalidstateerror the transaction has already been committed or aborted.
IDBTransaction.error - Web APIs
the idbtransaction.error property of the idbtransaction interface returns one of several types of error when there is an unsuccessful transaction.
IDBTransaction.objectStore() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description notfounderror the requested object store is not in this transaction's scope.
IDBTransaction - Web APIs
idbtransaction.error read only returns a domexception indicating the type of error that occured when there is an unsuccessful transaction.
IDBTransactionSync - Web APIs
method overview void abort() raises (idbdatabaseexception); void commit() raises (idbdatabaseexception); idbobjectstoresync objectstore(in domstring name) raises (idbdatabaseexception); attributes attribute type description db idbdatabasesync the database connection that this transaction is associated with.
IDBVersionChangeRequest - Web APIs
attributes attribute type description onblocked function the event handler for the blocked event.
IIRFilterNode - Web APIs
the iirfilternode interface of the web audio api is a audionode processor which implements a general infinite impulse response (iir) filter; this type of filter can be used to implement tone control devices and graphic equalizers as well.
IdleDeadline - Web APIs
the idledeadline interface is used as the data type of the input parameter to idle callbacks established by calling window.requestidlecallback().
ImageCapture.getPhotoCapabilities() - Web APIs
const input = document.queryselector('input[type="range"]'); var imagecapture; navigator.mediadevices.getusermedia({video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream; const track = mediastream.getvideotracks()[0]; imagecapture = new imagecapture(track); return imagecapture.getphotocapabilities(); }) .then(photocapabilities => { const settings = imagecapture.track.getsettings(); input.m...
ImageCapture.getPhotoSettings() - Web APIs
const input = document.queryselector('input[type="range"]'); var imagecapture; navigator.mediadevices.getusermedia({video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream; const track = mediastream.getvideotracks()[0]; imagecapture = new imagecapture(track); return imagecapture.getphotocapabilities(); }) .then(photocapabilities => { const settings = imagecapture.track.getsettings(); input.m...
ImageData() - Web APIs
the imagedata() constructor returns a newly instantiated imagedata object built from the typed array given and having the specified width and height.
Checking when a deadline is due - Web APIs
on browsers that support type="number", you get a nice little up and down arrow number picker.
InputDeviceCapabilities API - Web APIs
input device capabilities concepts and usage because dom events abstract device input, they provide no way to learn what device or type of device fired an event.
InputEvent.data - Web APIs
WebAPIInputEventdata
<p>some text to copy and paste.</p> <input type="text"> <p class="result"></p> var editable = document.queryselector('input') var result = document.queryselector('.result'); editable.addeventlistener('input', (e) => { result.textcontent = "inputted text: " + e.data; }); specifications specification status comment input events level 2the definition of 'data' in that specification.
InstallEvent.InstallEvent() - Web APIs
syntax var myinstallevent = new installevent(type, init); parameters type the type of the event.
installChrome - Web APIs
method of installtrigger object syntax int installchrome( type, url, name ) parameters the installchrome method has the following parameters: type type can be installtrigger.skin or installtrigger.locale.
Timing element visibility with the Intersection Observer API - Web APIs
we iterate over each of those entries—which are of type intersectionobserverentry.
Intersection Observer API - Web APIs
objects of this type can only be obtained in two ways: as an input to your intersectionobserver callback, or by calling intersectionobserver.takerecords().
InterventionReportBody - Web APIs
examples let options = { types: ['intervention'], buffered: true } let observer = new reportingobserver(function(reports, observer) { let firstreport = reports[0]; console.log(firstreport.type); // intervention console.log(firstreport.body.id); console.log(firstreport.body.message); console.log(firstreport.body.sourcefile); console.log(firstreport.body.linenumber); console.log(firstreport.body.columnnumber); ...
KeyboardEvent.altKey - Web APIs
syntax var altkeypressed = instanceofkeyboardevent.altkey return value boolean examples <html> <head> <title>altkey example</title> <script type="text/javascript"> function showchar(e){ alert( "key keydown: " + string.fromcharcode(e.charcode) + "\n" + "charcode: " + e.charcode + "\n" + "alt key keydown: " + e.altkey + "\n" ); } </script> </head> <body onkeydown="showchar(event);"> <p> press any character key, with or without holding down the alt key.<br /> you can also use the shift key together with the alt key.
KeyboardEvent.charCode - Web APIs
example html <p>type anything into the input box below to log a <code>charcode</code>.</p> <input type="text" /> <p id="log"></p> javascript let input = document.queryselector('input'); let log = document.queryselector('#log'); input.addeventlistener('keypress', function(e) { log.innertext = `key pressed: ${string.fromcharcode(e.charcode)}\ncharcode: ${e.charcode}`; }); result notes in a keypress event, the unicode val...
KeyboardEvent.ctrlKey - Web APIs
syntax var ctrlkeypressed = instanceofkeyboardevent.ctrlkey return value a boolean example <html> <head> <title>ctrlkey example</title> <script type="text/javascript"> function showchar(e){ alert( "key pressed: " + e.key + "\n" + "ctrl key pressed: " + e.ctrlkey + "\n" ); } </script> </head> <body onkeypress="showchar(event);"> <p>press any character key, with or without holding down the ctrl key.<br /> you can also use the shift key together with the ctrl key.</p> </body> </html> specifications specification status comment document object model (dom) level 3 events specificationthe definiti...
KeyboardEvent.initKeyboardEvent() - Web APIs
syntax kbdevent.initkeyboardevent(typearg, canbubblearg, cancelablearg, viewarg, chararg, keyarg, locationarg, modifierslistarg, repeat) parameters typearg the type of keyboard event; this will be one of keydown, keypress, or keyup.
KeyboardEvent.shiftKey - Web APIs
syntax var shiftkeypressed = instanceofkeyboardevent.shiftkey return value a boolean example <html> <head> <title>shiftkey example</title> <script type="text/javascript"> function showchar(e){ alert( "key pressed: " + string.fromcharcode(e.charcode) + "\n" + "charcode: " + e.charcode + "\n" + "shift key pressed: " + e.shiftkey + "\n" + "alt key pressed: " + e.altkey + "\n" ); } </script> </head> <body onkeypress="showchar(event);"> <p>press any character key, with or without holding down the shift key.<br /> you can also use the shift key together with the alt key.</p> </body> </html> specifications sp...
KeyboardEvent.which - Web APIs
example <html> <head> <title>charcode/keycode/which example</title> <script type="text/javascript"> function showkeypress(evt) { alert("onkeypress handler: \n" + "keycode property: " + evt.keycode + "\n" + "which property: " + evt.which + "\n" + "charcode property: " + evt.charcode + "\n" + "character key pressed: " + string.fromcharcode(evt.charcode) + "\n" ); } function keydown(evt) { alert("onkeydown handler: \n" + "keycode prope...
KeyboardLayoutMap.entries - Web APIs
the entries read-only property of the keyboardlayoutmap interface 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).
KeyboardLayoutMap - Web APIs
properties keyboardlayoutmap.entries read only 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).
KeyframeEffect.setKeyframes() - Web APIs
exceptions exception explanation typeerror one or more of the frames were not of the correct type of object, the keyframes were not loosely sorted by offset, or a keyframe existed with an offset of less than 0 or more than 1.
LinkStyle - Web APIs
WebAPILinkStyle
linkstyle is a raw interface and no object of this type can be created; it is implemented by htmllinkelement and htmlstyleelement objects.
Long Tasks API - Web APIs
} }); // register observer for long task notifications observer.observe({entrytypes: ["longtask"]}); // long script execution after this will result in queueing // and receiving "longtask" entries in the observer.
MSCandidateWindowHide - Web APIs
syntax event property object.oncandidatewindowhide = handler; addeventlistener method object.addeventlistener("mscandidatewindowhide", handler, usecapture) nbsp; parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interface for the current event.
MSCandidateWindowShow - Web APIs
syntax event property object.oncandidatewindowshow = handler; addeventlistener method object.addeventlistener("mscandidatewindowshow", handler, usecapture) parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interface for the current event.
MSCandidateWindowUpdate - Web APIs
syntax event property object.oncandidatewindowupdate = handler; addeventlistener method object.addeventlistener("mscandidatewindowupdate", handler, usecapture) parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interface for the current event.
MSGestureEvent - Web APIs
gesture event types msgesturestart msgestureend msgesturetap msgesturehold msgesturechange msinertiastart specifications not part of any specification.
MSManipulationEvent - Web APIs
example interface msmanipulationevent extends uievent { readonly currentstate: number; readonly inertiadestinationx: number; readonly inertiadestinationy: number; readonly laststate: number; initmsmanipulationevent(typearg: string, canbubblearg: boolean, cancelablearg: boolean, viewarg: window, detailarg: number, laststate: number, currentstate: number): void; readonly ms_manipulation_state_active: number; readonly ms_manipulation_state_cancelled: number; readonly ms_manipulation_state_committed: number; readonly ms_manipulation_state_dragging: number; readonly ms_manipulation_state_inertia: ...
MediaDevices.getDisplayMedia() - Web APIs
typeerror the specified constraints include constraints which are not permitted when calling getdisplaymedia().
MediaDevices - Web APIs
); } else if (error.name === 'permissiondeniederror') { errormsg('permissions have not been granted to use your camera and ' + 'microphone, you need to allow the page access to your devices in ' + 'order for the demo to work.'); } errormsg('getusermedia error: ' + error.name, error); }); function errormsg(msg, error) { errorelement.innerhtml += '<p>' + msg + '</p>'; if (typeof error !== 'undefined') { console.error(error); } } specifications specification status comment media capture and streamsthe definition of 'mediadevices' in that specification.
MediaError.code - Web APIs
WebAPIMediaErrorcode
syntax var myerror = mediaerror.code; value a numeric value indicating the general type of error which occurred.
msExtendedCode - Web APIs
value type: long; the platform specific error code.
MediaError - Web APIs
mediaerror.code a number which represents the general type of error that occurred, as follows: name value description media_err_aborted 1 the fetching of the associated resource was aborted by the user's request.
message - Web APIs
syntax var messagetype = mediakeymessageevent.messagetype; specifications specification status comment encrypted media extensionsthe definition of 'message' in that specification.
MediaKeyMessageEvent - Web APIs
mediakeymessageevent.messagetype read only indicates the type of message.
update() - Web APIs
}); parameters response an instance of type buffersource.
createSession() - Web APIs
syntax ​var mediakeysessionobject = mediakeys.createsession([mediakeysessiontype]); specifications specification status comment encrypted media extensionsthe definition of 'createsession()' in that specification.
setServerCertificate() - Web APIs
syntax mediakeys.setservercertificate([mediakeysessiontype]).then(function() { ...
MediaRecorder.ondataavailable - Web APIs
var chunks = []; mediarecorder.onstop = function(e) { console.log("data available after mediarecorder.stop() called."); var audio = document.createelement('audio'); audio.controls = true; var blob = new blob(chunks, { 'type' : 'audio/ogg; codecs=opus' }); var audiourl = window.url.createobjecturl(blob); audio.src = audiourl; console.log("recorder stopped"); } mediarecorder.ondataavailable = function(e) { chunks.push(e.data); } ...
MediaRecorder.onstop - Web APIs
mediarecorder.onstop = function(e) { console.log("data available after mediarecorder.stop() called."); var audio = document.createelement('audio'); audio.controls = true; var blob = new blob(chunks, { 'type' : 'audio/ogg; codecs=opus' }); var audiourl = window.url.createobjecturl(blob); audio.src = audiourl; console.log("recorder stopped"); } mediarecorder.ondataavailable = function(e) { chunks.push(e.data); } ...
MediaSettingsRange - Web APIs
const input = document.queryselector('input[type="range"]'); var imagecapture; navigator.mediadevices.getusermedia({video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream; const track = mediastream.getvideotracks()[0]; imagecapture = new imagecapture(track); return imagecapture.getphotocapabilities(); }) .then(photocapabilities => { const settings = imagecapture.track.getsettings(); input.m...
MediaSource.MediaSource() - Web APIs
simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) var video = document.queryselector('video'); var asseturl = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } ...
MediaSource.endOfStream() - Web APIs
example the following snippet is from a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) var asseturl = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var source...
MediaSource.readyState - Web APIs
example the following snippet is from a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var source...
MediaStream.addTrack() - Web APIs
the track is specified as a parameter of type mediastreamtrack.
MediaStream.getAudioTracks() - Web APIs
early versions of this api included a special audiostreamtrack interface which was used as the type for each entry in the list of audio streams; however, this has since been merged into the main mediastreamtrack interface.
MediaStream.getVideoTracks() - Web APIs
early versions of this api included a special videostreamtrack interface which was used as the type for each entry in the list of video streams; however, this has since been merged into the main mediastreamtrack interface.
MediaStreamConstraints.audio - Web APIs
syntax var audioconstraints = true | false | mediatrackconstraints; value the value of the audio property can be specified as either of two types: boolean if a boolean value is specified, it simply indicates whether or not an audio track should be included in the returned stream; if it's true, an audio track is included; if no audio source is available or if permission is not given to use the audio source, the call to getusermedia() will fail.
MediaStreamConstraints.video - Web APIs
syntax var videoconstraints = true | false | mediatrackconstraints; value the value of the video property can be specified as either of two types: boolean if a boolean value is specified, it simply indicates whether or not a video track should be included in the returned stream; if it's true, a video track is included; if no video source is available or if permission is not given to use the video source, the call to getusermedia() will fail.
MediaStreamTrack.kind - Web APIs
syntax const type = track.kind value the possible values are a domstring with on of the following values: "audio": the track is an audio track.
MediaStreamTrack.onoverconstrained - Web APIs
an event handler always has one single parameter, containing the event, here of type mediastreamerrorevent.
MediaStream Image Capture API - Web APIs
though a mediastream holds several types of tracks and provides multiple methods for retrieving them, the imagecapture constructor will throw a domexception of type notsupportederror if mediastreamtrack.kind is not "video".
MediaTrackSettings.cursor - Web APIs
syntax cursorsetting = mediatracksettings.cursor; value the value of cursor comes from the cursorcaptureconstraint enumerated string type, and may have one of the following values: always the mouse should always be visible in the video content of the {domxref("mediastream"), unless the mouse has moved outside the area of the content.
MediaTrackSettings - Web APIs
displaysurface a domstring which specifies the type of source the track contains; one of: application the stream contains all of the windows of the application chosen by the user rendered into the one video track.
Capabilities, constraints, and settings - Web APIs
logelement a <div> into which any error messages or other log-type output will be written.
Media Capture and Streams API (Media Stream) - Web APIs
mediastreamconstraints mediastreamevent mediastreamtrack mediastreamtrackevent mediatrackconstraints mediatracksettings mediatracksupportedconstraints overconstrainederror url early versions of the media capture and streams api specification included separate audiostreamtrack and videostreamtrack interfaces—each based upon mediastreamtrack—which represented streams of those types.
MessageEvent.data - Web APIs
WebAPIMessageEventdata
syntax var data = messageevent.data; value the data sent by the message emitter; this can be any data type.
MessagePort.onmessage - Web APIs
the onmessage event handler of the messageport interface is an eventlistener, called whenever an messageevent of type message is fired on the port — that is, when the port receives a message.
MessagePort.onmessageerror - Web APIs
the onmessageerror event handler of the messageport interface is an eventlistener, called whenever an messageevent of type messageerror is fired on the port—that is, when it receives a message that cannot be deserialized.
MessagePort.postMessage() - Web APIs
this can be of any basic data type.
Microsoft API extensions - Web APIs
ontentzoom msmanipulationevent msmanipulationstatechanged msmanipulationviewsenabled mspointerhover media apis htmlvideoelement.msframestep() htmlvideoelement.mshorizontalmirror htmlvideoelement.msinsertvideoeffect() htmlvideoelement.msislayoutoptimalforplayback htmlvideoelement.msisstereo3d htmlvideoelement.mszoom htmlaudioelement.msaudiocategory htmlaudioelement.msaudiodevicetype htmlmediaelement.mscleareffects() htmlmediaelement.msinsertaudioeffect() mediaerror.msextendedcode msgraphicstrust msgraphicstruststatus msisboxed msplaytodisabled msplaytopreferredsourceuri msplaytoprimary msplaytosource msrealtime mssetmediaprotectionmanager mssetvideorectangle msstereo3dpackingmode msstereo3drendermode onmsvideoformatchanged onmsvideoframestepcompleted onmsvi...
MouseEvent.buttons - Web APIs
html <p>click anywhere with one or more mouse buttons.</p> <pre id="log">buttons: </pre> javascript let log = document.createtextnode('?'); // let log = new text('?'); function logbuttons(e) { log.data = `${e.buttons} (${e.type})`; // log.nodevalue= `${e.buttons} (${e.type})`; } document.addeventlistener('mouseup', logbuttons); document.addeventlistener('mousedown', logbuttons); // document.addeventlistener('mousemove', logbuttons); document.queryselector('#log').appendchild(log) result specifications specification status comment document object model (dom) level 3 events specificationthe...
MouseEvent.mozInputSource - Web APIs
the mouseevent.mozinputsource read-only property on mouseevent provides information indicating the type of device that generated the event.
MouseScrollEvent - Web APIs
method overview void initmousescrollevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in long axis); attributes attribute type de...
MouseWheelEvent - Web APIs
properties attribute type description wheeldelta read only long the distance in pixels (defined as so by msdn, but the actual usage is different, see mousewheel).
msGraphicsTrustStatus - Web APIs
msaudiodevicetype: string; readonly msgraphicstruststatus: msgraphicstrust; ...
msPlayToSource - Web APIs
example <video id="videoplayer" src="http://www.contoso.com/clip.mp4" controls autoplay /> <script type="text/javascript"> // step 1: obtain playtomanager object for app’s current view.
msSetMediaProtectionManager - Web APIs
the optional parameter of the mssetmediaprotectionmanager property is mediaprotectionmanager and can be any type.
MutationObserver - Web APIs
st targetnode = document.getelementbyid('some-id'); // options for the observer (which mutations to observe) const config = { attributes: true, childlist: true, subtree: true }; // callback function to execute when mutations are observed const callback = function(mutationslist, observer) { // use traditional 'for loops' for ie 11 for(let mutation of mutationslist) { if (mutation.type === 'childlist') { console.log('a child node has been added or removed.'); } else if (mutation.type === 'attributes') { console.log('the ' + mutation.attributename + ' attribute was modified.'); } } }; // create an observer instance linked to the callback function const observer = new mutationobserver(callback); // start observing the target n...
Navigator.getUserMedia() - Web APIs
syntax navigator.getusermedia(constraints, successcallback, errorcallback); parameters constraints a mediastreamconstraints object specifying the types of media to request, along with any requirements for each type.
Navigator.mediaCapabilities - Web APIs
examples navigator.mediacapabilities.decodinginfo({ type : 'file', audio : { contenttype : "audio/mp3", channels : 2, bitrate : 132700, samplerate : 5200 } }).then(function(result) { console.log('this configuration is ' + (result.supported ?
msSaveBlob - Web APIs
notes when a site calls this method, the behavior is the same as when windows internet explorer downloads a file with the following in the header, where x-download-options removes the file open button from the browser file download dialog: content-length: <blob.size> content-type: <blob.type> content-disposition: attachment;filename=<defaultname> x-download-options: noopen specifications not part of any specifications.
msSaveOrOpenBlob - Web APIs
notes when a site calls this method, the behavior is the same as when windows internet explorer downloads a file with the following in the header: content-length: <blob.size> content-type: <blob.type> content-disposition: attachment;filename=<defaultname> specifications not part of any specifications.
NavigatorID - Web APIs
there is no object of type navigatorid, but other interfaces, like navigator or workernavigator, implement it.
NavigatorLanguage - Web APIs
there is no object of type navigatorlanguage, but other interfaces, like navigator or workernavigator, implement it.
Online and offline events - Web APIs
"online" : "offline"; status.classname = condition; status.innerhtml = condition.touppercase(); log.insertadjacenthtml("beforeend", "event: " + event.type + "; status: " + condition); } window.addeventlistener('online', updateonlinestatus); window.addeventlistener('offline', updateonlinestatus); }); a touch of css #status { position: fixed; width: 100%; font: bold 1em sans-serif; color: #fff; padding: 0.5em; } #log { padding: 2.5em 0.5em 0.5em; font: 1em sans-serif; } .online { background: green; } .offline { backgrou...
NavigatorOnLine - Web APIs
there is no object of type navigatoronline, but other interfaces, like navigator or workernavigator, implement it.
NavigatorPlugins - Web APIs
properties navigatorplugins.mimetypes read only returns an mimetypearray listing the mime types supported by the browser.
Node.childNodes - Web APIs
WebAPINodechildNodes
(for example, to get the name of the first childnode: elementnodereference.childnodes[1].nodename.) the document object itself has 2 children: the doctype declaration and the root element, typically referred to as documentelement.
Node.hasChildNodes() - Web APIs
example let foo = document.getelementbyid('foo'); if (foo.haschildnodes()) { // do something with 'foo.childnodes' } polyfill here is one possible polyfill: ;(function(prototype) { prototype.haschildnodes = prototype.haschildnodes || function() { return !!this.firstchild; } })(node.prototype); there are various ways to determine whether the node has a child node: node.haschildnodes() node.firstchild != null (or just node.firstchild) node.childnodes && node.childnodes.length (or node.childnodes.length > 0) specifications specification status ...
Node.insertBefore() - Web APIs
WebAPINodeinsertBefore
new node to insert let newnode = document.createelement("span") // get a reference to the parent node let parentdiv = document.getelementbyid("childelement").parentnode // begin test case [ 1 ] : existing childelement (all works correctly) let sp2 = document.getelementbyid("childelement") parentdiv.insertbefore(newnode, sp2) // end test case [ 1 ] // begin test case [ 2 ] : childelement is of type undefined let sp2 = undefined // non-existent node of id "childelement" parentdiv.insertbefore(newnode, sp2) // implicit dynamic cast to type node // end test case [ 2 ] // begin test case [ 3 ] : childelement is of type "undefined" ( string ) let sp2 = "undefined" // non-existent node of id "childelement" parentdiv.insertbefore(newnode, sp2) // generates "type error: invalid argument" // end te...
Node.isConnected - Web APIs
WebAPINodeisConnected
*/ if (!('isconnected' in node.prototype)) { object.defineproperty(node.prototype, 'isconnected', { get() { return ( !this.ownerdocument || !( this.ownerdocument.comparedocumentposition(this) & this.document_position_disconnected ) ); }, }); } specifications specification status comment domthe definition of 'isconnected' in that specification.
Node.namespaceURI - Web APIs
WebAPINodenamespaceURI
for nodes of any node.nodetype other than element_node and attribute_node the value of namespaceuri is always null.
Node.nodeValue - Web APIs
WebAPINodenodeValue
the following table shows the return values for different elements: node value of nodevalue cdatasection content of the cdata section comment content of the comment document null documentfragment null documenttype null element null namednodemap null entityreference null notation null processinginstruction entire content excluding the target text content of the text node when nodevalue is defined to be null, setting it has no effect.
Node.prefix - Web APIs
WebAPINodeprefix
when a document is served with an xml mime type.
Node.setUserData() - Web APIs
WebAPINodesetUserData
the handler will be passed five arguments: an operation type integer (e.g., 1 to indicate a clone operation), the user key, the data on the node, the source node (null if being deleted), the destination node (the newly created node or null if none).if no handler is desired, one must specify null.
NodeFilter.acceptNode() - Web APIs
example var nodeiterator = document.createnodeiterator( // node to use as root document.getelementbyid('someid'), // only consider nodes that are text nodes (nodetype 3) nodefilter.show_text, // object containing the function to use for the acceptnode method // of the nodefilter { acceptnode: function(node) { // logic to determine whether to accept, reject or skip node // in this case, only accept nodes that have content // other than whitespace if ( !
NodeFilter - Web APIs
example const nodeiterator = document.createnodeiterator( // node to use as root document.getelementbyid('someid'), // only consider nodes that are text nodes (nodetype 3) nodefilter.show_text, // object containing the function to use for the acceptnode method // of the nodefilter { acceptnode: function(node) { // logic to determine whether to accept, reject or skip node // in this case, only accept nodes that have content // other than whitespace if ( !
NodeList.item() - Web APIs
WebAPINodeListitem
a value of null is returned if the index is out of range, and a typeerror is thrown if no argument is provided.
Notification.Notification() - Web APIs
this can be of any data type.
Notification - Web APIs
instance methods these properties are available only on an instance of the notification object or through its prototype.
NotificationEvent.notification - Web APIs
console.log('notification tag:', event.notification.tag); console.log('notification data:', event.notification.data); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (var i = 0; i < clientlist.length; i++) { var client = clientlist[i]; if (client.url == '/' && 'focus' in client) return client.focus(); } if (clients.openwindow) return clients.openwindow('/'); })); }); specifications specification status comment notifications apithe definition o...
NotificationEvent - Web APIs
example self.addeventlistener('notificationclick', function(event) { console.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (var i = 0; i < clientlist.length; i++) { var client = clientlist[i]; if (client.url == '/' && 'focus' in client) return client.focus(); } if (clients.openwindow) return clients.openwindow('/'); })); }); specifications specification status comment notifications apithe definition o...
Notifications API - Web APIs
notificationevent a specific type of event object, based on extendableevent, which represents a notification that has fired.
OES_standard_derivatives - Web APIs
glsl built-in functions the following new functions can be used in glsl shader code, if this extension is enabled: gentype dfdx(gentype) gentype dfdy(gentype) gentype fwidth(gentype) examples enabling the extensions: gl.getextension('oes_standard_derivatives'); gl.getextension('ext_shader_texture_lod'); shader code that avoids artifacts when wrapping texture coordinates: <script type="x-shader/x-fragment"> #extension gl_ext_shader_texture_lod : enable #extension gl_oes_standard_derivatives : enable uniform sam...
OES_texture_float_linear - Web APIs
the oes_texture_float_linear extension is part of the webgl api and allows linear filtering with floating-point pixel types for textures.
OES_texture_half_float_linear - Web APIs
the oes_texture_half_float_linear extension is part of the webgl api and allows linear filtering with half floating-point pixel types for textures.
OfflineAudioCompletionEvent.OfflineAudioCompletionEvent() - Web APIs
syntax var offlineaudiocompletionevent = new offlineaudiocompletionevent(type, init) parameters type optional a domstring representing the type of object to create.
OfflineAudioContext.oncomplete - Web APIs
the oncomplete event handler of the offlineaudiocontext interface is called when the audio processing is terminated, that is when the complete event (of type offlineaudiocompletionevent) is raised.
OscillatorNode.OscillatorNode() - Web APIs
type the shape of the wave produced by the node.
OscillatorNode.detune - Web APIs
// create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.type = 'square'; oscillator.frequency.setvalueattime(440, audioctx.currenttime); // value in hertz oscillator.detune.setvalueattime(100, audioctx.currenttime); // value in cents oscillator.start(); specifications specification status comment web audio apithe definition of 'detune' in that specification.
OscillatorNode.frequency - Web APIs
// create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.type = 'square'; oscillator.frequency.setvalueattime(440, audioctx.currenttime); // value in hertz oscillator.start(); specifications specification status comment web audio apithe definition of 'frequency' in that specification.
OscillatorNode.onended - Web APIs
// create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.type = 'square'; oscillator.frequency.value = 440; // value in hertz oscillator.start(); // start the tone playing oscillator.stop(5); // the tone will stop again in 5 seconds.
OscillatorNode.setPeriodicWave() - Web APIs
the setperiodicwave() method of the oscillatornode interface is used to point to a periodicwave defining a periodic waveform that can be used to shape the oscillator's output, when type is custom.
OscillatorNode.start() - Web APIs
// create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.type = 'square'; oscillator.frequency.setvalueattime(3000, audioctx.currenttime); // value in hertz oscillator.start(); specifications specification status comment web audio apithe definition of 'start' in that specification.
PageTransitionEvent - Web APIs
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 the browser"); } } specifications specification status comment html living standardthe definition of 'pagetransiti...
PaintWorklet.registerPaint - Web APIs
return value undefined exceptions typeerror thrown when one of the arguments is invalid or missing.
PannerNode.coneInnerAngle - Web APIs
they range between -1 and 1 const x = math.cos(radians); const z = math.sin(radians); // we hard-code the y component to 0, as y is the axis of rotation return [x, 0, z]; }; now we can create our audiocontext, an oscillator and a pannernode: const context = new audiocontext(); const osc = new oscillatornode(context); osc.type = 'sawtooth'; const panner = new pannernode(context); panner.panningmodel = 'hrtf'; next, we set up the cone of our spatialised sound, determining the area in which it can be heard: // this value determines the size of the area in which the sound volume is constant // if coneinnerangle == 30, it means that when the sound is rotated // by at most 15 (30/2) degrees either direction, the volume w...
PannerNode.coneOuterAngle - Web APIs
they range between -1 and 1 const x = math.cos(radians); const z = math.sin(radians); // we hard-code the y component to 0, as y is the axis of rotation return [x, 0, z]; }; now we can create our audiocontext, an oscillator and a pannernode: const context = new audiocontext(); const osc = new oscillatornode(context); osc.type = 'sawtooth'; const panner = new pannernode(context); panner.panningmodel = 'hrtf'; next, we set up the cone of our spatialised sound, determining the area in which it can be heard: // this value determines the size of the area in which the sound volume is constant // if coneinnerangle == 30, it means that when the sound is rotated // by at most 15 (30/2) degrees either direction, the volume w...
PannerNode.coneOuterGain - Web APIs
they range between -1 and 1 const x = math.cos(radians); const z = math.sin(radians); // we hard-code the y component to 0, as y is the axis of rotation return [x, 0, z]; }; now we can create our audiocontext, an oscillator and a pannernode: const context = new audiocontext(); const osc = new oscillatornode(context); osc.type = 'sawtooth'; const panner = new pannernode(context); panner.panningmodel = 'hrtf'; next, we set up the cone of our spatialised sound, determining the area in which it can be heard: // this value determines the size of the area in which the sound volume is constant // if coneinnerangle == 30, it means that when the sound is rotated // by at most 15 (30/2) degrees either direction, the volume w...
PannerNode.distanceModel - Web APIs
syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.distancemodel = 'inverse'; value a enum — see distancemodeltype.
PannerNode.orientationX - Web APIs
they range between -1 and 1 const x = math.cos(radians); const z = math.sin(radians); // we hard-code the y component to 0, as y is the axis of rotation return [x, 0, z]; }; now we can create our audiocontext, an oscillator and a pannernode: const context = new audiocontext(); const osc = new oscillatornode(context); osc.type = 'sawtooth'; const panner = new pannernode(context); panner.panningmodel = 'hrtf'; next, we set up the cone of our spatialised sound, determining the area in which it can be heard: // this value determines the size of the area in which the sound volume is constant // if coneinnerangle == 30, it means that when the sound is rotated // by at most 15 (30/2) degrees either direction, the volume w...
PannerNode.orientationY - Web APIs
they range between -1 and 1 const x = math.cos(radians); const z = math.sin(radians); // we hard-code the y component to 0, as y is the axis of rotation return [x, 0, z]; }; now we can create our audiocontext, an oscillator and a pannernode: const context = new audiocontext(); const osc = new oscillatornode(context); osc.type = 'sawtooth'; const panner = new pannernode(context); panner.panningmodel = 'hrtf'; next, we set up the cone of our spatialised sound, determining the area in which it can be heard: // this value determines the size of the area in which the sound volume is constant // if coneinnerangle == 30, it means that when the sound is rotated // by at most 15 (30/2) degrees either direction, the volume w...
PannerNode.orientationZ - Web APIs
they range between -1 and 1 const x = math.cos(radians); const z = math.sin(radians); // we hard-code the y component to 0, as y is the axis of rotation return [x, 0, z]; }; now we can create our audiocontext, an oscillator and a pannernode: const context = new audiocontext(); const osc = new oscillatornode(context); osc.type = 'sawtooth'; const panner = new pannernode(context); panner.panningmodel = 'hrtf'; next, we set up the cone of our spatialised sound, determining the area in which it can be heard: // this value determines the size of the area in which the sound volume is constant // if coneinnerangle == 30, it means that when the sound is rotated // by at most 15 (30/2) degrees either direction, the volume w...
PannerNode.panningModel - Web APIs
syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; value a enum — see panningmodeltype.
ParentNode - Web APIs
the parentnode mixin contains methods and properties that are common to all types of node objects that can have children.
PasswordCredential - Web APIs
<form id="form" method="post"> <input type="text" name="id" autocomplete="username" /> <input type="password" name="password" autocomplete="current-password" /> <input type="hidden" name="csrf_token" value="*****" /> </form> then, a reference to this form element, using it to create a passwordcredential object, and storing it in the browser's password system.
PasswordCredential.additionalData - Web APIs
navigator.credentials.get(options).then(function(creds) { if (creds.type == 'password') { var form = new formdata(); var csrf_token = document.queryselector('csrf_token').value; form.append('csrf_token', csrf_token); creds.additionaldata = form; fetch('https://www.example.com', { method: 'post', credentials: creds }); }; }); specifications specification status comment credential management level 1 wo...
PaymentMethodChangeEvent.methodDetails - Web APIs
request.onpaymentmethodchange = function(ev) { const { type: cardtype } = ev.methoddetails; const newstuff = {}; if (ev.methodname === "https://apple.com/apple-pay") { switch (cardtype) { case "visa": // do apple pay specific handling for visa card...
PaymentMethodChangeEvent.methodName - Web APIs
request.onpaymentmethodchange = function(ev) { const { type: cardtype } = ev.methoddetails; const newstuff = {}; if (ev.methodname === "https://apple.com/apple-pay") { switch (cardtype) { case "visa": // do apple pay specific handling for visa card...
PaymentRequest.onpaymentmethodchange - Web APIs
examples an example payment method change handler is shown below; this example handles changes made to the payment method when using apple pay, specifically: request.onpaymentmethodchange = ev => { const { type: cardtype } = ev.methoddetails; const newstuff = {}; if (ev.methodname === "https://apple.com/apple-pay") { switch (cardtype) { case "store": // do apple pay specific handling for store card...
PaymentRequest - Web APIs
paymentrequest.shippingtype read only secure context returns the type of shipping used to fulfill the transaction.
PaymentRequestEvent() - Web APIs
syntax var paymentrequestevent = new paymentrequesteventy(type, options) parameters type must always be 'paymentrequest'.
PaymentResponse.onpayerdetailchange - Web APIs
response.onpayerdetailchange = async ev => { const promisestovalidate = []; const { payername, payeremail, payerphone } = response; // validate each value which changed by calling a function // that validates each type of data, returning a promise which // resolves if the data is valid.
PaymentResponse: payerdetailchange event - Web APIs
response.onpayerdetailchange = async ev => { const promisestovalidate = []; const { payername, payeremail, payerphone } = response; // validate each value which changed by calling a function // that validates each type of data, returning a promise which // resolves if the data is valid.
Payment processing concepts - Web APIs
functions of a payment handler a user agent may provide built-in support for certain types of payments.
Payment Request API - Web APIs
basiccardrequest defines an object structure for containing payment request details such as card type.
Performance.navigation - Web APIs
the legacy performance.navigation read-only property returns a performancenavigation object representing the type of navigation that occurs in the given browsing context, such as the number of redirections needed to fetch the resource.
performance.now() - Web APIs
WebAPIPerformancenow
recommendation stricter definitions of interfaces and types.
PerformanceNavigationTiming.toJSON() - Web APIs
example // get a resource performance entry var perfentries = performance.getentriesbytype("navigation"); var entry = perfentries[0]; // get the json and log it var json = entry.tojson(); var s = json.stringify(json); console.log("performancenavigationtiming.tojson() = " + s); specifications specification status comment navigation timing level 2the definition of 'tojson()' in that specification.
PerformanceObserver.takeRecords() - Web APIs
example var observer = new performanceobserver(function(list, obj) { var entries = list.getentries(); for (var i=0; i < entries.length; i++) { // process "mark" and "frame" events } }); observer.observe({entrytypes: ["mark", "frame"]}); var records = observer.takerecords(); console.log(records[0].name); console.log(records[0].starttime); console.log(records[0].duration); specifications specification status comment performance timeline level 2the definition of 'takerecords()' in that specification.
PerformanceResourceTiming.nextHopProtocol - Web APIs
function print_performanceentries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_nexthopprotocol(p[i]); } } function print_nexthopprotocol(perfentry) { var value = "nexthopprotocol" in perfentry; if (value) console.log("nexthopprotocol = " + perfentry.nexthopprotocol); else console.log("nexthopprotocol = not supported"); } sp...
PerformanceResourceTiming.toJSON() - Web APIs
example // get a resource performance entry var perfentries = performance.getentriesbytype("resource"); var entry = perfentries[0]; // get the json and log it var json = entry.tojson(); var s = json.stringify(json); console.log("performanceentry.tojson = " + s); specifications specification status comment resource timing level 2the definition of 'tojson' in that specification.
PerformanceServerTiming - Web APIs
dur=47.2 `.replace(/\n/g, '') }; response.writehead(200, headers); response.write(''); return settimeout(_ => { response.end(); }, 1000) }; http.createserver(requesthandler).listen(3000).on('error', console.error); the performanceservertiming entries are now observable from javascript via the performanceresourcetiming.servertiming property: let entries = performance.getentriesbytype('resource'); console.log(entries[0].servertiming); // 0: performanceservertiming {name: "cache", duration: 23.2, description: "cache read"} // 1: performanceservertiming {name: "db", duration: 53, description: ""} // 2: performanceservertiming {name: "app", duration: 47.2, description: ""} specifications specification status comment server timingthe definition of 'perfo...
Permissions.query() - Web APIs
WebAPIPermissionsquery
exceptions exception explanation typeerror retrieving the permissiondescriptor information failed in some way, or the permission doesn't exist or is currently unsupported (e.g.
Permissions.revoke() - Web APIs
exceptions typeerror retrieving the permissiondescriptor information failed in some way, or the permission doesn't exist or is currently unsupported (e.g.
PhotoCapabilities - Web APIs
const input = document.queryselector('input[type="range"]'); var imagecapture; navigator.mediadevices.getusermedia({video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream; const track = mediastream.getvideotracks()[0]; imagecapture = new imagecapture(track); return imagecapture.getphotocapabilities(); }) .then(photocapabilities => { const settings = imagecapture.track.getsettings(); input.m...
PointerEvent.tiltX - Web APIs
this property is typically only useful for a pen/stylus pointer type.
PointerEvent.tiltY - Web APIs
this property is typically only useful for a pen/stylus pointer type.
ProgressEvent.initProgressEvent() - Web APIs
do not use it anymore, use the standard constructor, progressevent(), to create a synthetic progressevent syntax progress.initprogressevent(typearg, canbubblearg, cancelablearg, lengthcomputable, loaded, total); parameters typearg is a domstring identifying the specific type of animation event that occurred.
PromiseRejectionEvent - Web APIs
="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="221" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">promiserejectionevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor promiserejectionevent() creates a promiserejectionevent event, given the type of event (unhandledrejection or rejectionhandled) and other details.
PublicKeyCredential.getClientExtensionResults() - Web APIs
nclude location information in attestation "uvi": true // user verification index: how the user was verified }, challenge: new uint8array(16) /* from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(16) /* from the server */, name: "jdoe@example.com", displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { var mybuffer = newcredentialinfo.getclientextensionresults(); // mybuffer will contain the result of any of the processing of the "loc" and "uvi" extensions }).catch(function (err) { console.error(err); }); specifications specification status...
PublicKeyCredential.id - Web APIs
examples var publickey = { challenge: new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { var id = newcredentialinfo.id; // do something with the id // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.error(err); }); specificat...
PublicKeyCredential.rawId - Web APIs
examples var options = { challenge: new uint8array(26) /* from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey: options }) .then(function (pubkeycredential) { var rawid = pubkeycredential.rawid; // do something with rawid }).catch(function (err) { // deal with any error }); specifications specification status comment web authentication: an api for accessing public key credentials...
PublicKeyCredential.response - Web APIs
examples var options = { challenge: new uint8array(16) /* from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(16) /* from the server */, name: "jdoe@example.com", displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey: options }) .then(function (pubkeycredential) { var response = pubkeycredential.response; var clientextresults = pubkeycredential.getclientextensionresults(); // send response and client extensions to the server so that it can validate // and create credentials }).catch(function (err) { // de...
PublicKeyCredentialCreationOptions.attestation - Web APIs
examples var publickey = { attestation: "indirect", challenge: new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment web au...
PublicKeyCredentialCreationOptions.authenticatorSelection - Web APIs
t: "cross-platform", requireresidentkey: true, userverification: "required" }, challenge: new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment web authentica...
PublicKeyCredentialCreationOptions.challenge - Web APIs
examples var publickey = { challenge: new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment web au...
PublicKeyCredentialCreationOptions.rp - Web APIs
examples var publickey = { challenge: /* from the server */, rp: { name: "example corp", id : "login.example.com", icon: "https://login.example.com/login.ico" }, user: { id: new uint8array(16), name: "jdoe@example.com", displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment web au...
PublicKeyCredentialCreationOptions.timeout - Web APIs
challenge: new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment web au...
PublicKeyCredentialCreationOptions.user - Web APIs
/* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { // to be changed for each user id: new uint8array.from(window.atob("laegmlkjnrlkgnamlafalfka="), c=>c.charcodeat(0)); name: "jdoe@example.com", displayname: "john doe", icon: "https://gravatar.com/avatar/jdoe.png" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment web au...
PublicKeyCredentialRequestOptions - Web APIs
examples var options = { challenge: new uint8array([/* bytes sent from the server */]), rpid: "example.com", /* will only work if the current domain is something like foo.example.com */ userverification: "preferred", timeout: 60000, // wait for a minute allowcredentials: [ { transports: "usb", type: "public-key", id: new uint8array(26) // actually provided by the server }, { transports: "internal", type: "public-key", id: new uint8array(26) // actually provided by the server } ], extensions: { uvm: true, // rp wants to know how the user was verified loc: false, txauthsimple: "could you please verify yourself?" } }; navigator.credential...
PushEvent.PushEvent() - Web APIs
syntax var mypushevent = new pushevent(type, eventinitdict); parameters type a domstring defining the type of pushevent.
Web Push API Notifications best practices - Web APIs
in addition to the question of whether a push notification is required at all, there are many different types of push notifications, ranging from casual-and-disappearing to persistent-and-requiring-interaction.
RTCConfiguration.bundlePolicy - Web APIs
this string, which must be a member of the rtcbundlepolicy enumeration, has the following possible values: balanced the ice agent begins by creating one rtcdtlstransport to handle each type of content added: one for audio, one for video, and one for the rtc data channel, if applicable.
RTCConfiguration.iceTransportPolicy - Web APIs
its value must come from the rtcicetransportpolicy enumerated type.
RTCDTMFSender.ontonechange - Web APIs
the event handler receives as input a single parameter of type rtcdtmftonechangeevent, which describes the change.
RTCDTMFToneChangeEvent - Web APIs
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.
RTCDataChannel: message event - Web APIs
bubbles no cancelable no interface messageevent event handler property onmessage note: the message event uses as its event object type the messageevent interface defined by the html specification.
RTCDataChannel.onclose - Web APIs
the function receives as its sole input parameter the event itself, as an object of type event.
RTCDataChannel.onclosing - Web APIs
the function receives as its sole input parameter the event itself, as an object of type event.
RTCDataChannel.onopen - Web APIs
the function receives as its only input parameter the event itself, of type event.
RTCDataChannel: open event - Web APIs
finally, the message input box is focused so the user can immediately begin to type.
RTCDataChannel.send() - Web APIs
typeerror the specified data is too large for the other peer to receive.
RTCDtlsTransport.state - Web APIs
syntax let mystate = dtlstransport.state; value a string whose value is taken from the rtcdtlstransportstate enumerated type.
RTCDtlsTransport - Web APIs
if the connection was created using max-compat mode, each transport is responsible for handling all of the communications for a given type of media (audio, video, or data channel).
RTCError - Web APIs
WebAPIRTCError
properties in addition to the properties defined by the parent interface, domexception, rtcerror includes the following properties: errordetail read only a domstring specifying the webrtc-specific error code identifying the type of error that occurred.
RTCErrorEvent.error - Web APIs
additional properties defined by rtcerror are: errordetail read only a domstring specifying the webrtc-specific error code identifying the type of error that occurred.
RTCIceCandidate.candidate - Web APIs
the complete list of attributes for this example candidate is: foundation = 4234997325 component = "rtp" (the number 1 is encoded to this string; 2 becomes "rtcp") protocol = "udp" priority = 2043278322 ip = "192.168.0.56" port = 44323 type = "host" example in this example, we see a function which receives as input an sdp string containing an ice candidate received from the remote peer during the signaling process.
RTCIceCandidate.component - Web APIs
example this code snippet examines a candidate's component type and dispatches the candidate to different handlers depending on the value.
RTCIceCandidate.sdpMLineIndex - Web APIs
note: attempting to add a candidate (using addicecandidate()) that has a value of null for either sdpmid or sdpmlineindex will throw a typeerror exception.
RTCIceCandidate.sdpMid - Web APIs
note: attempting to add a candidate (using addicecandidate()) that has a value of null for either sdpmid or sdpmlineindex will throw a typeerror exception.
RTCIceCandidateInit.candidate - Web APIs
the complete list of attributes for this example candidate is: foundation = 4234997325 component = "rtp" (the number 1 is encoded to this string; 2 becomes "rtcp") protocol = "udp" priority = 2043278322 ip = "192.168.0.56" port = 44323 type = "host" example when a new ice candidate is received by your signaling code from the remote peer, you need to construct the rtcicecandidate object that encapsulates it.
RTCIceCandidateInit.sdpMLineIndex - Web APIs
note: attempting to add a candidate (using addicecandidate()) that has a value of null for either sdpmid or sdpmlineindex will throw a typeerror exception.
RTCIceCandidateInit.sdpMid - Web APIs
note: attempting to add a candidate (using addicecandidate()) that has a value of null for either sdpmid or sdpmlineindex will throw a typeerror exception.
RTCIceCandidatePairStats.state - Web APIs
syntax state = rtcicecandidatepairstats.state; value a domstring whose value is one of those found in the rtcstatsicecandidatepairstate enumerated type.
RTCIceGathererState - Web APIs
the rtcicegathererstate enumerated type provides the string values which can be returned by an rtcicetransport object's gatheringstate.
RTCIceRole - Web APIs
the rtcicerole enumerated type lists the string values that identify whether a connection's ice agent is serving as the controlling agent or the controlled agent, as indicated by rtcicetransport.role.
RTCIceServers.urls - Web APIs
WebAPIRTCIceServerurls
any number of servers could be listed of any combination of types.
RTCIceTransport.component - Web APIs
syntax icecomponent = rtcicetransport.component; value a domstring whose value comes from the enumerated type rtcicecomponent: "rtp" identifies an ice transport which is being used for the real-time transport protocol (rtp), or for rtp multiplexed with the rtp control protocol (rtcp).
RTCIceTransport.role - Web APIs
the value must be one of those found in the enumerated type rtcicerole: "controlling" the rtcicetransport object is serving as the controlling agent.
RTCIceTransport.state - Web APIs
syntax icestate = icetransport.state; value a domstring, whose value is one of those found in the enumerated type rtcicetransportstate, which indicates the stage of ice gathering that's currently underway.
RTCIceTransportState - Web APIs
the rtcicetransportstate enumerated type defines the string values which may be returned by the state property on rtcicetransport objects.
RTCIdentityErrorEvent - Web APIs
two events are sent with this type: idpassertionerror and idpvalidationerror.
RTCIdentityEvent - Web APIs
the only event sent with this type is identityresult..
RTCInboundRtpStreamStats.qpSum - Web APIs
function calculateaverageqp(stats) { let framecount = 0; switch(stats.type) { case "inbound-rtp": case "remote-inbound-rtp": framecount = stats.framesdecoded; break; case "outbound-rtp": case "remote-outbound-rtp": framecount = stats.framesencoded; break; default: return 0; } return status.qpsum / framecount; } specifications specification status comment identifiers for webrtc's statistics...
RTCInboundRtpStreamStats - Web APIs
trackid a string which identifies the statistics object representing the receiving track; this object is one of two types: rtcreceiveraudiotrackattachmentstats or rtcreceivervideotrackattachmentstats.
RTCOutboundRtpStreamStats.qpSum - Web APIs
function calculateaverageqp(stats) { let framecount = 0; switch(stats.type) { case "inbound-rtp": case "remote-inbound-rtp": framecount = stats.framesdecoded; break; case "outbound-rtp": case "remote-outbound-rtp": framecount = stats.framesencoded; break; default: return 0; } return status.qpsum / framecount; } specifications specification status comment identifiers for webrtc's statistics...
RTCOutboundRtpStreamStats.qualityLimitationReason - Web APIs
syntax var qualitylimitationreason = rtcoutboundrtpstreamstats.qualitylimitationreason; value a map whose keys are domstrings whose values come from the rtcqualitylimitationreason enumerated type, and whose values are the duration of the media, in seconds, whose quality was reduced for that reason.
RTCOutboundRtpStreamStats - Web APIs
qualitylimitationreason a value from the rtcqualitylimitationreason enumerated type explaining why the resolution and/or frame rate is being limited for this rtp stream.
RTCPeerConnection() - Web APIs
certificates optional an array of objects of type rtccertificate which are used by the connection for authentication.
RTCPeerConnection.addIceCandidate() - Web APIs
typeerror the specified candidate's sdpmid and sdpmlineindex are both null.
RTCPeerConnection.addTrack() - Web APIs
this is a very common way to use addtrack() when building many types of simple applications, where only one stream is needed.
RTCPeerConnection.connectionState - Web APIs
this state essentially represents the aggregate state of all ice transports (which are of type rtcicetransport or rtcdtlstransport) being used by the connection.
RTCPeerConnection: connectionstatechange event - Web APIs
the new connection state can be found in connectionstate, and is one of the strings in the rtcpeerconnectionstate enumerated type.
RTCPeerConnection.createAnswer() - Web APIs
in this case, a websocket connection is used to send a json message with a type field with the value "video-answer" to the other peer, carrying the answer to the device which sent the offer to connect.
RTCPeerConnection.createDataChannel() - Web APIs
typeerror this can happen in a couple of situations: the label and/or protocol string is too long; these cannot be longer than 65,535 bytes (bytes, rather than characters).
RTCPeerConnection.iceConnectionState - Web APIs
the read-only property rtcpeerconnection.iceconnectionstate returns an enum of type rtciceconnectionstate which state of the ice agent associated with the rtcpeerconnection.
RTCPeerConnection: icecandidate event - Web APIs
first, an example using addeventlistener(): pc.addeventlistener("icecandidate", ev => { if (ev.candidate) { sendmessage({ type: "new-ice-candidate", candidate: event.candidate }); } }, false); you can also set the onicecandidate event handler property directly: pc.onicecandidate = ev => { if (ev.candidate) { sendmessage({ type: "new-ice-candidate", candidate: event.candidate }); } }; specifications specification status comment webrtc 1.0: real-time communi...
RTCPeerConnection: icecandidateerror event - Web APIs
the event object is of type rtcpeerconnectioniceerrorevent, and contains information describing the error in some amount of detail.
RTCPeerConnection.onconnectionstatechange - Web APIs
the function receives as input a single parameter, which is an object of type event.
RTCPeerConnection.ondatachannel - Web APIs
this event, of type rtcdatachannelevent, is sent when an rtcdatachannel is added to the connection by the remote peer calling createdatachannel().
RTCPeerConnection.ontrack - Web APIs
the function receives as input the event object, of type rtctrackevent; this event is sent when a new incoming mediastreamtrack has been created and associated with an rtcrtpreceiver object which has been added to the set of receivers on connection.
RTCPeerConnection.setLocalDescription() - Web APIs
type of the description parameter the description is of type rtcsessiondescriptioninit, which is a serialized version of a rtcsessiondescription browser object.
RTCPeerConnection: track event - Web APIs
see track event types in rtctrackevent for details.
RTCRtpContributingSource.audioLevel - Web APIs
for both rtcrtpcontributingsource and rtcrtpsynchronizationsource, the audio level is converted to this form from the values defined in the specifications corresponding to each type of source.
RTCRtpSender.replaceTrack() - Web APIs
typeerror the new track's kind doesn't match the original track.
RTCRtpStreamStats.qpSum - Web APIs
function calculateaverageqp(stats) { let framecount = 0; switch(stats.type) { case "inbound-rtp": case "remote-inbound-rtp": framecount = stats.framesdecoded; break; case "outbound-rtp": case "remote-outbound-rtp": framecount = stats.framesencoded; break; default: return 0; } return status.qpsum / framecount; } specifications specification status comment identifiers for webrtc's statistics...
RTCRtpTransceiverInit - Web APIs
each entry is of type rtcrtpencodingparameters.
RTCSctpTransport.state - Web APIs
syntax var mystate = sctptransport.state; value a string whose value is taken from the rtcsctptransportstate enumerated type.
RTCStats.id - Web APIs
WebAPIRTCStatsid
the format of the id string is not defined by the specification, so you cannot reliably make any assumptions about the contents of the string, or assume that the format of the string will remain unchanged for a given object type.
RTCStatsIceCandidatePairState - Web APIs
the rtcstatsicecandidatepairstate enumerated type represents the set of string values which are possible for the rtcicecandidatepairstats object's state property.
RTCTrackEvent - Web APIs
track event types there is only one type of track event.
RadioNodeList.value - Web APIs
syntax value = radionodelist.value; radionodelist.value = string; example html <form> <label><input type="radio" name="color" value="blue">blue</label> <label><input type="radio" name="color" value="red">red</label> </form> javascript // get the form const form = document.forms[0]; // get the form's radio buttons const radios = form.elements['color']; // choose the "red" option radios.value = 'red'; result specifications specification status comments html livin...
Range.cloneContents() - Web APIs
the range.clonecontents() returns a documentfragment copying the objects of type node included in the range.
Range.commonAncestorContainer - Web APIs
.highlight { animation: highlight linear 1s; } @keyframes highlight { from { outline: 1px solid #f00f; } to { outline: 1px solid #f000; } } body { padding: 1px; } javascript document.addeventlistener('pointerup', e => { const selection = window.getselection(); if (selection.type === 'range') { for (let i = 0; i < selection.rangecount; i++) { const range = selection.getrangeat(i); playanimation(range.commonancestorcontainer); } } }); function playanimation(el) { if (el.nodetype === node.text_node) { el = el.parentnode; } el.classlist.remove('highlight'); settimeout(() => { el.classlist.add('highlight'); }, 0); } result specifi...
ReadableByteStreamController.close() - Web APIs
exceptions typeerror the source object is not a readablebytestreamcontroller, or the stream is not readable for some other reason.
ReadableByteStreamController.enqueue() - Web APIs
exceptions typeerror the source object is not a readablebytestreamcontroller, or the stream cannot be read for some other reason, or the chunk is not an object, or the chunk's internal array buffer is non-existant or detached.
ReadableByteStreamController.error() - Web APIs
exceptions typeerror the source object is not a readablebytestreamcontroller, or the stream is not readable for some other reason.
ReadableStream.cancel() - Web APIs
exceptions typeerror the stream you are trying to cancel is not a readablestream, or it is locked.
ReadableStream.pipeThrough() - Web APIs
exceptions typeerror the writable and/or readable property of transformstream are undefined.
ReadableStream.pipeTo() - Web APIs
exceptions typeerror the writablestream and/or readablestream objects are not a writable stream/readable stream, or one or both of the streams are locked.
ReadableStream.tee() - Web APIs
exceptions typeerror the source stream is not a readablestream.
ReadableStream - Web APIs
if (done) { // tell the browser that we have finished sending data controller.close(); return; } // get the data and send it to the browser via the controller controller.enqueue(value); push(); }); }; push(); } }); return new response(stream, { headers: { "content-type": "text/html" } }); }); specifications specification status comment streamsthe definition of 'readablestream' in that specification.
ReadableStreamBYOBReader.ReadableStreamBYOBReader() - Web APIs
exceptions typeerror the supplied stream parameter is not a readablestream, or it is already locked for reading by another reader, or its stream controller is not a readablebytestreamcontroller.
ReadableStreamBYOBReader.cancel() - Web APIs
exceptions typeerror the source object is not a readablestreambyobreader, or the stream has no owner.
ReadableStreamBYOBReader.read() - Web APIs
exceptions typeerror the source object is not a readablestreambyobreader, the stream has no owner, the view is not an object or has become detached, or the view's length is 0.
ReadableStreamBYOBRequest.respond() - Web APIs
exceptions typeerror the source object is not a readablestreambyobrequest, or there is no associated controller, or the associated internal array buffer is detached.
ReadableStreamBYOBRequest.respondWithNewView() - Web APIs
exceptions typeerror the source object is not a readablestreambyobrequest, or there is no associated controller, or the associated internal array buffer is non-existant or detached.
ReadableStreamBYOBRequest.view - Web APIs
syntax var view = readablestreambyobrequestinstance.view; value a typed array representing the destination region to which the controller can write generated data.
ReadableStreamBYOBRequest - Web APIs
a view, as mentioned below, refers to a typed array representing the destination region to which the associated readablebytestreamcontroller controller can write generated data.
ReadableStreamDefaultController.close() - Web APIs
exceptions typeerror the source object is not a readablestreamdefaultcontroller.
ReadableStreamDefaultController.enqueue() - Web APIs
exceptions typeerror the source object is not a readablestreamdefaultcontroller.
ReadableStreamDefaultController.error() - Web APIs
exceptions typeerror the source object is not a readablestreamdefaultcontroller, or the stream is not readable for some other reason.
ReadableStreamDefaultReader.ReadableStreamDefaultReader() - Web APIs
exceptions typeerror the supplied stream parameter is not a readablestream, or it is already locked for reading by another reader.
ReadableStreamDefaultReader.cancel() - Web APIs
exceptions typeerror the source object is not a readablestreamdefaultreader, or the stream has no owner.
ReadableStreamDefaultReader.read() - Web APIs
exceptions typeerror the source object is not a readablestreamdefaultreader, or the stream has no owner.
ReadableStreamDefaultReader - Web APIs
if (done) { // tell the browser that we have finished sending data controller.close(); return; } // get the data and send it to the browser via the controller controller.enqueue(value); push(); }); }; push(); } }); return new response(stream, { headers: { "content-type": "text/html" } }); }); specifications specification status comment streamsthe definition of 'readablestreamdefaultreader' in that specification.
Report.url - Web APIs
WebAPIReporturl
examples let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { let firstreport = reports[0]; // log the url of the document that generated the first report // e.g.
ReportingObserver.disconnect() - Web APIs
syntax reportingobserverinstance.disconnect() examples let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { reportbtn.onclick = () => displayreports(reports); }, options); observer.observe() ...
ReportingObserver.observe() - Web APIs
syntax reportingobserverinstance.observe() examples let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { reportbtn.onclick = () => displayreports(reports); }, options); observer.observe() specifications specification status comment reporting apithe definition of 'reportingobserver.observe()' in that specification.
ReportingObserver.takeRecords() - Web APIs
examples let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { reportbtn.onclick = () => displayreports(reports); }, options); observer.observe() // ...
ReportingObserver - Web APIs
examples in our deprecation_report.html example, we create a simple reporting observer to observe usage of deprecated features on our web page: let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { reportbtn.onclick = () => displayreports(reports); }, options); we then tell it to start observing reports using reportingobserver.observe(); this tells the observer to start collecting reports in its report queue, and runs the callback function specified inside the constructor: observer.
Request.clone() - Web APIs
WebAPIRequestclone
clone() throws a typeerror if the response body has already been used.
Request.context - Web APIs
WebAPIRequestcontext
note: you can find a full list of the different available contexts including associated context frame types, csp directives, and platform feature examples in the fetch spec request context section.
Request.headers - Web APIs
WebAPIRequestheaders
le in the same directory as the script), then save the request headers in a variable: var myrequest = new request('flowers.jpg'); var myheaders = myrequest.headers; // headers {} to add a header to the headers object we use headers.append; we then create a new request along with a 2nd init parameter, passing headers in as an init option: var myheaders = new headers(); myheaders.append('content-type', 'image/jpeg'); var myinit = { method: 'get', headers: myheaders, mode: 'cors', cache: 'default' }; var myrequest = new request('flowers.jpg', myinit); mycontenttype = myrequest.headers.get('content-type'); // returns 'image/jpeg' specifications specification status comment fetchthe definition of 'headers' in that specification.
ResizeObserver - Web APIs
the javascript looks like so: const h1elem = document.queryselector('h1'); const pelem = document.queryselector('p'); const divelem = document.queryselector('body > div'); const slider = document.queryselector('input[type="range"]'); const checkbox = document.queryselector('input[type="checkbox"]'); divelem.style.width = '600px'; slider.addeventlistener('input', () => { divelem.style.width = slider.value + 'px'; }) const resizeobserver = new resizeobserver(entries => { for (const entry of entries) { if (entry.contentboxsize) { h1elem.style.fontsize = math.max(1.5, entry.contentboxsize.inlinesize /...
Response.clone() - Web APIs
WebAPIResponseclone
clone() throws a typeerror if the response body has already been used.
Response.error() - Web APIs
WebAPIResponseerror
an error response has its type set to error.
Response.redirect() - Web APIs
WebAPIResponseredirect
typeerror the specified url is invalid.
SVGAElement - Web APIs
svgaelement.type is a domstring that reflects the type attribute, indicating the mime type of the linked resource.
format - Web APIs
string font format examples of common extensions truedoc-pfr truedoc™ portable font resource .pfr embedded-opentype embedded opentype .eot type-1 postscript™ type 1 .pfb, .pfa truetype truetype .ttf opentype opentype, including truetype open .ttf truetype-gx truetype with gx extensions - speedo speedo - intellifont intellifont - example myglyph.format = "truedoc-pfr"; specifications specificatio...
SVGAnimatedEnumeration - Web APIs
interface overview also implement none methods none properties unsigned short baseval readonly unsigned short animval normative document svg 1.1 (2nd edition) properties name type description baseval unsigned short the base value of the given attribute before applying any animations.
SVGAnimatedPoints - Web APIs
interface overview also implement none methods none properties readonly svgpointlist points readonly svgpointlist animatedpoints normative document svg 1.1 (2nd edition) properties name type description points svgpointlist provides access to the base (i.e., static) contents of the points attribute.
SVGAnimatedPreserveAspectRatio - Web APIs
svg animated preserveaspectratio interface the svganimatedpreserveaspectratio interface is used for attributes of type svgpreserveaspectratio which can be animated.
SVGAnimatedRect - Web APIs
interface overview also implement none methods none properties readonly svgrect baseval readonly svgrect animval normative document svg 1.1 (2nd edition) properties name type description baseval svgrect the base value of the given attribute before applying any animations.
SVGAnimatedTransformList - Web APIs
interface overview also implement none methods none properties readonly svgtransformlist baseval readonly svgtransformlist animval normative document svg 1.1 (2nd edition) properties name type description baseval svgtransformlist the base value of the given attribute before applying any animations.
SVGExternalResourcesRequired - Web APIs
note: the svg dom defines the attribute externalresourcesrequired as being of type svganimatedboolean, whereas the svg language definition says that the attribute is not animated.
SVGFitToViewBox - Web APIs
methods none properties svganimatedpreserveaspectratio preserveaspectratio svganimatedrect viewbox normative document svg 1.1 (2nd edition) properties name type description preserveaspectratio svganimatedpreserveaspectratio corresponds to attribute preserveaspectratio on the given element.
SVGLengthList - Web APIs
unsigned long index) svglength replaceitem(in svglength newitem, in unsigned long index) svglength removeitem(in unsigned long index) svglength appenditem(in svglength newitem) properties readonly unsigned long numberofitems readonly unsigned long length normative document svg 1.1 (2nd edition) properties name type description numberofitems unsigned long the number of items in the list.
SVGNumber - Web APIs
WebAPISVGNumber
the svgnumber interface corresponds to the <number> basic data type.
SVGNumberList - Web APIs
long index) svgnumber replaceitem(in svgnumber newitem, in unsigned long index) svgnumber removeitem(in unsigned long index) svgnumber appenditem(in svgnumber newitem) properties readonly unsigned long numberofitems readonly unsigned long length normative document svg 1.1 (2nd edition) properties name type description numberofitems unsigned long the number of items in the list.
SVGPathSegList - Web APIs
ex) svgpathseg appenditem(in svgpathseg newitem) properties readonly unsigned long numberofitems normative document svg 1.1 (2nd edition) properties name type description numberofitemsread only unsigned long the number of items in the list.
SVGPointList - Web APIs
t removeitem(in unsigned long index) svgpoint appenditem(in svgpoint newitem) properties readonly unsigned long numberofitems normative document svg 1.1 (2nd edition) properties name type description numberofitems unsigned long the number of items in the list.
SVGScriptElement - Web APIs
target="_top"><rect x="321" y="65" width="160" height="50" fill="#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">svgscriptelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties svgscriptelement.type read only a domstring corresponding to the type attribute of the given <script> element.
SVGStringList - Web APIs
d long index) domstring replaceitem(in domstring newitem, in unsigned long index) domstring removeitem(in unsigned long index) domstring appenditem(in domstring newitem) properties readonly unsigned long numberofitems readonly unsigned long length normative document svg 1.1 (2nd edition) properties name type description numberofitems unsigned long the number of items in the list.
SVGStyleElement - Web APIs
svgstyleelement.type a domstring corresponding to the type attribute of the given element.
SVGTextContentElement - Web APIs
the numeric type values represent one of the constant values above.
SVGTransformable - Web APIs
interface overview also implement none methods none properties readonly svganimatedtransformlist transform normative document svg 1.1 (2nd edition) properties name type description transform svganimatedtransformlist corresponds to attribute transform on the given element.
ScreenOrientation.lock() - Web APIs
syntax screenorientation.lock(orientation) parameters orientation an orientation lock type.
Screen Orientation API - Web APIs
38chrome android full support 38firefox android full support 43opera android full support 25safari ios no support nosamsung internet android full support 3.0typechrome full support 38edge full support 79firefox full support 43ie no support noopera full support 25safari no support nowebview ...
ScriptProcessorNode.bufferSize - Web APIs
e = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio track via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // give the node a function to process audio events scriptnode.onaudioprocess = function(audioprocessingevent...
ScriptProcessorNode - Web APIs
e = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio track via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // give the node a function to process audio events scriptnode.onaudioprocess = function(audioprocessingevent...
SecurityPolicyViolationEvent.SecurityPolicyViolationEvent() - Web APIs
syntax let spvevt = new securitypolicyviolationevent(type, eventinitdict); properties type a domstring representing the type of security policy violation that occurred.
Selection.modify() - Web APIs
WebAPISelectionmodify
syntax sel.modify(alter, direction, granularity) parameters alter the type of change to apply.
Selection.setBaseAndExtent() - Web APIs
<h1>setbaseandextent example</h1> <div> <p class="one"><span>fish</span><span>dog</span><span>cat</span><span>bird</span></p> <p>middle</p> <p class="two"><span>car</span><span>bike</span><span>boat</span><span>plane</span></p> </div> <div> <p> <label for="aoffset">anchor offset</label> <input id="aoffset" name="aoffset" type="number" value="0"> </p> <p> <label for="foffset">focus offset</label> <input id="foffset" name="foffset" type="number" value="0"> </p> <p><button>capture selection</button></p> </div> <p><strong>output</strong>: <span class="output"></span></p> the javascript looks like so: var one = document.queryselector('.one'); var two = document.queryselector('.two'); var aoffset = docum...
Selection - Web APIs
WebAPISelection
selection.typeread only returns a domstring describing the type of the current selection.
Selection API - Web APIs
samsung internet android full support yestype experimentalchrome full support yesedge full support 12firefox full support 57ie full support yesopera full support yessafari full support ...
SensorErrorEvent.SensorErrorEvent() - Web APIs
syntax sensorerrorevent = new sensorerrorevent(type, {error: domexception}); parameters type will always be 'sensorerrorevent'.
ServiceWorker.onstatechange - Web APIs
an eventlistener property called whenever an event of type statechange is fired; it is basically fired anytime the serviceworker.state changes.
ServiceWorker - Web APIs
event handlers serviceworker.onstatechange read only an eventlistener property called whenever an event of type statechange is fired; it is basically fired anytime the serviceworker.state changes.
ServiceWorkerContainer.register() - Web APIs
the registered service worker file needs to have a valid javascript mime type.
ServiceWorkerGlobalScope.onnotificationclick - Web APIs
}; example self.onnotificationclick = function(event) { console.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (var i = 0; i < clientlist.length; i++) { var client = clientlist[i]; if (client.url == '/' && 'focus' in client) return client.focus(); } if (clients.openwindow) return clients.openwindow('/'); })); }; specifications specification status comment notifications apithe definition of 'on...
ServiceWorkerGlobalScope: push event - Web APIs
self.addeventlistener("push", event => { let message = event.data.json(); switch(message.type) { case "init": doinit(); break; case "shutdown": doshutdown(); break; } }, false); specifications specification status comment push apithe definition of 'push' in that specification.
ServiceWorkerGlobalScope: pushsubscriptionchange event - Web APIs
self.addeventlistener("pushsubscriptionchange", event => { event.waituntil(swregistration.pushmanager.subscribe(event.oldsubscription.options) .then(subscription => { return fetch("register", { method: "post", headers: { "content-type": "application/json" }, body: json.stringify({ endpoint: subscription.endpoint }) }); }) ); }, false); when a pushsubscriptionchange event arrives, indicating that the subscription has expired, we resubscribe by calling the push manager's subscribe() method.
ServiceWorkerMessageEvent - Web APIs
it can be any data type.
ServiceWorkerRegistration.onupdatefound - Web APIs
the onupdatefound property of the serviceworkerregistration interface is an eventlistener property called whenever an event of type statechange is fired; it is fired any time the serviceworkerregistration.installing property acquires a new service worker.
ServiceWorkerRegistration - Web APIs
event handlers serviceworkerregistration.onupdatefound read only an eventlistener property called whenever an event of type updatefound is fired; it is fired any time the serviceworkerregistration.installing property acquires a new service worker.
Service Worker API - Web APIs
this is a special type of client object, with some additional methods and properties available.
SharedWorker - Web APIs
abstractworker.onerror is an eventlistener that is called whenever an errorevent of type error bubbles through the worker.
SpeechRecognitionError - Web APIs
speechrecognitionerror.error read only returns the type of error raised.
SpeechRecognitionErrorEvent - Web APIs
speechrecognitionerrorevent.error read only returns the type of error raised.
SpeechRecognitionEvent.interpretation - Web APIs
this might be determined, for instance, through the sisr specification of semantics in a grammar (see semantic interpretation for speech recognition (sisr) version 1.0 for specification and examples.) syntax var myinterpretation = event.interpretation; value the returned value can be of any type.
SpeechSynthesisEvent.name - Web APIs
the name read-only property of the speechsynthesisutterance interface returns the name associated with certain types of events occuring as the speechsynthesisutterance.text is being spoken: the name of the ssml marker reached in the case of a mark event, or the type of boundary reached in the case of a boundary event.
SpeechSynthesisEvent - Web APIs
speechsynthesisevent.name read only returns the name associated with certain types of events occuring as the speechsynthesisutterance.text is being spoken: the name of the ssml marker reached in the case of a mark event, or the type of boundary reached in the case of a boundary event.
SpeechSynthesisVoice.voiceURI - Web APIs
the voiceuri read-only property of the speechsynthesisvoice interface returns the type of uri and location of the speech synthesis service for this voice.
SpeechSynthesisVoice - Web APIs
speechsynthesisvoice.voiceuri read only returns the type of uri and location of the speech synthesis service for this voice.
StorageQuota - Web APIs
properties storagequota.supportedtypes read only returns a list of the available storage types.
Using writable streams - Web APIs
writing to actually write content to the stream we call the sendmessage() function, passing it a message to be written and the stream to write to: sendmessage("hello, world.", writablestream); the sendmessage() definition looks like so: function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sink."); }) .catch((err)...
Streams API - Web APIs
unpack chunks of a png: this example shows how pipethrough() can be used to transform a readablestream into a stream of other data types by transforming a data of a png file into a stream of png chunks.
StylePropertyMap.append() - Web APIs
example // tbd specifications specification status comment css typed om level 1the definition of 'append()' in that specification.
StylePropertyMap.clear() - Web APIs
return value undefined example // tbd specifications specification status comment css typed om level 1the definition of 'clear()' in that specification.
StylePropertyMap.delete() - Web APIs
return value undefined example // tbd specifications specification status comment css typed om level 1the definition of 'delete()' in that specification.
StylePropertyMap.set() - Web APIs
return value undefined example // tbd specifications specification status comment css typed om level 1the definition of 'set()' in that specification.
StylePropertyMapReadOnly.forEach() - Web APIs
example // tbd specifications specification status comment css typed om level 1the definition of 'foreach()' in that specification.
StylePropertyMapReadOnly.get() - Web APIs
perty = 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.appendchild(cssvalue); } specifications specification status comment css typed om level 1the definition of 'get()' in that specification.
StylePropertyMapReadOnly.getAll() - Web APIs
example // tbd specifications specification status comment css typed om level 1the definition of 'getall()' in that specification.
StylePropertyMapReadOnly.has() - Web APIs
example // tbd specifications specification status comment css typed om level 1the definition of 'has()' in that specification.
StylePropertyMapReadOnly.keys() - Web APIs
example // tbd specifications specification status comment css typed om level 1the definition of 'keys()' in that specification.
StylePropertyMapReadOnly.size - Web APIs
example // tbd specifications specification status comment css typed om level 1the definition of 'size' in that specification.
StylePropertyMapReadOnly.values() - Web APIs
example // tbd specifications specification status comment css typed om level 1the definition of 'values()' in that specification.
Stylesheet.href - Web APIs
WebAPIStyleSheethref
example // on a local machine: <html> <head> <link rel="stylesheet" href="example.css" type="text/css" /> <script> function sref() { alert(document.stylesheets[0].href); } </script> </head> <body> <div class="thunder">thunder</div> <button onclick="sref()">ss</button> </body> </html> // returns "file:////c:/windows/desktop/example.css notes if the style sheet is a linked style sheet, the value of its attribute is its location.
StyleSheet.media - Web APIs
WebAPIStyleSheetmedia
example <!doctype html> <html> <head> <link rel="stylesheet" href="document.css" type="text/css" media="screen" /> <style rel="stylesheet" type="text/css" media="screen, print"> body { background-color: snow; } </style> </head> <body> <script> for (var isheetindex = 0; isheetindex < document.stylesheets.length; isheetindex++) { console.log('document.stylesheets[' + string(isheetindex) + '].media: ' + json.stringify(document.stylesheets[isheetindex].media)); if (isheetindex === 0) document.stylesheets[isheetindex].media.appendmedium('handheld'); if (is...
StyleSheet - Web APIs
stylesheet.typeread only returns a domstring representing the style sheet language for this style sheet.
SubmitEvent() - Web APIs
syntax let submitevent = new submitevent(type,eventinitdict); parameters type a domstring indicating the event which occurred.
SubtleCrypto.deriveKey() - Web APIs
syntaxerror raised when keyusages is empty but the unwrapped key is of type secret or private.
SubtleCrypto.exportKey() - Web APIs
typeerror raised when trying to use an invalid format.
SubtleCrypto.wrapKey() - Web APIs
typeerror raised when trying to use an invalid format.
SyncEvent.SyncEvent() - Web APIs
syntax var mysyncevent = new syncevent(type, init) parameters type the type of the event.
TaskAttributionTiming - Web APIs
t x="201" y="1" width="210" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="306" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">taskattributiontiming</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties taskattributiontiming.containertype read only returns the type of frame container, one of iframe, embed, or object.
Text.replaceWholeText() - Web APIs
the returned node is the current node unless the current node is read only, in which case the returned node is a newly created text node of the same type which has been inserted at the location of the replacement.
Text.splitText() - Web APIs
WebAPITextsplitText
after the split, the current node contains all the content up to the specified offset point, and a newly created node of the same type contains the remaining text.
TextRange - Web APIs
WebAPITextRange
var range = document.selection.createrange(); var element = document.getelementbyid("test"); range.movetoelementtext(element); range.select(); // selected "sometexttobeselected" <!doctype html> <html> <head> <title>textrange example</title> </head> <body> <p id="test">sometexttobeselected</p> </body> </html> notes use textrange to operate the selection valid only under ie9.
TextTrack - Web APIs
WebAPITextTrack
texttrack.inbandmetadatatrackdispatchtype read only returns a domstring which indicates the track's in-band metadata track dispatch type.
TextTrackCue - Web APIs
texttrackcue is an abstract class which is used as the basis for the various derived cue types, such as vttcue; you will instead work with those derived types.
TextTrackList: change event - Web APIs
bubbles no cancelable no interface event event handler property onchange examples using addeventlistener(): const mediaelement = document.queryselectorall('video, audio')[0]; mediaelement.texttracks.addeventlistener('change', (event) => { console.log(`'${event.type}' event fired`); }); using the onchange event handler property: const mediaelement = document.queryselector('video, audio'); mediaelement.texttracks.onchange = (event) => { console.log(`'${event.type}' event fired`); }; specifications specification status html living standardthe definition of 'change' in that specification.
TextTrackList.length - Web APIs
each track can be accessed by treating the texttracklist as an array of objects of type texttrack.
TouchEvent.changedTouches - Web APIs
the changedtouches read-only property is a touchlist whose touch points (touch objects) varies depending on the event type, as follows: for the touchstart event, it is a list of the touch points that became active with the current event.
TrackDefault.byteStreamTrackID - Web APIs
if not specified in the constructor, this value will be an empty string and the sourcebuffer can contain any tracks of the specified trackdefault.type.
TrackDefault - Web APIs
properties trackdefault.type read only returns the type of track that this sourcebuffer's media segment data relates to (i.e.
TrackEvent.track - Web APIs
WebAPITrackEventtrack
syntax track = trackevent.track; value an object which is one of the types audiotrack, videotrack, or texttrack, depending on the type of media represented by the track.
TransitionEvent.initTransitionEvent() - Web APIs
do not use it anymore, use the standard constructor, transitionevent(), to create a synthetic transitionevent syntax transitionevent.inittransitionevent(typearg, canbubblearg, cancelablearg, transitionnamearg, elapsedtimearg); parameters typearg is a domstring identifying the specific type of transition event that occurred.
TransitionEvent - Web APIs
types of transitionevent transitioncancel an event fired when a css transition has been cancelled.
UIEvent.isChar - Web APIs
WebAPIUIEventisChar
example in this snippet, which is part of an event handler, the event is checked to see if it generates a character; if it does, the value of uievent.which is appended to a string which buffers the typed characters.
UIEvent.view - Web APIs
WebAPIUIEventview
obsolete from document object model (dom) level 2 events specification, changed the type of view from abstractview to windowproxy.
URL.origin - Web APIs
WebAPIURLorigin
the exact structure varies depending on the type of url: for http or https urls, the scheme followed by '://', followed by the domain, followed by ':', followed by the port (the default port, 80 and 443 respectively, if explicitely specified).
URL API - Web APIs
WebAPIURL API
the url standard also defines concepts such as domains, hosts, and ip addresses, and also attempts to describe in a standard way the legacy application/x-www-form-urlencoded mime type used to submit web forms' contents as a set of key/value pairs.
USBDevice.controlTransferIn() - Web APIs
the available options are: requesttype: must be one of three values specifying whether the tranfer is "standard" (common to all usb devices) "class" (common to an industry-standard class of devices) or "vendor".
USBDevice.isochronousTransferOut() - Web APIs
data a typedarray containing the data to send to the device.
USBDevice.opened - Web APIs
WebAPIUSBDeviceopened
let payload = new uint8array([r, g, b]); await usbdevice.controltransferout({ requesttype: 'vendor', recipient: 'device', request: 1, value: 0, index: 0, }, payload); } } specifications specification status comment webusbthe definition of 'opened' in that specification.
USBDevice.transferOut() - Web APIs
data a typedarray containing the data to send to the device.
UserDataHandler - Web APIs
operation (unsigned short) is an operation type integer (see below).
validityState.badInput - Web APIs
example <input type="number" id="age"> var input = document.getelementbyid("age"); if (input.validity.badinput) { console.log("bad input detected…"); } else { console.log("content of input ok."); } specifications specification status comment html living standardthe definition of 'validitystate.badinput' in that specification.
ValidityState - Web APIs
typemismatch read only a boolean that is true if the value is not in the required syntax (when type is email or url), or false if the syntax is correct.
VideoTrack.kind - Web APIs
WebAPIVideoTrackkind
syntax var trackkind = videotrack.kind; value a domstring specifying the type of content the media represents.
VideoTrackList.length - Web APIs
each track can be accessed by treating the videotracklist as an array of objects of type videotrack.
WEBGL_color_buffer_float - Web APIs
ext.framebuffer_attachment_component_type_ext ?
WEBGL_draw_buffers - Web APIs
x[3], 0); mapping the color attachments to draw buffer slots that the fragment shader will write to using gl_fragdata: ext.drawbufferswebgl([ ext.color_attachment0_webgl, // gl_fragdata[0] ext.color_attachment1_webgl, // gl_fragdata[1] ext.color_attachment2_webgl, // gl_fragdata[2] ext.color_attachment3_webgl // gl_fragdata[3] ]); shader code that writes to multiple textures: <script type="x-shader/x-fragment"> #extension gl_ext_draw_buffers : require precision highp float; void main(void) { gl_fragdata[0] = vec4(0.25); gl_fragdata[1] = vec4(0.5); gl_fragdata[2] = vec4(0.75); gl_fragdata[3] = vec4(1.0); } </script> specifications specification status comment webgl_draw_buffersthe definition of 'webgl_draw_buffers' in that specification.
WEBGL_lose_context.loseContext() - Web APIs
syntax gl.getextension('webgl_lose_context').losecontext(); examples with this method, you can simulate the webglcontextlost event: var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); canvas.addeventlistener('webglcontextlost', function(e) { console.log(e); }, false); gl.getextension('webgl_lose_context').losecontext(); // webglcontextevent event with type "webglcontextlost" is logged.
WEBGL_lose_context - Web APIs
examples with this extension, you can simulate the webglcontextlost and webglcontextrestored events: const canvas = document.getelementbyid('canvas'); const gl = canvas.getcontext('webgl'); canvas.addeventlistener('webglcontextlost', (event) => { console.log(event); }); gl.getextension('webgl_lose_context').losecontext(); // webglcontextevent event with type "webglcontextlost" is logged.
WakeLock.request() - Web APIs
WebAPIWakeLockrequest
syntax var wakelock = navigator.wakelock.request(type); parameters type options are as follows: 'screen': requests a screen wake lock.
WaveShaperNode.WaveShaperNode() - Web APIs
oversample: specifies what type of oversampling (if any) should be used when applying the shaping curve.
WaveShaperNode.curve - Web APIs
function makedistortioncurve(amount) { var k = typeof amount === 'number' ?
WaveShaperNode.oversample - Web APIs
function makedistortioncurve(amount) { var k = typeof amount === 'number' ?
WaveShaperNode - Web APIs
function makedistortioncurve(amount) { var k = typeof amount === 'number' ?
WebGL2RenderingContext.beginTransformFeedback() - Web APIs
syntax void gl.begintransformfeedback(primitivemode); parameters primitivemode a glenum specifying the output type of the primitives that will be recorded into the buffer objects that are bound for transform feedback.
WebGL2RenderingContext.drawArraysInstanced() - Web APIs
syntax void gl.drawarraysinstanced(mode, first, count, instancecount); parameters mode a glenum specifying the type primitive to render.
WebGL2RenderingContext.getActiveUniforms() - Web APIs
possible values: gl.uniform_type: returns an array of glenum indicating the types of the uniforms.
WebGL2RenderingContext.getInternalformatParameter() - Web APIs
pname a glenum specifying the type of information to query.
WebGL2RenderingContext.getSyncParameter() - Web APIs
possible values: gl.object_type: returns a glenum indicating the type of the sync object (always gl.sync_fence).
WebGL2RenderingContext.uniform[1234][uif][v]() - Web APIs
possible types: a number for unsigned integer values (methods with ui), for integer values (methods with i), or for floats (methods with f).
WebGLActiveInfo - Web APIs
webglactiveinfo.type the read-only type of the requested variable.
WebGLContextEvent - Web APIs
examples with the help of the webgl_lose_context extension, you can simulate the webglcontextlost and webglcontextrestored events: var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); canvas.addeventlistener('webglcontextlost', function(e) { console.log(e); }, false); gl.getextension('webgl_lose_context').losecontext(); // webglcontextevent event with type "webglcontextlost" is logged.
WebGLRenderingContext.bufferSubData() - Web APIs
srcdata optional an arraybuffer, sharedarraybuffer or one of the arraybufferview typed array types that will be copied into the data store.
WebGLRenderingContext.createShader() - Web APIs
syntax webglshader gl.createshader(type); parameters type either gl.vertex_shader or gl.fragment_shader examples see webglshader for usage and examples.
WebGLRenderingContext.drawArrays() - Web APIs
syntax void gl.drawarrays(mode, first, count); parameters mode a glenum specifying the type primitive to render.
WebGLRenderingContext.frontFace() - Web APIs
syntax void gl.frontface(mode); parameters mode a glenum type winding orientation.
WebGLRenderingContext.getTexParameter() - Web APIs
possible values: pname return type description possible return values available in a webgl 1 context gl.texture_mag_filter glenum texture magnification filter gl.linear (default value), gl.nearest.
WebGLRenderingContext.getUniformLocation() - Web APIs
the webgluniformlocation type is compatible with the glint type when specifying the index or location of a uniform attribute.
WebGLRenderingContext.makeXRCompatible() - Web APIs
html the html for the buttons looks lke this: <button class="green button" type="button">start game</button> <button class="blue button use-webxr" type="button">start game (vr mode)</button> the first button starts the game, continuing to present the game onscreen as usual.
WebGLRenderingContext.uniform[1234][fi][v]() - Web APIs
possible types: a floating point number for floating point values (methods with "f").
Basic scissoring - Web APIs
<p>result of of scissoring.</p> <canvas>your browser does not seem to support html5 canvas.</canvas> body { text-align : center; } canvas { display : block; width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } window.addeventlistener("load", function setupwebgl (evt) { "use strict" window.removeeventlistener(evt.type, setupwebgl, false); var paragraph = document.queryselector("p"); var canvas = document.queryselector("canvas"); // the following two lines set the size (in css pixels) of // the drawing buffer to be identical to the size of the // canvas html element, as determined by css.
Clearing by clicking - Web APIs
window.removeeventlistener(evt.type, setupwebgl, false); // adding the same click event handler to both canvas and // button.
Clearing with colors - Web APIs
window.removeeventlistener(evt.type, setupwebgl, false); // references to the document elements.
Color masking - Web APIs
display : inline-block; font-family : serif; font-size : inherit; font-weight : 900; color : white; margin : auto; padding : 0.6em 1.2em; } #red-toggle { background-color : red; } #green-toggle { background-color : green; } #blue-toggle { background-color : blue; } window.addeventlistener("load", function setupanimation (evt) { "use strict" window.removeeventlistener(evt.type, setupanimation, false); var canvas = document.queryselector("canvas"); var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { document.queryselector("p").innerhtml = "failed to get webgl context." + "your browser or device may not support webgl."; return; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight...
Raining rectangles - Web APIs
ht : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : block; font-size : inherit; margin : auto; padding : 0.6em; } ;(function(){ "use strict" window.addeventlistener("load", setupanimation, false); var gl, timer, rainingrect, scoredisplay, missesdisplay; function setupanimation (evt) { window.removeeventlistener(evt.type, setupanimation, false); if (!(gl = getrenderingcontext())) return; gl.enable(gl.scissor_test); rainingrect = new rectangle(); timer = settimeout(drawanimation, 17); document.queryselector("canvas") .addeventlistener("click", playerclick, false); var displays = document.queryselectorall("strong"); scoredisplay = displays[0]; missesdisplay = displays[1]; } var score = 0...
Using shaders to apply color in WebGL - Web APIs
{ const numcomponents = 4; const type = gl.float; const normalize = false; const stride = 0; const offset = 0; gl.bindbuffer(gl.array_buffer, buffers.color); gl.vertexattribpointer( programinfo.attriblocations.vertexcolor, numcomponents, type, normalize, stride, offset); gl.enablevertexattribarray( programinfo.attriblocations.vertexcolor); } view th...
WebGL best practices - Web APIs
al */ dstoffset, /* optional */ length) { const sync = gl.fencesync(gl.sync_gpu_commands_complete, 0); gl.flush(); await clientwaitasync(gl, sync, 0, 10); gl.deletesync(sync); gl.bindbuffer(target, buffer); gl.getbuffersubdata(target, srcbyteoffset, dstbuffer, dstoffset, length); gl.bindbuffer(target, null); return dest; } async function readpixelsasync(gl, x, y, w, h, format, type, dest) { const buf = gl.createbuffer(); gl.bindbuffer(gl.pixel_pack_buffer, buf); gl.bufferdata(gl.pixel_pack_buffer, dest.bytelength, gl.stream_read); gl.readpixels(x, y, w, h, format, type, 0); gl.bindbuffer(gl.pixel_pack_buffer, null); await getbuffersubdataasync(gl, gl.pixel_pack_buffer, buf, 0, dest); gl.deletebuffer(buf); return dest; } canvas and webgl-related some tip...
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
these correspond to the following three types of transport supported by rtcpeerconnection: rtcrtpsender rtcrtpsenders handle the encoding and transmission of mediastreamtrack data to a remote peer.
Lifetime of a WebRTC session - Web APIs
information exchanged during signaling there are three basic types of information that need to be exchanged during signaling: control messages used to set up, open, and close the communication channel, and to handle errors.
WebSocket() - Web APIs
these strings are used to indicate sub-protocols, so that a single server can implement multiple websocket sub-protocols (for example, you might want one server to be able to handle different types of interactions depending on the specified protocol).
WebSocket - Web APIs
WebAPIWebSocket
constants constant value websocket.connecting 0 websocket.open 1 websocket.closing 2 websocket.closed 3 properties websocket.binarytype the binary data type used by the connection.
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
in cinematography, cant can be used to simulate various types of unsteady motion such as waves or turbulence, but can also be used for dramatic effect.
WebXR Device API - Web APIs
learn how reference spaces are used to position objects—and the viewer—and the differences among the available types of reference space, as well as their use cases.
Using the Web Animations API - Web APIs
n fact, do so by referencing alicechange’s animation.effect property, which returns an object containing all the details of the effect(s) active on alice: alicechange.currenttime = alicechange.effect.getcomputedtiming().duration / 2; effect lets us access the animation’s keyframes and timing properties — alicechange.effect.getcomputedtiming() points to alice’s timing object (which is of type computedeffecttiming) — this contains her computedeffecttiming.duration.
Web Animations API Concepts - Web APIs
we currently have only one animation effect type available: keyframeeffect.
Basic concepts behind Web Audio API - Web APIs
several sources — with different types of channel layout — are supported even within a single context.
Web Audio API best practices - Web APIs
setting audioparam values there are two ways to manipulate audionode values, which are themselves objects of type audioparam interface.
Attestation and Assertion - Web APIs
there are two different types of certificates used in webauthn for registration and authentication.
Web Speech API - Web APIs
grammar is defined using jspeech grammar format (jsgf.) speech synthesis is accessed via the speechsynthesis interface, a text-to-speech component that allows programs to read out their text content (normally via the device's default speech synthesiser.) different voice types are represented by speechsynthesisvoice objects, and different parts of text that you want to be spoken are represented by speechsynthesisutterance objects.
Using the Web Storage API - Web APIs
here is a function that detects whether localstorage is both supported and available: function storageavailable(type) { var storage; try { storage = window[type]; var x = '__storage_test__'; storage.setitem(x, x); storage.removeitem(x); return true; } catch(e) { return e instanceof domexception && ( // everything except firefox e.code === 22 || // firefox e.code === 1014 || // test name fi...
Web Storage API - Web APIs
web storage interfaces storage allows you to set, retrieve and remove data for a specific domain and storage type (session or local.) window the web storage api extends the window object with two new properties — window.sessionstorage and window.localstorage — which provide access to the current domain's session and local storage objects respectively, and a window.onstorage event handler that fires when a storage area changes (e.g.
WheelEvent() - Web APIs
syntax var wheelevent = new wheelevent(typearg, wheeleventinit); properties typearg is a domstring representing the name of the event.
Window.controllers - Web APIs
syntax controllers = window.controllers controllers is an object of type xulcontrollers (nsicontrollers).
Window.crypto - Web APIs
WebAPIWindowcrypto
javascript genrandomnumbers = function getrandomnumbers() { var array = new uint32array(10); window.crypto.getrandomvalues(array); var randtext = document.getelementbyid("myrandtext"); randtext.innerhtml = "the random numbers are: " for (var i = 0; i < array.length; i++) { randtext.innerhtml += array[i] + " "; } } html <p id="myrandtext">the random numbers are: </p> <button type="button" onclick='genrandomnumbers()'>generate 10 random numbers</button> result specifications specification status comment web cryptography apithe definition of 'window.crypto' in that specification.
Window.directories - Web APIs
syntax var dirbar = window.directories; parameters dirbar is an object of the type barprop.
Window.find() - Web APIs
WebAPIWindowfind
" + window.find(text)); } html <p>apples, bananas, and oranges.</p> <button type="button" onclick='findstring("apples")'>search for apples</button> <button type="button" onclick='findstring("banana")'>search for banana</button> <button type="button" onclick='findstring("orange")'>search for orange</button> result notes in some browsers, window.find() selects (highlights) the found content on the site.
Window.getDefaultComputedStyle() - Web APIs
the object is of the same type as the object returned by window.getcomputedstyle(), but only takes into account user-agent and user rules.
Window.getSelection() - Web APIs
where display: none is set) firefox will return null, whereas other browsers will return a selection object with selection.type set to none.
Window: load event - Web APIs
WebAPIWindowload event
ce event event handler property onload examples log a message when the page is fully loaded: window.addeventlistener('load', (event) => { console.log('page is fully loaded'); }); the same, but using the onload event handler property: window.onload = (event) => { console.log('page is fully loaded'); }; live example html <div class="controls"> <button id="reload" type="button">reload</button> </div> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="30"></textarea> </div> css body { display: grid; grid-template-areas: "control log"; } .controls { grid-area: control; display: flex; align-items: center; justify-content: center; } .event-log { grid-area: log; } .event-log-conten...
Window.locationbar - Web APIs
<!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>various dom tests</title> <script> var visible = window.locationbar.visible; </script> </head> <body> <p>various dom tests</p> </body> </html> specifications specification status comment html living standardthe definition of 'window.locationbar' in that specification.
Window.ondevicelight - Web APIs
these events are of type devicelightevent.
Window.ondeviceproximity - Web APIs
these events are of type deviceproximityevent.
Window.ondragdrop - Web APIs
WebAPIWindowondragdrop
<html> <head><title>dragdroptest</title> <script type="text/javascript"> window.addeventlistener("dragdrop", testfunc, false); function testfunc(event) { alert("dragdrop!"); event.stoppropagation(); } </script> </head> <body> i am bodytext </body> </html> specification not part of specification.
Window.ongamepadconnected - Web APIs
the event object is of type gamepadevent.
Window.ongamepaddisconnected - Web APIs
the event object is of type gamepadevent.
Window.onuserproximity - Web APIs
these events are of type userproximityevent and occur when the the device sensor detects that an object becomes nearby.
Window.openDialog() - Web APIs
WebAPIWindowopenDialog
passing extra parameters to the dialog to pass extra parameters into the dialog, you can simply supply them after the windowfeatures parameter: opendialog("http://example.tld/zzz.xul", "dlg", "", "pizza", 6.98); the extra parameters will then get packed into a property named arguments of type array, and this property gets added to the newly opened dialog window.
Window.personalbar - Web APIs
<!doctype html> <html> <head> <title>various dom tests</title> <script> // changing bar states on the existing window netscape.security.privilegemanager.enableprivilege("universalbrowserwrite"); window.personalbar.visible = !window.personalbar.visible; </script> </head> <body> <p>various dom tests</p> </body> </html> notes when you load the example page above, the browser displays the following dial...
Window.prompt() - Web APIs
WebAPIWindowprompt
const anumber = number(window.prompt("type a number", "")); specification specification status comment html living standardthe definition of 'prompt()' in that specification.
Window.requestFileSystem() - Web APIs
window.requestfilesystem(type, size, successcallback[, errorcallback]); parameters type the type of storage to request.
Window.scrollbars - Web APIs
WebAPIWindowscrollbars
<!doctype html> <html> <head> <title>various dom tests</title> <script> let visiblescrollbars = window.scrollbars.visible; </script> </head> <body> <p>various dom tests</p> </body> </html> specifications specification status comment html living standardthe definition of 'window.scrollbars' in that specification.
Window.statusbar - Web APIs
WebAPIWindowstatusbar
<!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>various dom tests</title> <script> // changing bar states on the existing window netscape.security.privilegemanager.enableprivilege("universalbrowserwrite"); window.statusbar.visible=!window.statusbar.visible; </script> </head> <body> <p>various dom tests</p> </body> </html> notes when you load the example page above, the browser dis...
Window.toolbar - Web APIs
WebAPIWindowtoolbar
<!doctype html> <html> <head> <title>various dom tests</title> <script> // changing bar states on the existing window netscape.security.privilegemanager.enableprivilege("universalbrowserwrite"); window.toolbar.visible=!window.toolbar.visible; </script> </head> <body> <p>various dom tests</p> </body> </html> notes when you load the example page above, the browser displays the following dialog: to t...
Window.window - Web APIs
WebAPIWindowwindow
this means: global variables of your script are in fact properties of window: var global = {data: 0}; alert(global === window.global); // displays "true" you can access built-in properties of the window object without having to type window.
WindowClient.focus() - Web APIs
example self.addeventlistener('notificationclick', function(event) { console.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (var i = 0; i < clientlist.length; i++) { var client = clientlist[i]; if (client.url == '/' && 'focus' in client) return client.focus(); } if (clients.openwindow) return clients.openwindow('/'); })); }); specifications specification status comment service workersthe definition of 'focu...
WindowClient.focused - Web APIs
example self.addeventlistener('notificationclick', function(event) { console.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (var i = 0; i < clientlist.length; i++) { var client = clientlist[i]; if (client.url == '/' && 'focus' in client) { if(!client.focused) return client.focus(); } } } if (clients.openwindow) return clients.openwindow('/'); })); }); specifications specification status comme...
WindowClient.visibilityState - Web APIs
example event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (let i = 0; i < clientlist.length; i++) { let client = clientlist[i]; if (client.url == '/' && 'focus' in client) { if (client.visibilitystate === 'hidden') return client.focus(); } } } if (clients.openwindow) { return clients.openwindow('/'); } })); }); specifications specification status comment service wo...
WindowClient - Web APIs
example self.addeventlistener('notificationclick', function(event) { console.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (var i = 0; i < clientlist.length; i++) { var client = clientlist[i]; if (client.url == '/' && 'focus' in client) { client.focus(); break; } } if (clients.openwindow) return clients.openwindow('/'); })); }); specifications specification status comment service workersthe d...
WindowEventHandlers.onhashchange - Web APIs
'location1' : 'location2'; } the hashchange event the dispatched hashchange event has the following properties: field type description newurl domstring the new url to which the window is navigating.
WindowEventHandlers.onlanguagechange - Web APIs
an event handler always has one single parameter, containing the event, here of type event.
WindowEventHandlers.onmessageerror - Web APIs
the onmessageerror event handler of the windoweventhandlers interface is an eventlistener, called whenever an messageevent of type messageerror is fired on a window—that is, when it receives a message that cannot be deserialized.
WindowEventHandlers - Web APIs
note: windoweventhandlers is a mixin and not an interface; you can't actually create an object of type windoweventhandlers.
WindowOrWorkerGlobalScope.clearTimeout() - Web APIs
var alarm = { remind: function(amessage) { alert(amessage); this.timeoutid = undefined; }, setup: function() { if (typeof this.timeoutid === 'number') { this.cancel(); } this.timeoutid = window.settimeout(function(msg) { this.remind(msg); }.bind(this), 1000, 'wake up!'); }, cancel: function() { window.cleartimeout(this.timeoutid); } }; window.onclick = function() { alarm.setup(); }; notes passing an invalid id to cleartimeout() silently does nothing; no exception is thrown.
WindowOrWorkerGlobalScope - Web APIs
note: windoworworkerglobalscope is a mixin and not an interface; you can't actually create an object of type windoworworkerglobalscope.
Worker.onmessage - Web APIs
WebAPIWorkeronmessage
these events are of type messageevent and will be called when the worker's parent receives a message (i.e.
Worker.onmessageerror - Web APIs
the onmessageerror event handler of the worker interface is an eventlistener, called whenever an messageevent of type messageerror is fired on the worker instance — that is, when it receives a message that cannot be deserialized.
WorkerGlobalScope.importScripts() - Web APIs
exceptions networkerror imported scripts were not served with a valid javascript mime type (i.e.
WorkerGlobalScope - Web APIs
this interface is usually specialized by each worker type: dedicatedworkerglobalscope for dedicated workers, sharedworkerglobalscope for shared workers, and serviceworkerglobalscope for serviceworker.
Worklet - Web APIs
WebAPIWorklet
worklet types worklets are restricted to specific use cases; they cannot be used for arbitrary computations like web workers.
WritableStream.WritableStream() - Web APIs
const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sink."); }) .catch((err)...
WritableStream.abort() - Web APIs
exceptions typeerror the stream you are trying to abort is not a writablestream, or it is locked.
WritableStream - Web APIs
const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sink."); }) .catch((err)...
WritableStreamDefaultController.error() - Web APIs
exceptions typeerror the stream you are trying to error is not a writablestream.
WritableStreamDefaultWriter.abort() - Web APIs
exceptions typeerror the stream you are trying to abort is not a writablestream, or it is locked.
WritableStreamDefaultWriter.desiredSize - Web APIs
exceptions typeerror the writer’s lock is released.
WritableStreamDefaultWriter.ready - Web APIs
function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter var defaultwriter = writablestream.getwriter(); var encoder = new textencoder(); var encoded = encoder.encode(message, {stream: true}); encoded.foreach(function(chunk) { // make sure the stream and its writer are able to // receive data.
WritableStreamDefaultWriter - Web APIs
const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sink."); }) ...
XMLDocument - Web APIs
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.
XMLHttpRequest.mozResponseArrayBuffer - Web APIs
obsolete since gecko 6 is an arraybuffer response to the request, written as a javascript typed array.
XMLHttpRequest.multipart - Web APIs
if set to true, the content type of the initial response must be multipart/x-mixed-replace or an error will occur.
XMLHttpRequest.readyState - Web APIs
if responsetype is "text" or empty string, responsetext will have the partial text response as it loads.
XMLHttpRequest.setRequestHeader() - Web APIs
if no accept header has been set using this, an accept header with the type "*/*" is sent with the request when send() is called.
XPathException - Web APIs
type_err 52 if the expression cannot be converted to return the specified type.
XREnvironmentBlendMode - Web APIs
the webxr api's enumerated type xrenvironmentblendmode defines strings used to identify if and how to blend the rendered virtual content with the real world.
XREye - Web APIs
WebAPIXREye
the xreye enumerated type is used to identify which eye a particular xrview represents: left or right; or, if the view doesn't represent a single eye, the value may be none.
XRFrame.getPose() - Web APIs
WebAPIXRFramegetPose
for example, to get the position of a controller relative to the viewer's head, you would compare the controller's gripspace to the xrreferencespace of type viewer.
XRHandedness - Web APIs
the webxr enumerated type xrhandedness provides values which identify which of a user's hands is being used to operate a particular input controller attached to the xr input device being used.
XRInputSource.handedness - Web APIs
the value, which comes from the xrhandedness enumerated type, is one of the following: none the input controller is not associated with one of the user's hands.
XRInputSource.targetRayMode - Web APIs
syntax let raymode = xrinputsource.targetraymode; value a domstring taken from the xrtargetraymode enumerated type, indicating which method to use when generating and presenting the target ray to the user.
XRInputSourceArray.entries() - Web APIs
examples this example snippet gets the list of inputs for a session and tries to handle each type of input device it supports using.
XRInputSourceArray.forEach() - Web APIs
examples this example snippet gets the list of inputs for a session and tries to handle each type of input device it supports using.
XRInputSourceArray.keys() - Web APIs
examples this example snippet gets the list of inputs for a session and tries to handle each type of input device it supports using.
XRInputSourceArray - Web APIs
you may also use the features of the symbol type.
XRInputSourceEvent.inputSource - Web APIs
the device type is identified by looking at the xrinputsource in inputsource and its targetraymode property.
XRInputSourceEvent - Web APIs
event types select sent to an xrsession when the sending input source has fully completed a primary action.
XRInputSourceEventInit.frame - Web APIs
syntax xrinputsourceeventinit.frame = xrframe; let xrinputsourceeventinit = { frame: xrframe }; let xrinputsourceevent = new xrinputsourceevent(type, { frame: xrframe }); value an xrframe indicating the time at which the event took place, and providing a getpose() method which can be used to map reference spaces to the world reference space.
XRInputSourceEventInit.inputSource - Web APIs
syntax let xrinputsourceeventinit.inputsource = xrinputsource; let xrinputsourceeventinit = { inputsource: xrinputsource }; let xrinputsourceevent = new xrinputsourceevent(type, { inputsource: xrinputsource }); value an xrinputsource object indicating the source of the newly-created xrinputsourceevent to be created.
XRReferenceSpace.getOffsetReferenceSpace() - Web APIs
the object returned by getoffsetreferencespace() is an xrreferencespace if called on an xrreferencespace, or an xrboundedreferencespace if called on an object of that type.
XRReferenceSpaceEventInit.referenceSpace - Web APIs
examples this simple snippet calls the constructor to create a new reference space event of type reset.
XRReferenceSpaceEventInit.transform - Web APIs
examples this simple snippet calls the constructor to create a new reference space event of type reset.
XRReferenceSpaceEventInit - Web APIs
examples this simple snippet calls the constructor to create a new reference space event of type reset.
XRRigidTransform - Web APIs
xrsession.requestreferencespace(refspacetype) .then((refspace) => { xrreferencespace = refspace; xrreferencespace = xrreferencespace.getoffsetreferencespace( new xrrigidtransform(viewerstartposition, cubeorientation)); animationframerequestid = xrsession.requestanimationframe(drawframe); specifications specification status comment webxr device apithe definition of 'xrrigidtransform' in that specif...
XRSession: inputsourceschange event - Web APIs
the received event, of type xrinputsourceschangeevent, contains a list of any newly added and/or removed input devices.
XRSession.requestAnimationFrame() - Web APIs
note: a real application should check that the device and the user agent support webxr api at all and then that they both support the desired session type via xr.issessionsupported().
XRSession.visibilityState - Web APIs
syntax visibilitystate = xrsession.visibilitystate; value a domstring containing one of the values defined in the enumerated type xrvisibilitystate; this string indicates whether or not the xr content is visible to the user and if it is, whether or not it's currently the primary focus.
XRSessionEvent - Web APIs
session event types the following events are represented using the xrsessionevent interface, and are permitted values for its type property.
XRSessionEventInit.session - Web APIs
syntax let sessioneventinit = { session: xrsession }; mysessionevent = new xrsessionevent(type, sessioneventinit); mysessionevent = new xrsessionevent(type, { session: xrsession }); value an xrsession object indicating which webxr session the event is referring to.
XRSystem: requestSession() - Web APIs
the xrsystem interface's requestsession() method returns a promise which resolves to an xrsession object through which you can manage the requested type of webxr session.
XRTargetRayMode - Web APIs
the webxr device api enumerated type xrtargetraymode describes the method by an input controller's targeting ray is being produced.
XRVisibilityState - Web APIs
the xrvisibilitystate enumerated type defines the string values which are valid for the xrsession interface's visibilitystate property, which indicates whether or not an xr session is currently visible to the user, and if it is, whether or not it's currently the primary focus.
XSLT Basic Example - Web APIs
figure 1 : simple xslt example xml document (example.xml) : <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="example.xsl"?> <article> <title>my article</title> <authors> <author>mr.
XSLTProcessor - Web APIs
the resultant object depends on the output method of the stylesheet: output method result type html htmldocument xml xmldocument text xmldocument with a single root element <transformiix:result> with the text as a child [throws] void xsltprocessor.setparameter(string namespaceuri, string localname, any value) sets a parameter in the xslt stylesheet that was imported.
msCaching - Web APIs
WebAPImsCaching
syntax cachestate = object.mscaching values type: domstring property value description auto disables caching for stream or ms-stream data.
msPutPropertyEnabled - Web APIs
return value type = hresult: if this method succeeds, it returns s_ok.
msRegionOverflow - Web APIs
syntax string = object.msregionoverflow values type:domstring overflow: the region element's content overflows the region's content box.
mssitemodejumplistitemremoved - Web APIs
parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interface for the current event.
msthumbnailclick - Web APIs
parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interface for the current event.
Using the alertdialog role - Accessibility
as the name implies, alertdialog is a type of dialog.
Using the aria-relevant attribute - Accessibility
the aria-relevant attribute is an optional value used to describe what types of changes have occurred to an aria-live region, and which are relevant and should be announced.
Using the aria-required attribute - Accessibility
examples example 1: a simple form <form action="post"> <label for="firstname">first name:</label> <input id="firstname" type="text" aria-required="true" /> <br/> <label for="lastname">last name:</label> <input id="lastname" type="text" aria-required="true" /> <br/> <label for="streetaddress">street address:</label> <input id="streetaddress" type="text" /> </form> working examples: tooltip example (includes the use of the aria-required attribute) notes used in aria roles combobox ...
Using the link role - Accessibility
nk created using a span </span> <p><a href="https://mozilla.org" target="_blank">actual real link</a></p> css span[role="link"] { color: blue; text-decoration: underline; cursor: pointer; } span[role="link"]:focus { outline: 1px dotted black; } javascript const spanelem = document.queryselector('span'); //handles clicks and keydowns on the link function navigatelink(e) { if (e.type === 'click' || e.key === 'enter') { let ref = e.target != null ?
Using the log role - Accessibility
in contrast to other types of live region, this role is sequentially ordered and new information is only added to the end of the log.
Using the slider role - Accessibility
<label for="fader">volume</label> <input type="range" id="fader" min="1" max="100" value="50" step="1" aria-valuemin="1" aria-valuemax="100" aria-valuenow="50" oninput="outputupdate(value)"> <output for="fader" id="volume">50</output> the following code snippet allows you to return the output as it is updated by user input: function outputupdate(vol) { document.queryselector('#volume').value = vol; } example 2: text ...
Using the status role - Accessibility
the status role is a type of live region and a container whose content is advisory information for the user that is not important enough to justify an alert, and is often presented as a status bar.
Using ARIA: Roles, states, and properties - Accessibility
aria defines semantics that can be applied to elements, with these divided into roles (defining a type of user interface element) and states and properties that are supported by a role.
ARIA: alert role - Accessibility
<button type="button" onclick="triggeralert">trigger alert</button> <p class="alert">the alert will trigger when the button is pressed.</p> function triggeralert() { var alertel = document.queryselector('.alert'); alertel.addattribute("role", "alert"); } accessibility concerns the alert role should read out content that has changed, or bring the user's attention to it immediately, so it should not b...
ARIA: application role - Accessibility
in addition, a set of so-called quick navigation keys has been established over the years that allows blind users to skim through a page via a certain element type.
ARIA: Complementary role - Accessibility
<aside id="sidebar" aria-label="sponsors"> <!-- content --> </aside> redundant descriptions screen readers will announce the type of role the landmark is.
ARIA: contentinfo role - Accessibility
<footer aria-label="footer"> <!-- footer content --> </footer> </body> redundant descriptions screen readers will announce the type of role the landmark is.
ARIA: Main role - Accessibility
subsections of this document could discuss their history, the different types, regions where they grow, etc.
ARIA: Navigation Role - Accessibility
<footer> <nav id="footer-nav" aria-label="main"> <!-- list of links to main website locations --> </nav> </footer> redundant descriptions screen readers will announce the type of role the landmark is.
ARIA: img role - Accessibility
this is obvious to fix in the case of images (you can use the alt attribute), but in the case of mixed or other certain types of content it is not so obvious, and role="img" can come into play.
ARIA: row role - Accessibility
these cells can be of different types, depending on whether they are column or row headers, or grid or regular cells.
ARIA: switch role - Accessibility
<button type="button" role="switch" aria-checked="true" id="speakerpower" class="switch"> <span>off</span> <span>on</span> </button> <label for="speakerpower" class="switch">speaker power</label> description the aria switch role is identical to the checkbox role, except instead of being "checked" or "unchecked", it is either "on" and "off." like the checkbox role, the aria-checked attribute is required.
ARIA: checkbox role - Accessibility
instead use the native html checkbox of <input type="checkbox">, which natively provides all the functionality required: <input type="checkbox" id="chk1-label"> <label for="chk1-label">remember my preferences</label> description the native html checkbox form control can only have two checked states ("checked" or "not checked"), with an indeterminate state settable via javascript.
ARIA: dialog role - Accessibility
examples a dialog containing a form <div role="dialog" aria-labelledby="dialog1title" aria-describedby="dialog1desc"> <h2 id="dialog1title">subscription form</h2> <p id="dialog1desc">we will not share this information with third parties.</p> <form> <p> <label for="firstname">first name</label> <input id="firstname" type="text" /> </p> <p> <label for="lastname">last name</label> <input id="lastname" type="text"/> </p> <p> <label for="interests">interests</label> <textarea id="interests"></textarea> </p> <p> <input type="checkbox" id="autologin"/> <label for="autologin">auto-login?</label> </p> <p> <input type="submit" value...
WAI-ARIA Roles - Accessibility
alertdialog banner combobox command columnheader (estelle) complementary composite definition directory feed gridcell (eric e) group input landmark link - old page listbox log - old page marquee math menu menubar menuitem menuitemcheckbox menuitemradio none note option presentation progressbar - old page radio - old page radiogroup range region roletype rowheader(estelle) scrollbar searchbox section sectionhead select separator slider - old page spinbutton status - old page structure tab tablist (michiel) tabpanel (michiel) term timer toolbar tooltip tree treegrid treeitem widget window ...
Multipart labels: Using ARIA for labels with embedded fields inside them - Accessibility
example: shut down computer after minutes <input aria-labelledby="labelshutdown shutdowntime shutdownunit" type="checkbox" /> <span id="labelshutdown">shut down computer after</span> <input aria-labelledby="labelshutdown shutdowntime shutdownunit" id="shutdowntime" type="text" value="10" /> <span id="shutdownunit"> minutes</span> a note for jaws 8 users jaws 8.0 has its own logic to find labels, causing it to always override the accessiblename the textbox of an html document gets.
Architecture - Accessibility
node types text content (role_text) objects are implemented by nstextaccessible.
Keyboard - Accessibility
you can make it operable with the keyboard by defining an onkeydown event handler; in most cases, the action taken by event handler should be the same for both types of events.
Custom properties (--*): CSS variables - CSS: Cascading Style Sheets
WebCSS--*
initial valuesee proseapplies toall elementsinheritedyescomputed valueas specified with variables substitutedanimation typediscrete syntax --somekeyword: left; --somecolor: #0000ff; --somecomplexvalue: 3px 6px rgb(20, 32, 54); <declaration-value> this value matches any sequence of one or more tokens, so long as the sequence does not contain an unallowed token.
-moz-context-properties - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toany element that can have an image 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.
-moz-float-edge - CSS: Cascading Style Sheets
formal definition initial valuecontent-boxapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax border-box | content-box | margin-box | padding-box examples html <div class="box"> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> </div> css .box { display: block; height: 5px; margin: 0.5em auto 0.5em auto; color: gray; -moz-float-edge: margin-box; box-sizing: border-box; } result specifications not part of any standard.
-moz-force-broken-image-icon - CSS: Cascading Style Sheets
formal definition initial value0applies toimagesinheritednocomputed valueas specifiedanimation typediscrete formal syntax <integer> examples html <img src='/broken/image/link.png' alt='broken image link'> css img { -moz-force-broken-image-icon: 1; height: 100px; width: 100px; } result screenshotlive sample note: unless the image has a specified height and width the broken image icon will not be displayed but the alt attribute will also be hidden if -moz-force-broken-image-icon i...
-moz-image-rect - CSS: Cascading Style Sheets
the syntax for the rectangle is similar to the rect() function generating a <<shape>()> css type.
-moz-image-region - CSS: Cascading Style Sheets
it will not work with xul <image src="url" />.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax <shape> | autowhere <shape> = rect(<top>, <right>, <bottom>, <left>) examples clipping an image #example-button { /* display only the 4x4 area from the top left of this image */ list-style-image: url("chrome://example/skin/example.png"); -moz-image-region: rect(0px, 4px, 4px, 0px); } #example-button:hover { /* use the 4x4 area to the right of the first for the h...
-moz-orient - CSS: Cascading Style Sheets
formal definition initial valueinlineapplies toany element; it has an effect on progress and meter, but not on <input type="range"> or other elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax inline | block | horizontal | vertical examples html <p> the following progress meter is horizontal (the default): </p> <progress max="100" value="75"></progress> <p> the following progress meter is vertical: </p> <progress class="vert" max="100" value="75"></progress> css .vert { -...
-moz-outline-radius-bottomleft - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valueas specifiedanimation typea length, percentage or calc(); formal syntax <outline-radius>where <outline-radius> = <length> | <percentage> examples rounding a outline since this is a firefox-only property, this example will not display the desired effect if you are viewing this in a browser other than firefox.
-moz-outline-radius-bottomright - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valueas specifiedanimation typea length, percentage or calc(); formal syntax <outline-radius>where <outline-radius> = <length> | <percentage> examples html <p>look at this paragraph's bottom-right corner.</p> css p { margin: 5px; border: solid cyan; outline: dotted red; -moz-outline-radius-bottomright: 2em; } result the example above will not display the desired effect if you are viewing this in a browser ot...
-moz-outline-radius-topleft - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valueas specifiedanimation typea length, percentage or calc(); formal syntax <outline-radius>where <outline-radius> = <length> | <percentage> examples the example below will not display the desired effect if you are viewing this in a browser other than firefox.
-moz-outline-radius-topright - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valueas specifiedanimation typea length, percentage or calc(); formal syntax <outline-radius>where <outline-radius> = <length> | <percentage> examples html <p>look at this paragraph's top-right corner.</p> css p { margin: 5px; border: solid cyan; outline: dotted red; -moz-outline-radius-topright: 2em; } result the example above will not display the desired effect if you are viewing this in a browser other th...
-moz-outline-radius - CSS: Cascading Style Sheets
-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: a length, percentage or calc();-moz-outline-radius-bottomleft: a length, percentage or calc(); formal syntax <outline-radius>{1,4} [ / <outline-radius>{1,4} ]?where <outline-radius> = <length> | <perce...
-moz-user-input - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | none | enabled | disabled examples disabling user input for an element input.example { /* the user will be able to select the text, but not change it.
-webkit-border-before - CSS: Cascading Style Sheets
the transparent keyword maps to rgba(0,0,0,0).animation typediscrete formal syntax <'border-width'> | <'border-style'> | <'color'>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
-webkit-box-reflect - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ above | below | right | left ]?
-webkit-line-clamp - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax none | <integer> examples truncating a paragraph html <p> in this example the <code>-webkit-line-clamp</code> property is set to <code>3</code>, which means the text is clamped after three lines.
-webkit-mask-attachment - CSS: Cascading Style Sheets
formal definition initial valuescrollapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <attachment>#where <attachment> = scroll | fixed | local examples fixing a mask image to the viewport body { -webkit-mask-image: url('images/mask.png'); -webkit-mask-attachment: fixed; } specifications not part of any standard.
-webkit-mask-composite - CSS: Cascading Style Sheets
formal definition initial valuesource-overapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <composite-style>#where <composite-style> = clear | copy | source-over | source-in | source-out | source-atop | destination-over | destination-in | destination-out | destination-atop | xor examples compositing with xor .example { -webkit-mask-image: url(mask1.png), url('mask2.png'); -webkit-mask-composite: xor, source-over; } specifications not part of any standa...
-webkit-mask-repeat-x - CSS: Cascading Style Sheets
formal definition initial valuerepeatapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax repeat | no-repeat | space | round examples using a repeating or non-repeating mask image .exampleone { -webkit-mask-image: url('mask.png'); -webkit-mask-repeat-x: repeat; } .exampletwo { -webkit-mask-image: url('mask.png'); -webkit-mask-repeat-x: no-repeat; } using multiple mask images you can specify a different <repeat-style> for each mask image, separate...
-webkit-mask-repeat-y - CSS: Cascading Style Sheets
formal definition initial valuerepeatapplies toall elementsinheritednocomputed valuefor <length> the absolute value, otherwise a percentageanimation typediscrete formal syntax repeat | no-repeat | space | round examples using a repeating or non-repeating mask image .exampleone { -webkit-mask-image: url('mask.png'); -webkit-mask-repeat-y: repeat; } .exampletwo { -webkit-mask-image: url('mask.png'); -webkit-mask-repeat-y: no-repeat; } using multiple mask images you can specify a different <repeat-style> for each mask image, separate...
-webkit-overflow-scrolling - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toscrolling boxesinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | touch examples html <div class="scroll-touch"> <p> this paragraph has momentum scrolling </p> </div> <div class="scroll-auto"> <p> this paragraph does not.
-webkit-tap-highlight-color - CSS: Cascading Style Sheets
formal definition initial valueblackapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
-webkit-text-fill-color - CSS: Cascading Style Sheets
formal definition initial valuecurrentcolorapplies toall elementsinheritedyescomputed valuecomputed coloranimation typea color formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
-webkit-text-stroke-width - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritedyescomputed valueabsolute <length>animation typediscrete formal syntax <length> examples varying stroke widths css p { margin: 0; font-size: 4em; -webkit-text-stroke-color: red; } #thin { -webkit-text-stroke-width: thin; } #medium { -webkit-text-stroke-width: 3px; } #thick { -webkit-text-stroke-width: 1.5mm; } html <p id="thin">thin stroke</p> <p id="medium">medium stroke</p> <p id="thick">thick stroke</p> results s...
-webkit-text-stroke - CSS: Cascading Style Sheets
formal definition initial valueas each of the properties of the shorthand:-webkit-text-stroke-width: 0-webkit-text-stroke-color: currentcolorapplies toall elementsinheritedyescomputed valueas each of the properties of the shorthand:-webkit-text-stroke-width: absolute <length>-webkit-text-stroke-color: computed coloranimation typeas each of the properties of the shorthand:-webkit-text-stroke-width: discrete-webkit-text-stroke-color: a color formal syntax <length> | <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
-webkit-touch-callout - CSS: Cascading Style Sheets
formal definition initial valuedefaultapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax default | none examples turn off touch callout .example { -webkit-touch-callout: none; } specifications not part of any standard.
::-webkit-inner-spin-button - CSS: Cascading Style Sheets
html <input type="number"> css input[type=number]::-webkit-inner-spin-button { cursor: pointer; } result specifications not part of any standard.
::-webkit-outer-spin-button - CSS: Cascading Style Sheets
html <input type="number"> css input::-webkit-outer-spin-button { -webkit-appearance: none; } result specifications not part of any standard.
::-webkit-search-cancel-button - CSS: Cascading Style Sheets
the ::-webkit-search-cancel-button css pseudo-element represents a button (the "cancel button") at the edge of an <input> of type="search" which clears away the current value of the <input> element.
::-webkit-search-results-button - CSS: Cascading Style Sheets
the ::-webkit-search-results-button css pseudo-element represents a button (the "search results button") at the left edge of an <input> of type="search" which when clicked displays a menu which allows the user to choose from previous recent search queries.
::-webkit-slider-runnable-track - CSS: Cascading Style Sheets
the ::-webkit-slider-runnable-track css pseudo-element represents the "track" (the groove in which the indicator slides) of an <input type="range">.
::-webkit-slider-thumb - CSS: Cascading Style Sheets
the ::-webkit-slider-thumb css pseudo-element represents the "thumb" that the user can move within the "groove" of an <input> of type="range" to alter its numerical value.
::before (:before) - CSS: Cascading Style Sheets
WebCSS::before
html <ul> <li>buy milk</li> <li>take the dog for a walk</li> <li>exercise</li> <li>write code</li> <li>play music</li> <li>relax</li> </ul> css li { list-style-type: none; position: relative; margin: 2px; padding: 0.5em 0.5em 0.5em 2em; background: lightgrey; font-family: sans-serif; } li.done { background: #ccff99; } li.done::before { content: ''; position: absolute; border-color: #009933; border-style: solid; border-width: 0 0.3em 0.25em 0; height: 1em; top: 1.3em; left: 0.6em; margin-top: -1em; transform: rotate(45deg); ...
::first-letter (:first-letter) - CSS: Cascading Style Sheets
working draft generalizes allowed properties to typesetting, text decoration, inline layout properties, opacity, and box-shadow.
::first-line (:first-line) - CSS: Cascading Style Sheets
generalizes allowed properties to typesetting, text decoration, and inline layout properties and opacity.
::part() - CSS: Cascading Style Sheets
WebCSS::part
custom-element::part(foo) { /* styles to apply to the `foo` part */ } syntax ::part( <ident>+ ) examples html <template id="tabbed-custom-element"> <style type="text/css"> *, ::before, ::after { box-sizing: border-box; padding: 1rem; } :host { display: flex; } </style> <div part="tab active">tab 1</div> <div part="tab">tab 2</div> <div part="tab">tab 3</div> </template> <tabbed-custom-element></tabbed-custom-element> css tabbed-custom-element::part(tab) { color: #0c0c0dcc; border-bottom: transparent solid 2px; } tabbed-custom-element::part(tab):hover { background-color: #0c0c0d19; border-color: #0c0c0d33; } tabbed-custom-element::part(tab):hover:active { ...
:active - CSS: Cascading Style Sheets
WebCSS:active
</p> css a:link { color: blue; } /* unvisited links */ a:visited { color: purple; } /* visited links */ a:hover { background: yellow; } /* hovered links */ a:active { color: red; } /* active links */ p:active { background: #eee; } /* active paragraphs */ result active form elements html <form> <label for="my-button">my button: </label> <button id="my-button" type="button">try clicking me or my label!</button> </form> css form :active { color: red; } form button { background: white; } result specifications specification status comment html living standardthe definition of ':active' in that specification.
:dir() - CSS: Cascading Style Sheets
WebCSS:dir
other document types may have different methods.
:focus-within - CSS: Cascading Style Sheets
html <p>try typing into this form.</p> <form> <label for="given_name">given name:</label> <input id="given_name" type="text"> <br> <label for="family_name">family name:</label> <input id="family_name" type="text"> </form> css form { border: 1px solid; color: gray; padding: 4px; } form:focus-within { background: #ff8; color: black; } input { margin: 4px; } result specifications specification status comment selectors level 4the definition of ':focus-within' i...
:in-range - CSS: Cascading Style Sheets
WebCSS:in-range
<li> <input id="value1" name="value1" type="number" placeholder="1 to 10" min="1" max="10" value="12"> <label for="value1">your value is </label> </li> </ul> </form> css li { list-style: none; margin-bottom: 1em; } input { border: 1px solid black; } input:in-range { background-color: rgba(0, 255, 0, 0.25); } input:out-of-range { background-color: rgba(255, 0, 0, 0.25); border: 2px solid red; } input:in-range ...
:only-child - CSS: Cascading Style Sheets
{ display: inline-block; margin: 6px; outline: 1px solid; } result a list example html <ol> <li>first <ul> <li>this list has just one element.</li> </ul> </li> <li>second <ul> <li>this list has three elements.</li> <li>this list has three elements.</li> <li>this list has three elements.</li> </ul> </li> </ol> css li li { list-style-type: disc; } li:only-child { color: red; list-style-type: square; } result specifications specification status comment selectors level 4the definition of ':only-child' in that specification.
:out-of-range - CSS: Cascading Style Sheets
in the absence of such a limitation, the element can neither be "in-range" nor "out-of-range." syntax :out-of-range examples html <form action="" id="form1"> <p>values between 1 and 10 are valid.</p> <ul> <li> <input id="value1" name="value1" type="number" placeholder="1 to 10" min="1" max="10" value="12"> <label for="value1">your value is </label> </li> </ul> </form> css li { list-style: none; margin-bottom: 1em; } input { border: 1px solid black; } input:in-range { background-color: rgba(0, 255, 0, 0.25); } input:out-of-range { background-color: rgba(255, 0, 0, 0.25); border: 2px solid red; } input:in-range ...
:scope - CSS: Cascading Style Sheets
WebCSS:scope
javascript var context = document.getelementbyid('context'); var selected = context.queryselectorall(':scope > div'); document.getelementbyid('results').innerhtml = array.prototype.map.call(selected, function (element) { return '#' + element.getattribute('id'); }).join(', '); html <div id="context"> <div id="element-1"> <div id="element-1.1"></div> <div id="element-1.2"></div> </div> <div id="element-2"> <div id="element-2.1"></div> </div> </div> <p> selected elements ids : <span id="results"></span> </p> result spec...
@charset - CSS: Cascading Style Sheets
WebCSS@charset
the value given by the charset attribute of the content-type: http header or the equivalent in the protocol used to serve the style sheet.
symbols - CSS: Cascading Style Sheets
this must be one of the following data types: <string> <image> (note: this value is "at risk" and may be removed from the specification.
font-weight - CSS: Cascading Style Sheets
for truetype or opentype variable fonts, the "wght" variation is used to implement varying weights.
any-pointer - CSS: Cascading Style Sheets
html <input id="test" type="checkbox" /> <label for="test">look at me!</label> css input[type="checkbox"]:checked { background: gray; } @media (any-pointer: fine) { input[type="checkbox"] { -moz-appearance: none; -webkit-appearance: none; appearance: none; width: 15px; height: 15px; border: 1px solid blue; } } @media (any-pointer: coarse) { input[type="checkbox"] { -moz-appearance: n...
aspect-ratio - CSS: Cascading Style Sheets
/ } } /* maximum aspect ratio */ @media (max-aspect-ratio: 3/2) { div { background: #9ff; /* cyan */ } } /* exact aspect ratio, put it at the bottom to avoid override*/ @media (aspect-ratio: 1/1) { div { background: #f9a; /* red */ } } _example used iframe and dataurl to enable this iframe could resize html <label id="wf" for="w">width:165</label> <input id="w" name="w" type="range" min="100" max="250" step="5" value="165"> <label id="hf" for="w">height:165</label> <input id="h" name="h" type="range" min="100" max="250" step="5" value="165"> <iframe id="outer" src="data:text/html,<style> @media (min-aspect-ratio: 8/5) { div { background: %239af; } } @media (max-aspect-ratio: 3/2) { div { background: %239ff; } } @media (aspect-ratio: 1/1) { div { background: %23f9a; ...
prefers-reduced-motion - CSS: Cascading Style Sheets
reduce indicates that user has notified the system that they prefer an interface that removes or replaces the types of motion-based animation that trigger discomfort for those with vestibular motion disorders.
@page - CSS: Cascading Style Sheets
WebCSS@page
| <page-margin-box> <page-body>where <page-selector> = <pseudo-page>+ | <ident> <pseudo-page>*<page-margin-box> = <page-margin-box-type> '{' <declaration-list> '}'where <pseudo-page> = : [ left | right | first | blank ]<page-margin-box-type> = @top-left-corner | @top-left | @top-center | @top-right | @top-right-corner | @bottom-left-corner | @bottom-left | @bottom-center | @bottom-right | @bottom-right-corner | @left-top | @left-middle | @left-bottom | @right-top | @right-middle | @right-bottom examples @page pseudo-class examp...
Adjacent sibling combinator - CSS: Cascading Style Sheets
/* paragraphs that come immediately after any image */ img + p { font-weight: bold; } syntax former_element + target_element { style properties } examples css li:first-of-type + li { color: red; } html <ul> <li>one</li> <li>two!</li> <li>three</li> </ul> result specifications specification status comment selectors level 4the definition of 'next-sibling combinator' in that specification.
CSS Containment - CSS: Cascading Style Sheets
the values for this property indicate the type of containment that you want to apply to that element.
CSS Display - CSS: Cascading Style Sheets
reference css properties display css data types <display-outside> <display-inside> <display-listitem> <display-box> <display-internal> <display-legacy> guides css flow layout (display: block, display: inline) block and inline layout in normal flow flow layout and overflow flow layout and writing modes formatting contexts explained in flow and out of flow display: flex basic concepts of flexbox aligning items in a flex container controlling ratios of flex items along the main axis cross-browser flexbox mixins mastering wrapping of flex items ordering flex items relationship of flexbox to other layo...
Cross-browser Flexbox mixins - CSS: Cascading Style Sheets
@if type-of($fg) == 'list' { $fg-boxflex: nth($fg, 1); } -webkit-box: $fg-boxflex; -moz-box: $fg-boxflex; -webkit-flex: $fg $fs $fb; -ms-flex: $fg $fs $fb; flex: $fg $fs $fb; } flexbox justify content the justify-content property aligns flex items along the main axis of the current line of the flex container.
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
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.
Typical use cases of Flexbox - CSS: Cascading Style Sheets
flexbox makes this type of layout easy to achieve.
Introduction to formatting contexts - CSS: Cascading Style Sheets
this article introduces the concept of formatting contexts, of which there are several types, including block formatting contexts, inline formatting contexts, and flex formatting contexts.
Box alignment in CSS Grid Layout - CSS: Cascading Style Sheets
you can see how items 1 and 2, which span two row tracks have taken on extra height as they gain the additional space added to the gap between those two tracks: justifying the grid tracks on the row axis on the inline axis, we can use justify-content to perform the same type of alignment that we used align-content for in the block axis.
Layout using named grid lines - CSS: Cascading Style Sheets
as you start to build out your own layouts, you will find that the syntax becomes more familiar and you choose the ways that work best for you and the type of projects you like to build.
CSS Grid Layout - CSS: Cascading Style Sheets
{ grid-column: 3; grid-row: 4; } reference css properties grid-template-columns grid-template-rows grid-template-areas grid-template grid-auto-columns grid-auto-rows grid-auto-flow grid grid-row-start grid-column-start grid-row-end grid-column-end grid-row grid-column grid-area row-gap column-gap gap css functions repeat() minmax() fit-content() css data types <flex> glossary entries grid grid lines grid tracks grid cell grid area gutters grid axis grid row grid column guides basic concepts of grid layout relationship of grid layout to other layout methods layout using line-based placement grid template areas layout using named grid lines auto-placement in css grid layout box alignment in css grid layout css grid, logi...
Using CSS counters - CSS: Cascading Style Sheets
example of a nested counter css ol { counter-reset: section; /* creates a new instance of the section counter with each ol element */ list-style-type: none; } li::before { counter-increment: section; /* increments only this instance of the section counter */ content: counters(section, ".") " "; /* combines the values of all instances of the section counter, separated by a period */ } html <ol>...
CSS Lists - CSS: Cascading Style Sheets
reference properties list-style-image list-style-type list-style-position list-style guides consistent list indentation explains how to achieve consistent list indentation across different browsers.
CSS Masking - CSS: Cascading Style Sheets
reference properties clip clip-path clip-rule mask mask-border mask-border-mode mask-border-outset mask-border-repeat mask-border-slice mask-border-source mask-border-width mask-clip mask-composite mask-image mask-mode mask-origin mask-position mask-repeat mask-size mask-type specifications specification status comment css masking module level 1 candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the definition of 'mask' in that specification.
CSS Overflow - CSS: Cascading Style Sheets
ink overflow and scrollable overflow there are two types of overflow that you might encounter in css.
Stacking context example 2 - CSS: Cascading Style Sheets
example source code <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html> <head><style type="text/css"> div { font: 12px arial; } span.bold { font-weight: bold; } #div2 { z-index: 2; } #div3 { z-index: 1; } #div4 { z-index: 10; } #div1,#div3 { height: 80px; position: relative; border: 1px dashed #669966; background-color: #ccffcc; pa...
Stacking context example 3 - CSS: Cascading Style Sheets
example source code <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html> <head><style type="text/css"> div { font: 12px arial; } span.bold { font-weight: bold; } div.lev1 { width: 250px; height: 70px; position: relative; border: 2px outset #669966; background-color: #ccffcc; padding-left: 5px; } #container1 { z-index: 1; po...
CSS Properties Reference - CSS: Cascading Style Sheets
font-family fontfamily font-size fontsize font-variant fontvariant font-weight fontweight height height left left letter-spacing letterspacing line-height lineheight list-style liststyle list-style-image liststyleimage list-style-position liststyleposition list-style-type liststyletype margin margin margin-bottom marginbottom margin-left marginleft margin-right marginright margin-top margintop overflow overflow padding padding padding-bottom paddingbottom padding-left paddingleft padding-right paddingright padding-top paddingtop ...
CSS Scroll Snap - CSS: Cascading Style Sheets
reference css properties on containers scroll-snap-type scroll-snap-stop scroll-padding scroll-padding-top scroll-padding-right scroll-padding-bottom scroll-padding-left scroll-padding-inline scroll-padding-inline-start scroll-padding-inline-end scroll-padding-block scroll-padding-block-start scroll-padding-block-end css properties on children scroll-snap-align scroll-margin scroll-margin-top scroll-margin-right scroll-margin-bott...
CSS selectors - CSS: Cascading Style Sheets
type selector selects all elements that have the given node name.
Overview of CSS Shapes - CSS: Cascading Style Sheets
it takes a variety of values, all of which define different shapes, specified in the <basic-shape> datatype.
CSS Shapes - CSS: Cascading Style Sheets
reference properties shape-image-threshold shape-margin shape-outside data types <basic-shape> guides overview of css shapes shapes from box values basic shapes shapes from images edit shape paths in css — firefox developer tools external resources a list of css shapes resources css shapes 101 creating non-rectangular layouts with css shapes how to use css shapes in your web design how to get started with css shapes what i learned in one weekend wit...
CSS Transforms - CSS: Cascading Style Sheets
reference properties backface-visibility perspective perspective-origin rotate scale transform transform-box transform-origin transform-style translate data types <transform-function> guides using css transforms step-by-step tutorial about how to transform elements styled with css.
Introducing the CSS Cascade - CSS: Cascading Style Sheets
WebCSSCascade
author stylesheets author stylesheets are the most common type of style sheet.
Comments - CSS: Cascading Style Sheets
WebCSSComments
specifications css 2.1 syntax and basic data types #comments ...
Compositing and Blending - CSS: Cascading Style Sheets
reference properties background-blend-mode isolation mix-blend-mode data types <blend-mode> specifications specification status comment compositing and blending level 1 candidate recommendation initial definition ...
Descendant combinator - CSS: Cascading Style Sheets
syntax selector1 selector2 { /* property declarations */ } examples css li { list-style-type: disc; } li li { list-style-type: circle; } html <ul> <li> <div>item 1</div> <ul> <li>subitem a</li> <li>subitem b</li> </ul> </li> <li> <div>item 2</div> <ul> <li>subitem a</li> <li>subitem b</li> </ul> </li> </ul> result specifications specification status comment selectors level 4the definition of '...
Filter Effects - CSS: Cascading Style Sheets
reference properties backdrop-filter filter data types <filter-function> specifications specification status comment filter effects module level 1the definition of 'filter' in that specification.
Testing media queries programmatically - CSS: Cascading Style Sheets
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.
Microsoft CSS extensions - CSS: Cascading Style Sheets
-ms-accelerator -ms-block-progression -ms-content-zoom-chaining -ms-content-zooming -ms-content-zoom-limit -ms-content-zoom-limit-max -ms-content-zoom-limit-min -ms-content-zoom-snap -ms-content-zoom-snap-points -ms-content-zoom-snap-type -ms-filter -ms-flow-from -ms-flow-into -ms-high-contrast-adjust -ms-hyphenate-limit-chars -ms-hyphenate-limit-lines -ms-hyphenate-limit-zone -ms-ime-align -ms-overflow-style -ms-scrollbar-3dlight-color -ms-scrollbar-arrow-color -ms-scrollbar-base-color -ms-scrollbar-darkshadow-color -ms-scrollbar-face-color -ms-scrollbar-highlight-color -ms-scrollbar-shadow-color ...
Mozilla CSS extensions - CSS: Cascading Style Sheets
62 -moz-markerobsolete since gecko 62 empty-cells -moz-show-background (default value in quirks mode) font -moz-button -moz-info -moz-desktop -moz-dialog (also a color) -moz-document -moz-workspace -moz-window -moz-list -moz-pull-down-menu -moz-field (also a color) font-family -moz-fixed image-rendering -moz-crisp-edges <length> -moz-calc list-style-type -moz-arabic-indic -moz-bengali -moz-cjk-earthly-branch -moz-cjk-heavenly-stem -moz-devanagari -moz-ethiopic-halehame -moz-ethiopic-halehame-am -moz-ethiopic-halehame-ti-er -moz-ethiopic-halehame-ti-et -moz-ethiopic-numeric -moz-gujarati -moz-gurmukhi -moz-hangul -moz-hangul-consonant -moz-japanese-formal -moz-japanese-informal -moz-kannada -moz-khmer -moz-lao -moz-malayalam...
Shorthand properties - CSS: Cascading Style Sheets
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.
Syntax - CSS: Cascading Style Sheets
WebCSSSyntax
each type of at-rules, defined by the identifier, may have its own internal syntax, and semantics of course.
Cubic Bezier Generator - CSS: Cascading Style Sheets
<html> <canvas id="bezier" width="336" height="336"> </canvas> <form> <label for="x1">x1 = </label><input onchange="updatecanvas();" type="text" maxlength=6 id="x1" value="0.79" class='field'> <label for="y1">y1 = </label><input onchange="updatecanvas();return true;" type="text" maxlength=6 id="y1" value="0.33" class='field'> <label for="x2">x2 = </label><input onchange="updatecanvas();return true;" type="text" maxlength=6 id="x2" value="0.14" class='field'> <label for="y2">y2 = </label><input onchange="updatecanvas();return true;" type="text" maxlength=6 id="y2" value="0.53" class='field'> <br> <output id="output">log</output> </form> </html> .field { width: 40px; } function updatecanvas() { var x1 =...
CSS Tutorials - CSS: Cascading Style Sheets
WebCSSTutorials
there are several types of gradients allowed in css: linear or radial, repeating or not.
Universal selectors - CSS: Cascading Style Sheets
the css universal selector (*) matches elements of any type.
align-items - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax normal | stretch | <baseline-position> | [ <overflow-position>?
align-self - CSS: Cascading Style Sheets
otherwise the specified value.animation typediscrete formal syntax auto | normal | stretch | <baseline-position> | <overflow-position>?
all - CSS: Cascading Style Sheets
WebCSSall
formal definition initial valuethere is no practical initial value for it.applies toall elementsinheritednocomputed valueas the specified value applies to each property this is a shorthand for.animation typeas each of the properties of the shorthand (all properties but unicode-bidi and direction) formal syntax initial | inherit | unset | revert examples html <blockquote id="quote"> lorem ipsum dolor sit amet, consectetur adipiscing elit.
animation-delay - CSS: Cascading Style Sheets
formal definition initial value0sapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <time># examples see css animations for examples.
animation-direction - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <single-animation-direction>#where <single-animation-direction> = normal | reverse | alternate | alternate-reverse examples see css animations for examples.
animation-duration - CSS: Cascading Style Sheets
formal definition initial value0sapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <time># examples see css animations for examples.
animation-fill-mode - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <single-animation-fill-mode>#where <single-animation-fill-mode> = none | forwards | backwards | both examples you can see the effect of animation-fill-mode in the following example.
animation-iteration-count - CSS: Cascading Style Sheets
formal definition initial value1applies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <single-animation-iteration-count>#where <single-animation-iteration-count> = infinite | <number> examples see css animations for examples.
animation-name - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ none | <keyframes-name> ]#where <keyframes-name> = <custom-ident> | <string> examples see css animations for examples.
animation-play-state - CSS: Cascading Style Sheets
formal definition initial valuerunningapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <single-animation-play-state>#where <single-animation-play-state> = running | paused examples see css animations for examples.
animation-timing-function - CSS: Cascading Style Sheets
formal definition initial valueeaseapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <timing-function>#where <timing-function> = linear | <cubic-bezier-timing-function> | <step-timing-function>where <cubic-bezier-timing-function> = ease | ease-in | ease-out | ease-in-out | cubic-bezier(<number <a href="/docs/css/value_definition_syntax#brackets" title="brackets: enclose several entities, combinators, and multipliers to transform them as a single component"...
backdrop-filter - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typea filter function list formal syntax none | <filter-function-list>where <filter-function-list> = [ <filter-function> | <url> ]+where <filter-function> = <blur()> | <brightness()> | <contrast()> | <drop-shadow()> | <grayscale()> | <hue-rotate()> | <invert()> | <opacity()> | <saturate()> | <sepia()>where <blur()> = blur( <length> )<brightness()> = brightness( <number-percentage> )<contrast()> = co...
backface-visibility - CSS: Cascading Style Sheets
formal definition initial valuevisibleapplies totransformable elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax visible | hidden examples cube with transparent and opaque faces this example shows a cube with transparent faces, and one with opaque faces.
background-blend-mode - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritednocomputed valueas specifiedanimation typediscrete formal syntax <blend-mode>#where <blend-mode> = normal | multiply | screen | overlay | darken | lighten | color-dodge | color-burn | hard-light | soft-light | difference | exclusion | hue | saturation | color | luminosity examples <div id="div"></div> <select id="select"> <option>normal</option> <option>multiply</option> <option selected>screen</option> <option>overlay...
background-clip - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritednocomputed valueas specifiedanimation typediscrete formal syntax <box>#where <box> = border-box | padding-box | content-box examples html <p class="border-box">the background extends behind the border.</p> <p class="padding-box">the background extends to the inside edge of the border.</p> <p class="content-box">the background extends only to the edge of the content box.</p> <p class="text">the background is clipped to the foreground ...
background-color - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritednocomputed valuecomputed coloranimation typea color formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
background-origin - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritednocomputed valueas specifiedanimation typediscrete formal syntax <box>#where <box> = border-box | padding-box | content-box examples setting background origins .example { border: 10px double; padding: 10px; background: url('image.jpg'); background-position: center left; background-origin: content-box; } #example2 { border: 4px solid black; padding: 10px; background: url('image.gif'); background-repeat: no-repeat; ...
background-position-x - CSS: Cascading Style Sheets
formal definition initial valueleftapplies toall elementsinheritednopercentagesrefer to width of background positioning area minus height of background imagecomputed valuea list, each item consisting of: an offset given as a combination of an absolute length and a percentage, plus an origin keywordanimation typediscrete formal syntax [ center | [ [ left | right | x-start | x-end ]?
background-position-y - CSS: Cascading Style Sheets
formal definition initial valuetopapplies toall elementsinheritednopercentagesrefer to height of background positioning area minus height of background imagecomputed valuea list, each item consisting of: an offset given as a combination of an absolute length and a percentage, plus an origin keywordanimation typediscrete formal syntax [ center | [ [ top | bottom | y-start | y-end ]?
background-position - CSS: Cascading Style Sheets
nheritednopercentagesrefer to the size of the background positioning area minus size of background image; size refers to the width for horizontal offsets and to the height for vertical offsetscomputed valuea list, each item consisting of two keywords representing the origin and two offsets from that origin, each given as an absolute length (if given a <length>), otherwise as a percentageanimation typerepeatable list of simple list of length, percentage, or calc formal syntax <bg-position>#where <bg-position> = [ [ left | center | right | top | bottom | <length-percentage> ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ] | [ center | [ left | right ] <length-percentage>?
background-repeat - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritednocomputed valuea list, each item consisting of two keywords, one per dimensionanimation typediscrete formal syntax <repeat-style>#where <repeat-style> = repeat-x | repeat-y | [ repeat | space | round | no-repeat ]{1,2} examples setting background-repeat html <ol> <li>no-repeat <div class="one"></div> </li> <li>repeat <div class="two"></div> </li> <li>repeat-x <div class="three"></div> </li> <li>repeat-y <div class="four"></div> </li> <li>space ...
background-size - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritednopercentagesrelative to the background positioning areacomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typerepeatable list of simple list of length, percentage, or calc formal syntax <bg-size>#where <bg-size> = [ <length-percentage> | auto ]{1,2} | cover | containwhere <length-percentage> = <length> | <percentage> examples please see scaling background images for examples.
background - CSS: Cascading Style Sheets
hat origin, each given as an absolute length (if given a <length>), otherwise as a percentagebackground-size: as specified, but with relative lengths converted into absolute lengthsbackground-repeat: a list, each item consisting of two keywords, one per dimensionbackground-origin: as specifiedbackground-clip: as specifiedbackground-attachment: as specifiedbackground-color: computed coloranimation typeas each of the properties of the shorthand:background-color: a colorbackground-image: discretebackground-clip: discretebackground-position: repeatable list of simple list of length, percentage, or calcbackground-size: repeatable list of simple list of length, percentage, or calcbackground-repeat: discretebackground-attachment: discrete formal syntax [ <bg-layer> , ]* <final-bg-layer>where <bg-la...
border-block-color - CSS: Cascading Style Sheets
formal definition initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typediscrete formal syntax <'border-top-color'>{1,2} examples border with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 10px solid blue; border-block-color: red; } results specifications specification status comment ...
border-block-end-color - CSS: Cascading Style Sheets
formal definition initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typea color formal syntax <'border-top-color'> examples border color with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 10px solid blue; border-block-end-color: red; } results specifications specification status comme...
border-block-end-style - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'border-top-style'> examples dashed border with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 5px solid blue; border-block-end-style: dashed; } results specifications specification status c...
border-block-end-width - CSS: Cascading Style Sheets
formal definition initial valuemediumapplies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typea length formal syntax <'border-top-width'> examples border width with veritcal text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 1px solid blue; border-block-end-width: 5px; } results specifications specification status comme...
border-block-end - CSS: Cascading Style Sheets
formal definition initial valueas each of the properties of the shorthand:border-top-width: mediumborder-top-style: noneborder-top-color: currentcolorapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:border-top-width: the absolute length or 0 if border-top-style is none or hiddenborder-top-style: as specifiedborder-top-color: computed coloranimation typeas each of the properties of the shorthand:border-block-end-color: a colorborder-block-end-style: discreteborder-block-end-width: a length formal syntax <'border-top-width'> | <'border-top-style'> | <'color'>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
border-block-start-color - CSS: Cascading Style Sheets
values <'color'> see border-color formal definition initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typea color formal syntax <'border-top-color'> examples border color with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 10px solid blue; border-block-start-color: red; } results specifications specification status com...
border-block-start-style - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'border-top-style'> examples dashed border wtih vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 5px solid blue; border-block-start-style: dashed; } results specifications specification status ...
border-block-start - CSS: Cascading Style Sheets
denborder-right-width: the absolute length or 0 if border-right-style is none or hiddenborder-top-width: the absolute length or 0 if border-top-style is none or hiddenborder-style: as each of the properties of the shorthand:border-bottom-style: as specifiedborder-left-style: as specifiedborder-right-style: as specifiedborder-top-style: as specifiedborder-block-start-color: computed coloranimation typeas each of the properties of the shorthand:border-block-start-color: a colorborder-block-start-style: discreteborder-block-start-width: a length formal syntax <'border-top-width'> | <'border-top-style'> | <'color'>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]...
border-block-style - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'border-top-style'> examples dashed border with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 5px solid blue; border-block-style: dashed; } results specifications specification status comme...
border-block-width - CSS: Cascading Style Sheets
formal definition initial valuemediumapplies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typediscrete formal syntax <'border-top-width'> examples border width with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 1px solid blue; border-block-width: 5px; } results specifications specification status comment ...
border-block - CSS: Cascading Style Sheets
formal definition initial valueas each of the properties of the shorthand:border-top-width: mediumborder-top-style: noneborder-top-color: currentcolorapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:border-top-width: the absolute length or 0 if border-top-style is none or hiddenborder-top-style: as specifiedborder-top-color: computed coloranimation typediscrete formal syntax <'border-top-width'> | <'border-top-style'> | <'color'>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
border-bottom-color - CSS: Cascading Style Sheets
it also applies to ::first-letter.inheritednocomputed valuecomputed coloranimation typea color formal syntax <'border-top-color'> examples a simple div with a border html <div class="mybox"> <p>this is a box with a border around it.
border-bottom-style - CSS: Cascading Style Sheets
it also applies to ::first-letter.inheritednocomputed valueas specifiedanimation typediscrete formal syntax <line-style>where <line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset examples demonstrating all border styles html <table> <tr> <td class="b1">none</td> <td class="b2">hidden</td> <td class="b3">dotted</td> <td class="b4">dashed</td> </tr> <tr> <td class="b5">solid</td> <td class="b6">double</...
border-bottom-width - CSS: Cascading Style Sheets
it also applies to ::first-letter.inheritednocomputed valuethe absolute length or 0 if border-bottom-style is none or hiddenanimation typea length formal syntax <line-width>where <line-width> = <length> | thin | medium | thick examples comparing bottom border widths html <div>element 1</div> <div>element 2</div> css div { border: 1px solid red; margin: 1em 0; } div:nth-child(1) { border-bottom-width: thick; } div:nth-child(2) { border-bottom-width: 2em; } result specifications specification status ...
border-bottom - CSS: Cascading Style Sheets
it also applies to ::first-letter.inheritednocomputed valueas each of the properties of the shorthand:border-bottom-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-bottom-style: as specifiedborder-bottom-color: computed coloranimation typeas each of the properties of the shorthand:border-bottom-color: a colorborder-bottom-style: discreteborder-bottom-width: a length formal syntax <line-width> | <line-style> | <color>where <line-width> = <length> | thin | medium | thick<line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset<color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <...
border-collapse - CSS: Cascading Style Sheets
formal definition initial valueseparateapplies totable and inline-table elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax collapse | separate examples a colorful table of browser engines html <table class="separate"> <caption><code>border-collapse: separate</code></caption> <tbody> <tr><th>browser</th> <th>layout engine</th></tr> <tr><td class="fx">firefox</td> <td class="gk">gecko</td></tr> <tr><td class="ed">edge</td> <td class="tr">edgehtml</td></tr> <tr><td class="...
border-image-outset - CSS: Cascading Style Sheets
it also applies to ::first-letter.inheritednocomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typeby computed value type formal syntax [ <length> | <number> ]{1,4} examples outsetting a border image html <div id="outset">this element has an outset border image!</div> css #outset { width: 10rem; background: #cef; border: 1.4rem solid; border-image: radial-gradient(#ff2, #55f) 40; border-image-outset: 1.5; /* 1.5 × 1.4rem = 2.1rem */ margin: 2.1rem; } result specificat...
border-image-repeat - CSS: Cascading Style Sheets
it also applies to ::first-letter.inheritednocomputed valueas specifiedanimation typediscrete formal syntax [ stretch | repeat | round | space ]{1,2} examples repeating border images css #bordered { width: 12rem; margin-bottom: 1rem; padding: 1rem; border: 40px solid; border-image: url("https://mdn.mozillademos.org/files/4127/border.png") 27; border-image-repeat: stretch; /* can be changed in the live sample */ } html <div id="bordered">you can try out vario...
border-image-source - CSS: Cascading Style Sheets
it also applies to ::first-letter.inheritednocomputed valuenone or the image with its uri made absoluteanimation typediscrete formal syntax none | <image>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( <image-tags>?
border-image-width - CSS: Cascading Style Sheets
it also applies to ::first-letter.inheritednopercentagesrefer to the width or height of the border image areacomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typeby computed value type formal syntax [ <length-percentage> | <number> | auto ]{1,4}where <length-percentage> = <length> | <percentage> examples tiling a border image this example creates a border image using the following ".png" file, which is 90 by 90 pixels: thus, each circle in the source image is 30 by 30 pixels.
border-inline-color - CSS: Cascading Style Sheets
formal definition initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typediscrete formal syntax <'border-top-color'>{1,2} examples border color with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 10px solid blue; border-inline-color: red; } results specifications specification status co...
border-inline-end-style - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'border-top-style'> examples html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 5px solid blue; border-inline-end-style: dashed; } results specifications specification status comment css logical p...
border-inline-start-color - CSS: Cascading Style Sheets
formal definition initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typea color formal syntax <'border-top-color'> examples html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 10px solid blue; border-inline-start-color: red; } specifications specification status comment css logical properties ...
border-inline-start-width - CSS: Cascading Style Sheets
formal definition initial valuemediumapplies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typea length formal syntax <'border-top-width'> examples html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 1px solid blue; border-inline-start-width: 5px; } specifications specification status comment css logical properties ...
border-inline-start - CSS: Cascading Style Sheets
enborder-right-width: the absolute length or 0 if border-right-style is none or hiddenborder-top-width: the absolute length or 0 if border-top-style is none or hiddenborder-style: as each of the properties of the shorthand:border-bottom-style: as specifiedborder-left-style: as specifiedborder-right-style: as specifiedborder-top-style: as specifiedborder-inline-start-color: computed coloranimation typeas each of the properties of the shorthand:border-inline-start-color: a colorborder-inline-start-style: discreteborder-inline-start-width: a length formal syntax <'border-top-width'> | <'border-top-style'> | <'color'>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value...
border-inline-style - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'border-top-style'> examples html content <div> <p class="exampletext">example text</p> </div> css content div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 5px solid blue; border-inline-style: dashed; } specifications specification status comment css logica...
border-inline-width - CSS: Cascading Style Sheets
formal definition initial valuemediumapplies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typediscrete formal syntax <'border-top-width'> examples html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 1px solid blue; border-inline-width: 5px 10px; } specifications specification status comment css logical properties a...
border-left-color - CSS: Cascading Style Sheets
it also applies to ::first-letter.inheritednocomputed valuecomputed coloranimation typea color formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
border-left-style - CSS: Cascading Style Sheets
it also applies to ::first-letter.inheritednocomputed valueas specifiedanimation typediscrete formal syntax <line-style>where <line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset examples html <table> <tr> <td class="b1">none</td> <td class="b2">hidden</td> <td class="b3">dotted</td> <td class="b4">dashed</td> </tr> <tr> <td class="b5">solid</td> <td class="b6">double</td> <td class="b7">groove</td...
border-left-width - CSS: Cascading Style Sheets
it also applies to ::first-letter.inheritednocomputed valuethe absolute length or 0 if border-left-style is none or hiddenanimation typea length formal syntax <line-width>where <line-width> = <length> | thin | medium | thick examples comparing border widths html <div>element 1</div> <div>element 2</div> css div { border: 1px solid red; margin: 1em 0; } div:nth-child(1) { border-left-width: thick; } div:nth-child(2) { border-left-width: 2em; } result specifications specification status comment ...
border-left - CSS: Cascading Style Sheets
it also applies to ::first-letter.inheritednocomputed valueas each of the properties of the shorthand:border-left-width: the absolute length or 0 if border-left-style is none or hiddenborder-left-style: as specifiedborder-left-color: computed coloranimation typeas each of the properties of the shorthand:border-left-color: a colorborder-left-style: discreteborder-left-width: a length formal syntax <line-width> | <line-style> | <color>where <line-width> = <length> | thin | medium | thick<line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset<color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-...
border-radius - CSS: Cascading Style Sheets
eritednopercentagesrefer to the corresponding dimension of the border boxcomputed valueas each of the properties of the shorthand:border-bottom-left-radius: two absolute <length>s or <percentage>sborder-bottom-right-radius: two absolute <length>s or <percentage>sborder-top-left-radius: two absolute <length>s or <percentage>sborder-top-right-radius: two absolute <length>s or <percentage>sanimation typeas each of the properties of the shorthand:border-top-left-radius: a length, percentage or calc();border-top-right-radius: a length, percentage or calc();border-bottom-right-radius: a length, percentage or calc();border-bottom-left-radius: a length, percentage or calc(); formal syntax <length-percentage>{1,4} [ / <length-percentage>{1,4} ]?where <length-percentage> = <length> | <percentage> exa...
border-right-color - CSS: Cascading Style Sheets
it also applies to ::first-letter.inheritednocomputed valuecomputed coloranimation typea color formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
border-right-style - CSS: Cascading Style Sheets
it also applies to ::first-letter.inheritednocomputed valueas specifiedanimation typediscrete formal syntax <line-style>where <line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset examples border styles html <table> <tr> <td class="b1">none</td> <td class="b2">hidden</td> <td class="b3">dotted</td> <td class="b4">dashed</td> </tr> <tr> <td class="b5">solid</td> <td class="b6">double</td> <td class=...
border-right-width - CSS: Cascading Style Sheets
it also applies to ::first-letter.inheritednocomputed valuethe absolute length or 0 if border-right-style is none or hiddenanimation typea length formal syntax <line-width>where <line-width> = <length> | thin | medium | thick examples comparing border widths html <div>element 1</div> <div>element 2</div> css div { border: 1px solid red; margin: 1em 0; } div:nth-child(1) { border-right-width: thick; } div:nth-child(2) { border-right-width: 2em; } result specifications specification status comment...
border-right - CSS: Cascading Style Sheets
it also applies to ::first-letter.inheritednocomputed valueas each of the properties of the shorthand:border-right-width: the absolute length or 0 if border-right-style is none or hiddenborder-right-style: as specifiedborder-right-color: computed coloranimation typeas each of the properties of the shorthand:border-right-color: a colorborder-right-style: discreteborder-right-width: a length formal syntax <line-width> | <line-style> | <color>where <line-width> = <length> | thin | medium | thick<line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset<color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <nam...
border-spacing - CSS: Cascading Style Sheets
formal definition initial value0applies totable and inline-table elementsinheritedyescomputed valuetwo absolute lengthsanimation typediscrete formal syntax <length> <length>?
border-style - CSS: Cascading Style Sheets
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.
border-top-color - CSS: Cascading Style Sheets
it also applies to ::first-letter.inheritednocomputed valuecomputed coloranimation typea color formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
border-top-width - CSS: Cascading Style Sheets
it also applies to ::first-letter.inheritednocomputed valuethe absolute length or 0 if border-top-style is none or hiddenanimation typea length formal syntax <line-width>where <line-width> = <length> | thin | medium | thick examples html <div>element 1</div> <div>element 2</div> css div { border: 1px solid red; margin: 1em 0; } div:nth-child(1) { border-top-width: thick; } div:nth-child(2) { border-top-width: 2em; } result specifications specification status comment css backgrounds...
border-top - CSS: Cascading Style Sheets
it also applies to ::first-letter.inheritednocomputed valueas each of the properties of the shorthand:border-top-width: the absolute length or 0 if border-top-style is none or hiddenborder-top-style: as specifiedborder-top-color: computed coloranimation typeas each of the properties of the shorthand:border-top-color: a colorborder-top-style: discreteborder-top-width: a length formal syntax <line-width> | <line-style> | <color>where <line-width> = <length> | thin | medium | thick<line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset<color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-col...
border - CSS: Cascading Style Sheets
WebCSSborder
s none or hiddenborder-style: as each of the properties of the shorthand:border-bottom-style: as specifiedborder-left-style: as specifiedborder-right-style: as specifiedborder-top-style: as specifiedborder-color: as each of the properties of the shorthand:border-bottom-color: computed colorborder-left-color: computed colorborder-right-color: computed colorborder-top-color: computed coloranimation typeas each of the properties of the shorthand:border-color: as each of the properties of the shorthand:border-bottom-color: a colorborder-left-color: a colorborder-right-color: a colorborder-top-color: a colorborder-style: discreteborder-width: as each of the properties of the shorthand:border-bottom-width: a lengthborder-left-width: a lengthborder-right-width: a lengthborder-top-width: a length for...
bottom - CSS: Cascading Style Sheets
WebCSSbottom
formal definition initial valueautoapplies topositioned elementsinheritednopercentagesrefer to the height of the containing blockcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typea length, percentage or calc(); formal syntax <length> | <percentage> | auto examples absolute and fixed positioning this example demonstrates the difference in behavior of the bottom property, when position is absolute versus fixed.
box-align - CSS: Cascading Style Sheets
WebCSSbox-align
formal definition initial valuestretchapplies toelements with a css display value of box or inline-boxinheritednocomputed valueas specifiedanimation typediscrete formal syntax start | center | end | baseline | stretch examples setting box alignment <!doctype html> <html> <head> <title>css box-align example</title> <style> div.example { display: box; /* as specified */ display: -moz-box; /* mozilla */ display: -webkit-box; /* webkit */ /* make this box taller than the children, so there i...
box-decoration-break - CSS: Cascading Style Sheets
formal definition initial valuesliceapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax slice | clone examples inline box fragments an inline element that contains line breaks styled with: .example { background: linear-gradient(to bottom right, yellow, green); box-shadow: 8px 8px 10px 0px deeppink, -5px -5px 5px 0px blue, 5px 5px 15px 0px yellow; padding: 0em 1em; border-radius: 16px; border-style: solid; margin-left: 10px; font:...
box-direction - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies toelements with a css display value of box or inline-boxinheritednocomputed valueas specifiedanimation typediscrete formal syntax normal | reverse | inherit examples setting box direction .example { /* bottom-to-top layout */ -moz-box-direction: reverse; /* mozilla */ -webkit-box-direction: reverse; /* webkit */ box-direction: reverse; /* as specified */ } specifications not part of any standard.
box-flex-group - CSS: Cascading Style Sheets
formal definition initial value1applies toin-flow children of box elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <integer> examples simple usage example in the original flexbox spec, box-flex-group could be used to assign flex children to different groups to distribute flexible space between: article:nth-child(1) { -webkit-box-flex-group: 1; } article:nth-child(2) { -webkit-box-flex-group: 2; } this was only ever supported in webkit-based browsers, with a prefix, and in sub...
box-flex - CSS: Cascading Style Sheets
WebCSSbox-flex
formal definition initial value0applies toelements that are direct children of an element with a css display value of -moz-box or -moz-inline-box or -webkit-box or -webkit-inline-boxinheritednocomputed valueas specifiedanimation typediscrete formal syntax <number> examples setting box-flex <!doctype html> <html> <head> <title>-moz-box-flex example</title> <style> div.example { display: -moz-box; display: -webkit-box; border: 1px solid black; width: 100%; } div.example > p:nth-child(1) { -moz-box-flex: 1; /* mozilla */ -webkit-box-flex: 1; ...
box-lines - CSS: Cascading Style Sheets
WebCSSbox-lines
formal definition initial valuesingleapplies tobox elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax single | multiple examples simple usage example in the original version of the spec, box-lines allowed you to specify that you wanted your flex container's children to wrap onto multiple lines.
box-ordinal-group - CSS: Cascading Style Sheets
formal definition initial value1applies tochildren of box elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <integer> examples basic usage example in an older version of the spec, box-ordinal-group was included to allow you to change the display order of flex children inside a flex container: article:nth-child(1) { -webkit-box-ordinal-group: 2 -moz-box-ordinal-group: 2 box-ordinal-group: 2 } article:nth-child(2) { -webkit-box-ordinal-group: 1 -moz-box-ordinal-grou...
box-orient - CSS: Cascading Style Sheets
formal definition initial valueinline-axis (horizontal in xul)applies toelements with a css display value of box or inline-boxinheritednocomputed valueas specifiedanimation typediscrete formal syntax horizontal | vertical | inline-axis | block-axis | inherit examples setting horizontal box orientation here, he box-orient property will cause the two <p> sections in the example to display in the same line.
box-pack - CSS: Cascading Style Sheets
WebCSSbox-pack
formal definition initial valuestartapplies toelements with a css display value of -moz-box, -moz-inline-box, -webkit-box or -webkit-inline-boxinheritednocomputed valueas specifiedanimation typediscrete formal syntax start | center | end | justify examples div.example { border-style: solid; display: -moz-box; /* mozilla */ display: -webkit-box; /* webkit */ /* make this box taller than the children, so there is room for the box-pack */ height: 300px; /* make this box wide enough to show the contents are centered horizontally */ width: 300px; /* children s...
box-shadow - CSS: Cascading Style Sheets
it also applies to ::first-letter.inheritednocomputed valueany length made absolute; any specified color computed; otherwise as specifiedanimation typea shadow list formal syntax none | <shadow>#where <shadow> = inset?
box-sizing - CSS: Cascading Style Sheets
formal definition initial valuecontent-boxapplies toall elements that accept width or heightinheritednocomputed valueas specifiedanimation typediscrete formal syntax content-box | border-box examples box sizes with content-box and border-box this example shows how different box-sizing values alter the rendered size of two otherwise identical elements.
break-inside - CSS: Cascading Style Sheets
a subset of values should be aliased as follows: page-break-inside break-inside auto auto avoid avoid formal definition initial valueautoapplies toblock-level elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | avoid | avoid-page | avoid-column | avoid-region examples avoiding breaking inside a figure in the following example we have a container that contains an <h1> spanning all columns (achieved using column-span: all) and a series of paragraphs laid out in multiple columns using column-width: 200px.
calc() - CSS: Cascading Style Sheets
WebCSScalc
then, the following html makes use of this css: <form> <div id="formbox"> <label>type something:</label> <input type="text"> </div> </form> nested calc() with css variables you can also use calc() with css variables.
caption-side - CSS: Cascading Style Sheets
formal definition initial valuetopapplies totable-caption elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax top | bottom | block-start | block-end | inline-start | inline-end examples setting captions above and below html <table class="top"> <caption>caption above the table</caption> <tr> <td>some data</td> <td>some more data</td> </tr> </table> <br> <table class="bottom"> <caption>caption below the table</caption> <tr> <td>some data</td> <td>some...
clamp() - CSS: Cascading Style Sheets
WebCSSclamp
the expressions can be math functions (see calc() for more information), literal values, or other expressions, such as attr(), that evaluate to a valid argument type (like <length>), or nested min() and max() functions.
clear - CSS: Cascading Style Sheets
WebCSSclear
formal definition initial valuenoneapplies toblock-level elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | left | right | both | inline-start | inline-end examples clear: left html <div class="wrapper"> <p class="black">lorem ipsum dolor sit amet, consectetuer adipiscing elit.
clip-path - CSS: Cascading Style Sheets
WebCSSclip-path
formal definition initial valuenoneapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednopercentagesrefer to reference box when specified, otherwise border-boxcomputed valueas specified, but with <url> values made absoluteanimation typeyes, as specified for <basic-shape>, otherwise no formal syntax <clip-source> | [ <basic-shape> | <geometry-box> ] | nonewhere <clip-source> = <url><basic-shape> = <inset()> | <circle()> | <ellipse()> | <polygon()> | <path()><geometry-box> = <shape-box> | fill-box | stroke-box | view-boxwhere <inset()> = inset( <length-percentage>{1,4} [ round <'border-radius'> ]?
clip - CSS: Cascading Style Sheets
WebCSSclip
formal definition initial valueautoapplies toabsolutely positioned elementsinheritednocomputed valueauto if specified as auto, otherwise a rectangle with four values, each of which is auto if specified as auto or the computed length otherwiseanimation typea rectangle formal syntax <shape> | autowhere <shape> = rect(<top>, <right>, <bottom>, <left>) examples clipping an image css .dotted-border { border: dotted; position: relative; width: 536px; height: 350px; } #top-left, #middle, #bottom-right { position: absolute; top: 0; } #top-left { left: 360px; clip: rect(0 175px 113px 0); } #middle { left: 280px; clip: rect(119p...
column-count - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toblock containers except table wrapper boxesinheritednocomputed valueas specifiedanimation typean integer formal syntax <integer> | auto examples splitting a paragraph across three columns html <p class="content-box"> this is a bunch of text split into three columns using the css `column-count` property.
column-fill - CSS: Cascading Style Sheets
formal definition initial valuebalanceapplies tomulticol elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | balance | balance-all examples splitting text evenly across columns html <p class="content-box"> this is a bunch of text split into multiple columns.
column-rule-color - CSS: Cascading Style Sheets
formal definition initial valuecurrentcolorapplies tomulticol elementsinheritednocomputed valuecomputed coloranimation typea color formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
column-rule-style - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies tomulticol elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'border-style'> examples setting a dashed column rule html <p>this is a bunch of text split into three columns.
column-rule-width - CSS: Cascading Style Sheets
formal definition initial valuemediumapplies tomulticol elementsinheritednocomputed valuethe absolute length; 0 if the column-rule-style is none or hiddenanimation typea length formal syntax <'border-width'> examples setting a thick column rule html <p>this is a bunch of text split into three columns.
column-rule - CSS: Cascading Style Sheets
definition initial valueas each of the properties of the shorthand:column-rule-width: mediumcolumn-rule-style: nonecolumn-rule-color: currentcolorapplies tomulticol elementsinheritednocomputed valueas each of the properties of the shorthand:column-rule-color: computed colorcolumn-rule-style: as specifiedcolumn-rule-width: the absolute length; 0 if the column-rule-style is none or hiddenanimation typeas each of the properties of the shorthand:column-rule-color: a colorcolumn-rule-style: discretecolumn-rule-width: a length formal syntax <'column-rule-width'> | <'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 c...
column-span - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toin-flow block-level elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | all examples making a heading span columns in this example, the heading is made to span across all the columns of the article.
column-width - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toblock containers except table wrapper boxesinheritednocomputed valuethe absolute length, zero or largeranimation typea length formal syntax <length> | auto examples setting column width in pixels html <p class="content-box"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
columns - CSS: Cascading Style Sheets
WebCSScolumns
formal definition initial valueas each of the properties of the shorthand:column-width: autocolumn-count: autoapplies toblock containers except table wrapper boxesinheritednocomputed valueas each of the properties of the shorthand:column-width: the absolute length, zero or largercolumn-count: as specifiedanimation typeas each of the properties of the shorthand:column-width: a lengthcolumn-count: an integer formal syntax <'column-width'> | <'column-count'> examples setting three equal columns html <p class="content-box"> this is a bunch of text split into three columns using the css `columns` property.
contain - CSS: Cascading Style Sheets
WebCSScontain
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | strict | content | [ size | layout | style | paint ] examples simple layout the markup below consists of a number of articles, each with content: <h1>my blog</h1> <article> <h2>heading of a nice article</h2> <p>content here.</p> </article> <article> <h2>another heading of another article</h2> <img src="graphic.jpg" alt="photo"> <p>more content here.</p...
counter-increment - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ <custom-ident> <integer>?
counter-reset - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ <custom-ident> <integer>?
counter-set - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ <custom-ident> <integer>?
counter() - CSS: Cascading Style Sheets
WebCSScounter
note: the counter() function can be used with any css property, but support for properties other than content is experimental, and support for the type-or-unit parameter is sparse.
counters() - CSS: Cascading Style Sheets
WebCSScounters
note: the counters() function can be used with any css property, but support for properties other than content is experimental, and support for the type-or-unit parameter is sparse.
<dimension> - CSS: Cascading Style Sheets
WebCSSdimension
the <dimension> css data type represents a <number> with a unit attached to it, for example 10px.
direction - CSS: Cascading Style Sheets
WebCSSdirection
formal definition initial valueltrapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax ltr | rtl examples setting right-to-left direction blockquote { direction: rtl; } specifications specification status comment css writing modes module level 3the definition of 'direction' in that specification.
<display-internal> - CSS: Cascading Style Sheets
html <main> <div> <label for="name">name</label> <input type="text" id="name" name="name"> </div> <div> <label for="age">age</label> <input type="text" id="age" name="age"> </div> </main> css main { display: table; } div { display: table-row; } label, input { display: table-cell; margin: 5px; } result specifications specification status css display module level 3the definition of 'display-internal' in...
<display-legacy> - CSS: Cascading Style Sheets
html <div class="container"> <div>flex item</div> <div>flex item</div> </div> not a flex item css .container { display: inline-flex; } result in the new syntax the inline flex container would be created using two values, inline for the outer display type, and flex for the inner display type.
<display-outside> - CSS: Cascading Style Sheets
the <display-outside> keywords specify the element’s outer display type, which is essentially its role in flow layout.
element() - CSS: Cascading Style Sheets
WebCSSelement
<div style="width:400px; height:100px; background:-moz-element(#mybackground2);"> </div> <div style="overflow:hidden; height:0;"> <button id="mybackground2" type="button">evil button!</button> </div> specifications specification status comment css images module level 4the definition of 'using elements as images: the element() notation' in that specification.
empty-cells - CSS: Cascading Style Sheets
formal definition initial valueshowapplies totable-cell elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax show | hide example showing and hiding empty table cells html <table class="table_1"> <tr> <td>moe</td> <td>larry</td> </tr> <tr> <td>curly</td> <td></td> </tr> </table> <br> <table class="table_2"> <tr> <td>moe</td> <td>larry</td> </tr> <tr> <td>curly</td> <td></td> </tr> </table> css .table_1 { empty-cells: show; }...
drop-shadow() - CSS: Cascading Style Sheets
syntax drop-shadow(offset-x offset-y blur-radius color) the drop-shadow() function accepts a parameter of type <shadow> (defined in the box-shadow property), with the exception that the inset keyword and spread parameters are not allowed.
flex-direction - CSS: Cascading Style Sheets
flexbox & the keyboard navigation disconnect — tink source order matters | adrian roselli mdn understanding wcag, guideline 1.3 explanations understanding success criterion 1.3.2 | w3c understanding wcag 2.0 formal definition initial valuerowapplies toflex containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax row | row-reverse | column | column-reverse examples reversing flex container columns and rows html <h4>this is a column-reverse</h4> <div id="content"> <div class="box" style="background-color:red;">a</div> <div class="box" style="background-color:lightblue;">b</div> <div class="box" style="background-color:yellow;">c</div> </div> <h4>this is a row-reverse</h4> ...
flex-flow - CSS: Cascading Style Sheets
WebCSSflex-flow
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-grow - CSS: Cascading Style Sheets
WebCSSflex-grow
formal definition initial value0applies toflex items, including in-flow pseudo-elementsinheritednocomputed valueas specifiedanimation typea number formal syntax <number> examples setting flex item grow factor html <h4>this is a flex-grow</h4> <h5>a,b,c and f are flex-grow:1 .
flex-shrink - CSS: Cascading Style Sheets
formal definition initial value1applies toflex items, including in-flow pseudo-elementsinheritednocomputed valueas specifiedanimation typea number formal syntax <number> examples setting flex item shrink factor html <p>the width of content is 500px; the flex-basis of the flex items is 120px.</p> <p>a, b, c have flex-shrink:1 set.
flex-wrap - CSS: Cascading Style Sheets
WebCSSflex-wrap
formal definition initial valuenowrapapplies toflex containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax nowrap | wrap | wrap-reverse examples setting flex container wrap values html <h4>this is an example for flex-wrap:wrap </h4> <div class="content"> <div class="red">1</div> <div class="green">2</div> <div class="blue">3</div> </div> <h4>this is an example for flex-wrap:nowrap </h4> <div class="content1"> <div class="red">1</div> <div class="green">2</div> ...
flex - CSS: Cascading Style Sheets
WebCSSflex
formal definition initial valueas each of the properties of the shorthand:flex-grow: 0flex-shrink: 1flex-basis: autoapplies toflex items, including in-flow pseudo-elementsinheritednocomputed valueas each of the properties of the shorthand:flex-grow: as specifiedflex-shrink: as specifiedflex-basis: as specified, but with relative lengths converted into absolute lengthsanimation typeas each of the properties of the shorthand:flex-grow: a numberflex-shrink: a numberflex-basis: a length, percentage or calc(); formal syntax none | [ <'flex-grow'> <'flex-shrink'>?
float - CSS: Cascading Style Sheets
WebCSSfloat
formal definition initial valuenoneapplies toall elements, but has no effect if the value of display is none.inheritednocomputed valueas specifiedanimation typediscrete formal syntax left | right | none | inline-start | inline-end examples how floated elements are positioned as mentioned above, when an element is floated, it is taken out of the normal flow of the document (though still remaining part of it).
font-kerning - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | normal | none examples enabling and disabling kerning html <div id="kern"></div> <div id="nokern"></div> <textarea id="input">av t.
font-optical-sizing - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | none examples disabling optical sizing <p class="optical-sizing">this paragraph is optically sized.
font-size-adjust - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typea number formal syntax none | <number> examples adjusting lower-case letter sizes html <p class="times">this text uses the times font (10px), which is hard to read in small sizes.</p> <p class="verdana">this text uses the verdana font (10px), which has relatively large lowercase letters.</p> <p class="adjtimes">this is the 10px times, but now adjusted to the same aspect ratio as the verdana.
font-size - CSS: Cascading Style Sheets
WebCSSfont-size
it also applies to ::first-letter and ::first-line.inheritedyespercentagesrefer to the parent element's font sizecomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typea length formal syntax <absolute-size> | <relative-size> | <length-percentage>where <absolute-size> = xx-small | x-small | small | medium | large | x-large | xx-large | xxx-large<relative-size> = larger | smaller<length-percentage> = <length> | <percentage> examples setting font sizes css .small { font-size: xx-small; } .larger { font-size: larger; } .point { font-size: 24pt; } .percen...
font-smooth - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | never | always | <absolute-size> | <length>where <absolute-size> = xx-small | x-small | small | medium | large | x-large | xx-large | xxx-large examples basic usage example the following example shows the safari/chromium and firefox equivalents that turn on font-smoothing on macos.
font-variant-position - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | sub | super examples setting superscript and subscript forms html <p class="normal">normal!</p> <p class="super">super!</p> <p class="sub">sub!</p> css p { display: inline; } .normal { font-variant-position: normal; } .super { font-variant-position: super; } .sub { font-variant-position: sub; } result specifications specification ...
font-variant - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | none | [ <common-lig-values> | <discretionary-lig-values> | <historical-lig-values> | <contextual-alt-values> | stylistic( <feature-value-name> ) | historical-forms | styleset( <feature-value-name># ) | character-variant( <feature-value-name># ) | swash( <feature-value-name> ) | ornaments( <feature-value-name> ) | annotation( <feature-value-name> ) | [ small-caps ...
gap (grid-gap) - CSS: Cascading Style Sheets
WebCSSgap
ap: normalcolumn-gap: normalapplies tomulti-column elements, flex containers, grid containersinheritednocomputed valueas each of the properties of the shorthand:row-gap: as specified, with <length>s made absolute, and normal computing to zero except on multi-column elementscolumn-gap: as specified, with <length>s made absolute, and normal computing to zero except on multi-column elementsanimation typeas each of the properties of the shorthand:row-gap: a length, percentage or calc();column-gap: a length, percentage or calc(); formal syntax <'row-gap'> <'column-gap'>?
grid-area - CSS: Cascading Style Sheets
WebCSSgrid-area
he properties of the shorthand:grid-row-start: autogrid-column-start: autogrid-row-end: autogrid-column-end: autoapplies togrid items and absolutely-positioned boxes whose containing block is a grid containerinheritednocomputed valueas each of the properties of the shorthand:grid-row-start: as specifiedgrid-column-start: as specifiedgrid-row-end: as specifiedgrid-column-end: as specifiedanimation typediscrete formal syntax <grid-line> [ / <grid-line> ]{0,3}where <grid-line> = auto | <custom-ident> | [ <integer> && <custom-ident>?
grid-auto-columns - CSS: Cascading Style Sheets
formal definition initial valueautoapplies togrid containersinheritednopercentagesrefer to corresponding dimension of the content areacomputed valuethe percentage as specified or the absolute lengthanimation typediscrete formal syntax <track-size>+where <track-size> = <track-breadth> | minmax( <inflexible-breadth> , <track-breadth> ) | fit-content( [ <length> | <percentage> ] )where <track-breadth> = <length-percentage> | <flex> | min-content | max-content | auto<inflexible-breadth> = <length> | <percentage> | min-content | max-content | autowhere <length-percentage> = <length> | <percentage> examples ...
grid-auto-rows - CSS: Cascading Style Sheets
formal definition initial valueautoapplies togrid containersinheritednopercentagesrefer to corresponding dimension of the content areacomputed valuethe percentage as specified or the absolute lengthanimation typediscrete formal syntax <track-size>+where <track-size> = <track-breadth> | minmax( <inflexible-breadth> , <track-breadth> ) | fit-content( [ <length> | <percentage> ] )where <track-breadth> = <length-percentage> | <flex> | min-content | max-content | auto<inflexible-breadth> = <length> | <percentage> | min-content | max-content | autowhere <length-percentage> = <length> | <percentage> examples ...
grid-column-end - CSS: Cascading Style Sheets
formal definition initial valueautoapplies togrid items and absolutely-positioned boxes whose containing block is a grid containerinheritednocomputed valueas specifiedanimation typediscrete formal syntax <grid-line>where <grid-line> = auto | <custom-ident> | [ <integer> && <custom-ident>?
grid-column-start - CSS: Cascading Style Sheets
formal definition initial valueautoapplies togrid items and absolutely-positioned boxes whose containing block is a grid containerinheritednocomputed valueas specifiedanimation typediscrete formal syntax <grid-line>where <grid-line> = auto | <custom-ident> | [ <integer> && <custom-ident>?
grid-column - CSS: Cascading Style Sheets
formal definition initial valueas each of the properties of the shorthand:grid-column-start: autogrid-column-end: autoapplies togrid items and absolutely-positioned boxes whose containing block is a grid containerinheritednocomputed valueas each of the properties of the shorthand:grid-column-start: as specifiedgrid-column-end: as specifiedanimation typediscrete formal syntax <grid-line> [ / <grid-line> ]?where <grid-line> = auto | <custom-ident> | [ <integer> && <custom-ident>?
grid-row-end - CSS: Cascading Style Sheets
formal definition initial valueautoapplies togrid items and absolutely-positioned boxes whose containing block is a grid containerinheritednocomputed valueas specifiedanimation typediscrete formal syntax <grid-line>where <grid-line> = auto | <custom-ident> | [ <integer> && <custom-ident>?
grid-row-start - CSS: Cascading Style Sheets
formal definition initial valueautoapplies togrid items and absolutely-positioned boxes whose containing block is a grid containerinheritednocomputed valueas specifiedanimation typediscrete formal syntax <grid-line>where <grid-line> = auto | <custom-ident> | [ <integer> && <custom-ident>?
grid-row - CSS: Cascading Style Sheets
WebCSSgrid-row
formal definition initial valueas each of the properties of the shorthand:grid-row-start: autogrid-row-end: autoapplies togrid items and absolutely-positioned boxes whose containing block is a grid containerinheritednocomputed valueas each of the properties of the shorthand:grid-row-start: as specifiedgrid-row-end: as specifiedanimation typediscrete formal syntax <grid-line> [ / <grid-line> ]?where <grid-line> = auto | <custom-ident> | [ <integer> && <custom-ident>?
grid-template-areas - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies togrid containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | <string>+ examples specifying named grid areas html <section id="page"> <header>header</header> <nav>navigation</nav> <main>main area</main> <footer>footer</footer> </section> css #page { display: grid; width: 100%; height: 250px; grid-template-areas: "head head" "nav main" "nav foot"; grid-temp...
grid-template-columns - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies togrid containersinheritednopercentagesrefer to corresponding dimension of the content areacomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typesimple list of length, percentage, or calc, provided the only differences are in the values of the length, percentage, or calc components in the list formal syntax none | <track-list> | <auto-track-list> | subgrid <line-name-list>?where <track-list> = [ <line-names>?
grid-template-rows - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies togrid containersinheritednopercentagesrefer to corresponding dimension of the content areacomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typesimple list of length, percentage, or calc, provided the only differences are in the values of the length, percentage, or calc components in the list formal syntax none | <track-list> | <auto-track-list> | subgrid <line-name-list>?where <track-list> = [ <line-names>?
grid-template - CSS: Cascading Style Sheets
corresponding dimension of the content areagrid-template-rows: refer to corresponding dimension of the content areacomputed valueas each of the properties of the shorthand:grid-template-columns: as specified, but with relative lengths converted into absolute lengthsgrid-template-rows: as specified, but with relative lengths converted into absolute lengthsgrid-template-areas: as specifiedanimation typediscrete formal syntax none | [ <'grid-template-rows'> / <'grid-template-columns'> ] | [ <line-names>?
grid - CSS: Cascading Style Sheets
WebCSSgrid
thgrid-auto-flow: as specifiedgrid-column-gap: the percentage as specified or the absolute lengthgrid-row-gap: the percentage as specified or the absolute lengthcolumn-gap: as specified, with <length>s made absolute, and normal computing to zero except on multi-column elementsrow-gap: as specified, with <length>s made absolute, and normal computing to zero except on multi-column elementsanimation typediscrete formal syntax <'grid-template'> | <'grid-template-rows'> / [ auto-flow && dense?
hanging-punctuation - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | [ first | [ force-end | allow-end ] | last ] examples setting opening and closing quotes to hang html <p>“lorem ipsum dolor sit amet, consectetur adipiscing elit.
height - CSS: Cascading Style Sheets
WebCSSheight
a percentage height on the root element is relative to the initial containing block.computed valuea percentage or auto or the absolute lengthanimation typea length, percentage or calc(); formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> examples setting height using pixels and percentages html <div id="taller">i'm 50 pixels tall.</div> <div id="shorter">i'm 25 pixels tall.</div> <div id="parent"> <div id="child"> i'm half the heig...
hyphens - CSS: Cascading Style Sheets
WebCSShyphens
formal definition initial valuemanualapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | manual | auto examples specifying text hyphenation this example uses three classes, one for each possible configuration of the hyphens property.
ident - CSS: Cascading Style Sheets
WebCSSident
the <ident> css data type denotes an arbitrary string used as an identifier.
image-orientation - CSS: Cascading Style Sheets
formal definition initial value0degapplies toall elementsinheritedyescomputed valuean <angle>, rounded to the next quarter turn from 0deg and normalized, that is moduloing the value by 1turnanimation typediscrete formal syntax from-image | <angle> | [ <angle>?
image-rendering - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | crisp-edges | pixelated examples setting image scaling algorithms in practical use, the pixelated and crisp-edges rules can be combined to provide some fallback for each other.
image-set() - CSS: Cascading Style Sheets
WebCSSimage-set
syntax image-set() = image-set( <image-set-option># ) where <image-set-option> = [ <image> | <string> ] <resolution> and <string> is an <url> values most commonly you'll see an url() <string> value, but the <image> can be any image type except for an image set.
Inheritance - CSS: Cascading Style Sheets
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").
initial-letter-align - CSS: Cascading Style Sheets
formal definition initial valueautoapplies to::first-letter pseudo-elements and inline-level first child of a block containerinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ auto | alphabetic | hanging | ideographic ] examples aligning initial letter html <p class="auto ">initial letter - auto</p> <p class="alphabetic">initial letter - alphabetic</p> <p class="hanging">initial letter - hanging</p> <p class="ideographic">initial letter - ideographic</p> css .auto { -webkit-initial-letter-align: auto; initial-letter-align: auto; } ...
initial-letter - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies to::first-letter pseudo-elements and inline-level first child of a block containerinheritednocomputed valueas specifiedanimation typediscrete formal syntax normal | [ <number> <integer>?
inline-size - CSS: Cascading Style Sheets
formal definition initial valueautoapplies tosame as width and heightinheritednopercentagesinline-size of containing blockcomputed valuesame as width and heightanimation typea length, percentage or calc(); formal syntax <'width'> examples setting inline size in pixels html <p class="exampletext">example text</p> css .exampletext { writing-mode: vertical-rl; background-color: yellow; inline-size: 110px; } result specifications specification status comment css logical properties and values level 1the definition of 'inline-...
inset-block-end - CSS: Cascading Style Sheets
formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-height of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'> examples setting block end offset html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; position: relative; inset-block-end: 20px; background-color: #c8c800; } result specifications specificati...
inset-block-start - CSS: Cascading Style Sheets
formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-height of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'> examples setting block start offset html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; position: relative; inset-block-start: 20px; background-color: #c8c800; } specifications specification ...
inset-block - CSS: Cascading Style Sheets
formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-height of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'>{1,2} examples setting block start and end offsets html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; position: relative; inset-block: 20px 50px; background-color: #c8c800; } result specifications ...
inset-inline-end - CSS: Cascading Style Sheets
formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-width of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'> examples setting inline end offset html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; position: relative; inset-inline-end: 20px; background-color: #c8c800; } result specifications specificat...
inset-inline-start - CSS: Cascading Style Sheets
formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-width of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'> examples setting inline start offset html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; position: relative; inset-inline-start: 20px; background-color: #c8c800; } result specifications speci...
inset-inline - CSS: Cascading Style Sheets
formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-width of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'>{1,2} examples setting inline start and end offsets html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; position: relative; inset-inline: 20px 50px; background-color: #c8c800; } result specifications ...
inset - CSS: Cascading Style Sheets
WebCSSinset
formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-height of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'>{1,4} examples setting offsets for an element html <div> <span class="exampletext">example text</span> </div> css div { background-color: yellow; width: 150px; height: 120px; position: relative; } .exampletext { writing-mode: sideways-rl; position: absolute; inset: 20px 40px 30px 10px; background-color: #c8c800; } re...
isolation - CSS: Cascading Style Sheets
WebCSSisolation
in svg, it applies to container elements, graphics elements, and graphics referencing elements.inheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | isolate examples forcing a new stacking context for an element html <div id="b" class="a"> <div id="d"> <div class="a c">auto</div> </div> <div id="e"> <div class="a c">isolate</div> </div> </div> css .a { background-color: rgb(0,255,0); } #b { width: 200px; height: 210px; } .c { width: 100px; height: 100px; border: 1px solid black...
justify-content - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies toflex containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax normal | <content-distribution> | <overflow-position>?
justify-items - CSS: Cascading Style Sheets
formal definition initial valuelegacyapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax normal | stretch | <baseline-position> | <overflow-position>?
justify-self - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toblock-level boxes, absolutely-positioned boxes, and grid itemsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | normal | stretch | <baseline-position> | <overflow-position>?
left - CSS: Cascading Style Sheets
WebCSSleft
formal definition initial valueautoapplies topositioned elementsinheritednopercentagesrefer to the width of the containing blockcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typea length, percentage or calc(); formal syntax <length> | <percentage> | auto examples positioning elements html <div id="wrap"> <div id="example_1"> <pre> position: absolute; left: 20px; top: 20px; </pre> <p>the only containing element for this div is the main window, so it positions itself in relation to it.</p> </div> <div id="example_2"> <pre> ...
letter-spacing - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritedyescomputed valuean optimum value consisting of either an absolute length or the keyword normalanimation typea length formal syntax normal | <length> examples setting letter spacing html <p class="normal">letter spacing</p> <p class="em-wide">letter spacing</p> <p class="em-wider">letter spacing</p> <p class="em-tight">letter spacing</p> <p class="px-wide">letter spacing</p> css .normal { letter-spacing: normal; } .em-wide { letter-spacing: 0.4em; } .em-wider { letter-spacing: 1em; } .em-tigh...
line-break - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | loose | normal | strict | anywhere examples setting text wrapping see whether the text is wrapped before "々", "ぁ" and "。".
line-height-step - CSS: Cascading Style Sheets
formal definition initial value0applies toblock containersinheritedyescomputed valueabsolute <length>animation typediscrete formal syntax <length> examples setting step unit for line box height in the following example, the height of line box in each paragraph is rounded up to the step unit.
line-height - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritedyespercentagesrefer to the font size of the element itselfcomputed valuefor percentage and length values, the absolute length, otherwise as specifiedanimation typeeither number or length formal syntax normal | <number> | <length> | <percentage> examples basic example /* all rules below have the same resultant line height */ div { line-height: 1.2; font-size: 10pt; } /* number/unitless */ div { line-height: 1.2em; font-size: 10pt; } /* length */ div { line-height: 120%; font-size: 10pt; } /* percentage */ div { font: 10pt/1.2 georgia,"bitstre...
margin-block-end - CSS: Cascading Style Sheets
formal 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 typea length formal syntax <'margin-left'> examples setting block end margin html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; margin-block-end: 20px; background-color: #c8c800; } result specifications specification status comment ...
margin-block-start - CSS: Cascading Style Sheets
formal 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 typea length formal syntax <'margin-left'> examples setting block start margin html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; margin-block-start: 20px; background-color: #c8c800; } result specifications specification status comment ...
margin-block - CSS: Cascading Style Sheets
formal 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 formal syntax <'margin-left'>{1,2} examples setting block start and end margins html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; margin-block: 20px 40px; background-color: #c8c800; } result specifications specification status com...
margin-inline-end - CSS: Cascading Style Sheets
formal 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 typea length formal syntax <'margin-left'> examples setting inline end margin html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; margin-inline-end: 20px; background-color: #c8c800; } result specifications specification status comment ...
margin-inline-start - CSS: Cascading Style Sheets
formal 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 typea length formal syntax <'margin-left'> examples setting inline start margin html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; margin-inline-start: 20px; background-color: #c8c800; } result specifications specification status comment ...
margin-trim - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritednocomputed valueas specifiedanimation typediscrete formal syntax none | in-flow | all examples basic usage once support is implemented for this property, it will probably work like so: when you've got a container with some inline children and you want to put a margin between each child but not have it interfere with the spacing at the end of the row, you might do something like this: article { background-color: red; margin: 20p...
mask-border-outset - CSS: Cascading Style Sheets
formal definition initial value0applies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typediscrete formal syntax [ <length> | <number> ]{1,4} examples basic usage this property doesn't appear to be supported anywhere yet.
mask-border-repeat - CSS: Cascading Style Sheets
formal definition initial valuestretchapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ stretch | repeat | round | space ]{1,2} examples basic usage this property doesn't appear to be supported anywhere yet.
mask-border-slice - CSS: Cascading Style Sheets
formal definition initial value0applies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednopercentagesrefer to size of the mask border imagecomputed valueas specifiedanimation typediscrete formal syntax <number-percentage>{1,4} fill?where <number-percentage> = <number> | <percentage> examples basic usage this property doesn't appear to be supported anywhere yet.
mask-border-source - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specified, but with <url> values made absoluteanimation typediscrete formal syntax none | <image>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( <image-tags>?
mask-border-width - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednopercentagesrelative to width/height of the mask border image areacomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typediscrete formal syntax [ <length-percentage> | <number> | auto ]{1,4}where <length-percentage> = <length> | <percentage> examples basic usage this property doesn't appear to be supported anywhere yet.
mask-border - CSS: Cascading Style Sheets
alueas each of the properties of the shorthand:mask-border-mode: as specifiedmask-border-outset: as specified, but with relative lengths converted into absolute lengthsmask-border-repeat: as specifiedmask-border-slice: as specifiedmask-border-source: as specified, but with <url> values made absolutemask-border-width: as specified, but with relative lengths converted into absolute lengthsanimation typeas each of the properties of the shorthand:mask-border-mode: discretemask-border-outset: discretemask-border-repeat: discretemask-border-slice: discretemask-border-source: discretemask-border-width: discretecreates stacking contextyes formal syntax <'mask-border-source'> | <'mask-border-slice'> [ / <'mask-border-width'>?
mask-clip - CSS: Cascading Style Sheets
WebCSSmask-clip
formal definition initial valueborder-boxapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ <geometry-box> | no-clip ]#where <geometry-box> = <shape-box> | fill-box | stroke-box | view-boxwhere <shape-box> = <box> | margin-boxwhere <box> = border-box | padding-box | content-box examples clipping a mask to the border box css #masked { width: 100px; height: 100px; background-color: #8cffa0; margin: 20px; border: 20px solid #8ca0ff; padding: 20px; ...
mask-composite - CSS: Cascading Style Sheets
formal definition initial valueaddapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <compositing-operator>#where <compositing-operator> = add | subtract | intersect | exclude examples compositing mask layers with addition css #masked { width: 100px; height: 100px; background-color: #8cffa0; mask-image: url(https://mdn.mozillademos.org/files/12668/mdn.svg), url(https://mdn.mozillademos.org/files/12676/star.svg); mask-size: 100% ...
mask-image - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specified, but with <url> values made absoluteanimation typediscrete formal syntax <mask-reference>#where <mask-reference> = none | <image> | <mask-source>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient><mask-source> = <url>where <image()> = image( <image-tags>?
mask-origin - CSS: Cascading Style Sheets
formal definition initial valueborder-boxapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <geometry-box>#where <geometry-box> = <shape-box> | fill-box | stroke-box | view-boxwhere <shape-box> = <box> | margin-boxwhere <box> = border-box | padding-box | content-box examples setting mask origin to border-box css #masked { width: 100px; height: 100px; margin: 10px; border: 10px solid blue; background-color: #8cffa0; padding: 10px; mask-image: url...
mask-position - CSS: Cascading Style Sheets
t applies to container elements excluding the defs element and all graphics elementsinheritednopercentagesrefer to size of mask painting area minus size of mask layer image (see the text for background-position)computed valueconsists of two keywords representing the origin and two offsets from that origin, each given as an absolute length (if given a <length>), otherwise as a percentage.animation typerepeatable list of simple list of length, percentage, or calc formal syntax <position>#where <position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]?
mask-repeat - CSS: Cascading Style Sheets
formal definition initial valueno-repeatapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueconsists of two keywords, one per dimensionanimation typediscrete formal syntax <repeat-style>#where <repeat-style> = repeat-x | repeat-y | [ repeat | space | round | no-repeat ]{1,2} examples setting repeat for a single mask css #masked { width: 250px; height: 250px; background: blue linear-gradient(red, blue); mask-image: url(https://mdn.mozillademos.org/files/12676/star.svg); mask-repeat: repeat; /* can be changed in the live sample */...
mask-size - CSS: Cascading Style Sheets
WebCSSmask-size
formal definition initial valueautoapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typerepeatable list of simple list of length, percentage, or calc formal syntax <bg-size>#where <bg-size> = [ <length-percentage> | auto ]{1,2} | cover | containwhere <length-percentage> = <length> | <percentage> examples setting mask size as a percentage css #masked { width: 200px; height: 200px; background: blue linear-gradient(red, blue); -webkit-mask-image: url(https://mdn.mozillademo...
mask - CSS: Cascading Style Sheets
WebCSSmask
-repeat: consists of two keywords, one per dimensionmask-position: consists of two keywords representing the origin and two offsets from that origin, each given as an absolute length (if given a <length>), otherwise as a percentage.mask-clip: as specifiedmask-origin: as specifiedmask-size: as specified, but with relative lengths converted into absolute lengthsmask-composite: as specifiedanimation typeas each of the properties of the shorthand:mask-image: discretemask-mode: discretemask-repeat: discretemask-position: repeatable list of simple list of length, percentage, or calcmask-clip: discretemask-origin: discretemask-size: repeatable list of simple list of length, percentage, or calcmask-composite: discretecreates stacking contextyes formal syntax <mask-layer>#where <mask-layer> = <mask-r...
max-block-size - CSS: Cascading Style Sheets
formal definition initial value0applies tosame as width and heightinheritednopercentagesblock-size of containing blockcomputed valuesame as max-width and max-heightanimation typea length, percentage or calc(); formal syntax <'max-width'> examples setting max-block-size with horizontal and vertical text in this example, the same text (the opening sentences from herman melville's novel moby-dick) is presented in both the horizontal-tb and vertical-rl writing modes.
max-height - CSS: Cascading Style Sheets
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 none.computed valuethe percentage as specified or the absolute length or noneanimation typea length, percentage or calc(); formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> examples setting max-height using percentage and keyword values table { max-height: 75%; } form { max-height: none; } specifications specification status comment css box s...
max-inline-size - CSS: Cascading Style Sheets
formal definition initial value0applies tosame as width and heightinheritednopercentagesinline-size of containing blockcomputed valuesame as max-width and max-heightanimation typea length, percentage or calc(); formal syntax <'max-width'> examples setting max inline size in pixels html <p class="exampletext">example text</p> css .exampletext { writing-mode: vertical-rl; background-color: yellow; block-size: 100%; max-inline-size: 200px; } result specifications specification status comment css logical properties and values l...
max-width - CSS: Cascading Style Sheets
WebCSSmax-width
mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wcag 2.0 formal definition initial valuenoneapplies toall elements but non-replaced inline elements, table rows, and row groupsinheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute length or noneanimation typea length, percentage or calc(); formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> examples setting max width in pixels in this example, the "child" will be either 150 pixels wide or the width of the "parent," whichever is smaller.
max() - CSS: Cascading Style Sheets
WebCSSmax
the expressions can be math expressions (using arithmetic operators), literal values, or other expressions, such as attr(), that evaluate to a valid argument type (like <length>), or nested min() and max() functions.
min-block-size - CSS: Cascading Style Sheets
formal definition initial value0applies tosame as width and heightinheritednopercentagesblock-size of containing blockcomputed valuesame as min-width and min-heightanimation typea length, percentage or calc(); formal syntax <'min-width'> examples setting minimum block size for vertical text html <p class="exampletext">example text</p> css .exampletext { writing-mode: vertical-rl; background-color: yellow; min-block-size: 200px; } result specifications specification status comment css logical properties and values level 1the ...
min-height - CSS: Cascading Style Sheets
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.computed valuethe percentage as specified or the absolute lengthanimation typea length, percentage or calc(); formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> examples setting min-height table { min-height: 75%; } form { min-height: 0; } specifications specification status comment css box sizing module level 4the definition of 'm...
min-inline-size - CSS: Cascading Style Sheets
formal definition initial value0applies tosame as width and heightinheritednopercentagesinline-size of containing blockcomputed valuesame as min-width and min-heightanimation typea length, percentage or calc(); formal syntax <'min-width'> examples setting minimum inline size for vertical text html <p class="exampletext">example text</p> css .exampletext { writing-mode: vertical-rl; background-color: yellow; block-size: 5%; min-inline-size: 200px; } result specifications specification status comment css logical properties an...
min-width - CSS: Cascading Style Sheets
WebCSSmin-width
formal definition initial valueautoapplies toall elements but non-replaced inline elements, table rows, and row groupsinheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length, percentage or calc(); formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> examples setting minimum element width table { min-width: 75%; } form { min-width: 0; } specifications specification status comment css box sizing module level 4the definit...
mix-blend-mode - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies toall elementsinheritednocomputed valueas specifiedanimation typediscretecreates stacking contextyes formal syntax <blend-mode>where <blend-mode> = normal | multiply | screen | overlay | darken | lighten | color-dodge | color-burn | hard-light | soft-light | difference | exclusion | hue | saturation | color | luminosity examples effect of different mix-blend-mode values <div class="grid"> <div class="col"> <div class="note">blending in isolation (no...
object-fit - CSS: Cascading Style Sheets
formal definition initial valuefillapplies toreplaced elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax fill | contain | cover | none | scale-down examples setting object-fit for an image html <section> <h2>object-fit: fill</h2> <img class="fill" src="https://udn.realityripple.com/samples/ae/248a9938d9.png" alt="mdn logo"> <img class="fill narrow" src="https://udn.realityripple.com/samples/ae/248a9938d9.png" alt="mdn logo"> <h2>object-fit: contain</h2> <img c...
object-position - CSS: Cascading Style Sheets
formal definition initial value50% 50%applies toreplaced elementsinheritedyespercentagesrefer to width and height of element itselfcomputed valueas specifiedanimation typerepeatable list of simple list of length, percentage, or calc formal syntax <position>where <position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]?
offset-anchor - CSS: Cascading Style Sheets
formal definition initial valueautoapplies totransformable elementsinheritednopercentagesrelativetowidthandheightcomputed valuefor <length> the absolute value, otherwise a percentageanimation typea position formal syntax auto | <position>where <position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]?
offset-distance - CSS: Cascading Style Sheets
formal definition initial value0applies totransformable elementsinheritednopercentagesrefer to the total path lengthcomputed valuefor <length> the absolute value, otherwise a percentageanimation typea length, percentage or calc(); formal syntax <length-percentage>where <length-percentage> = <length> | <percentage> examples using offset-distance in an animation the motion aspect in css motion path typically comes from animating the offset-distance property.
offset-path - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies totransformable elementsinheritednocomputed valueas specifiedanimation typeas <angle>, <basic-shape> or <path()>creates stacking contextyes formal syntax none | ray( [ <angle> && <size>?
offset-rotate - CSS: Cascading Style Sheets
formal definition initial valueautoapplies totransformable elementsinheritednocomputed valueas specifiedanimation typeas <angle>, <basic-shape> or <path()> formal syntax [ auto | reverse ] | <angle> examples setting element orientation along its offset path html <div></div> <div></div> <div></div> css div { width: 40px; height: 40px; background: #2bc4a2; margin: 20px; clip-path: polygon(0% 0%, 70% 0%, 100% 50%, 70% 100%, 0% 100%, 30% 50%); animation: move 5000ms infinite alternate ease-in-out;...
offset - CSS: Cascading Style Sheets
WebCSSoffset
fer to the total path lengthoffset-anchor: relativetowidthandheightcomputed valueas each of the properties of the shorthand:offset-position: for <length> the absolute value, otherwise a percentageoffset-path: as specifiedoffset-distance: for <length> the absolute value, otherwise a percentageoffset-anchor: for <length> the absolute value, otherwise a percentageoffset-rotate: as specifiedanimation typeas each of the properties of the shorthand:offset-position: a positionoffset-path: as <angle>, <basic-shape> or <path()>offset-distance: a length, percentage or calc();offset-anchor: a positionoffset-rotate: as <angle>, <basic-shape> or <path()>creates stacking contextyes formal syntax [ <'offset-position'>?
opacity - CSS: Cascading Style Sheets
WebCSSopacity
webaim: color contrast checker mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0 formal definition initial value1.0applies toall elementsinheritednocomputed valuethe specified value, clipped in the range [0,1]animation typea number formal syntax <alpha-value>where <alpha-value> = <number> | <percentage> examples setting background opacity html <div class="light">you can barely see this.</div> <div class="medium">this is easier to see.</div> <div class="heavy">this is very easy to see.</div> css div { background-color: yellow; } .light { opacity: 0.2; /* barely see the text over the background */ } .medium ...
outline-color - CSS: Cascading Style Sheets
the transparent keyword maps to rgba(0,0,0,0).animation typea color formal syntax <color> | invertwhere <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
outline-offset - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typea length formal syntax <length> examples setting outline offset in pixels html <p>gallia est omnis divisa in partes tres.</p> css p { outline: 1px dashed red; outline-offset: 10px; background: yellow; border: 1px solid blue; margin: 15px; } result specifications specification status comment css basic user interface module level 3the definition of...
outline-style - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | <'border-style'> examples setting outline style to auto the auto value indicates a custom outline style — typically a style [that] is either a user interface default for the platform, or perhaps a style that is richer than can be described in detail in css, e.g.
outline-width - CSS: Cascading Style Sheets
formal definition initial valuemediumapplies toall elementsinheritednocomputed valuean absolute length; if the keyword none is specified, the computed value is 0animation typea length formal syntax <line-width>where <line-width> = <length> | thin | medium | thick examples setting an element's outline width html <span id="thin">thin</span> <span id="medium">medium</span> <span id="thick">thick</span> <span id="twopixels">2px</span> <span id="oneex">1ex</span> <span id="em">1.2em</span> css span { outline-style: solid; display: inline-block; margin: 20px; ...
outline - CSS: Cascading Style Sheets
WebCSSoutline
the transparent keyword maps to rgba(0,0,0,0).outline-width: an absolute length; if the keyword none is specified, the computed value is 0outline-style: as specifiedanimation typeas each of the properties of the shorthand:outline-color: a coloroutline-width: a lengthoutline-style: discrete formal syntax [ <'outline-color'> | <'outline-style'> | <'outline-width'> ] examples using outline to set a focus style html <a href="#">this link has a special focus style.</a> css a { border: 1px solid; border-radius: 3px; display: inline-block; margin: 10px; padding...
overflow-anchor - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | none examples prevent scroll anchoring to prevent scroll anchoring in a document, use the overflow-anchor property.
overflow-inline - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toblock-containers, flex containers, and grid containersinheritednocomputed valueas specified, except with visible/clip computing to auto/hidden respectively if one of overflow-x or overflow-y is neither visible nor clipanimation typediscrete formal syntax visible | hidden | clip | scroll | auto examples setting inline overflow behavior html <ul> <li><code>overflow-inline:hidden</code> — hides the text outside the box <div id="div1"> abcdefghijklmopqrstuvwxyzabcdefghijklmopqrstuvwxyz </div> </li> <li><code>overflow-inline:scroll</code> — always adds a scrollbar <div id="div2"> abcdefghi...
overflow-x - CSS: Cascading Style Sheets
formal definition initial valuevisibleapplies toblock-containers, flex containers, and grid containersinheritednocomputed valueas specified, except with visible/clip computing to auto/hidden respectively if one of overflow-x or overflow-y is neither visible nor clipanimation typediscrete formal syntax visible | hidden | clip | scroll | auto examples html <ul> <li><code>overflow-x:hidden</code> — hides the text outside the box <div id="div1"> abcdefghijklmopqrstuvwxyzabcdefghijklmopqrstuvwxyz </div> </li> <li><code>overflow-x:scroll</code> — always adds a scrollbar <div id="div2"> abcdefghijklmopqrstuvwxyzabcdefghijklmopqrstuvwxyz ...
overflow-y - CSS: Cascading Style Sheets
formal definition initial valuevisibleapplies toblock-containers, flex containers, and grid containersinheritednocomputed valueas specified, except with visible/clip computing to auto/hidden respectively if one of overflow-x or overflow-y is neither visible nor clipanimation typediscrete formal syntax visible | hidden | clip | scroll | auto examples setting overflow-y behavior html <ul> <li><code>overflow-y:hidden</code> — hides the text outside the box <div id="div1"> lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
overflow - CSS: Cascading Style Sheets
WebCSSoverflow
and grid containersinheritednocomputed valueas each of the properties of the shorthand:overflow-x: as specified, except with visible/clip computing to auto/hidden respectively if one of overflow-x or overflow-y is neither visible nor clipoverflow-y: as specified, except with visible/clip computing to auto/hidden respectively if one of overflow-x or overflow-y is neither visible nor clipanimation typediscrete formal syntax [ visible | hidden | clip | scroll | auto ]{1,2} examples setting different overflow values for text p { width: 12em; height: 6em; border: dotted; overflow: visible; /* content is not clipped */ } visible (default) sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium.
overscroll-behavior-block - CSS: Cascading Style Sheets
formal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax contain | none | auto examples preventing block overscrolling in this demo we have two block-level boxes, one inside the other.
overscroll-behavior-inline - CSS: Cascading Style Sheets
formal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax contain | none | auto examples preventing inline overscrolling in this demo we have two block-level boxes, one inside the other.
overscroll-behavior-x - CSS: Cascading Style Sheets
formal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax contain | none | auto examples preventing an underlying element from scrolling horizontally in our simple overscroll-behavior-x example (see source code also), we have two block-level boxes, one inside the other.
padding-block-end - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typea length formal syntax <'padding-left'> examples setting block end padding for vertical text html content <div> <p class="exampletext">example text</p> </div> css content div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; padding-block-end: 20px; background-color: #c8c800; } result specifications specific...
padding-block-start - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typea length formal syntax <'padding-left'> examples setting block start padding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; padding-block-start: 20px; background-color: #c8c800; } result specifications specification statu...
padding-block - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typediscrete formal syntax <'padding-left'>{1,2} examples setting block padding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; padding-block: 20px 40px; background-color: #c8c800; } result specifications specification status ...
padding-bottom - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length formal syntax <length> | <percentage> examples setting padding bottom with pixels and percentages .content { padding-bottom: 5%; } .sidebox { padding-bottom: 10px; } specifications specification status comment css basic box modelthe definition of 'padding-bottom' in that specification.
padding-inline-end - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typea length formal syntax <'padding-left'> examples setting inline end padding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; padding-inline-end: 20px; background-color: #c8c800; } specifications specification status comme...
padding-inline-start - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typea length formal syntax <'padding-left'> examples setting inline start padding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; padding-inline-start: 20px; background-color: #c8c800; } specifications specification status c...
padding-inline - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typediscrete formal syntax <'padding-left'>{1,2} examples setting inline padding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; padding-inline: 20px 40px; background-color: #c8c800; } result specifications specification statu...
padding-left - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length formal syntax <length> | <percentage> examples setting left padding using pixels and percentages .content { padding-left: 5%; } .sidebox { padding-left: 10px; } specifications specification status comment css basic box modelthe definition of 'padding-left' in that specification.
padding-right - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length formal syntax <length> | <percentage> examples setting right padding using pixels and percentages .content { padding-right: 5%; } .sidebox { padding-right: 10px; } specifications specification status comment css basic box modelthe definition of 'padding-right' in that specification.
padding-top - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length formal syntax <length> | <percentage> examples setting top padding using pixels and percentages .content { padding-top: 5%; } .sidebox { padding-top: 10px; } specifications specification status comment css basic box modelthe definition of 'padding-top' in that specification.
padding - CSS: Cascading Style Sheets
WebCSSpadding
first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valueas each of the properties of the shorthand:padding-bottom: the percentage as specified or the absolute lengthpadding-left: the percentage as specified or the absolute lengthpadding-right: the percentage as specified or the absolute lengthpadding-top: the percentage as specified or the absolute lengthanimation typea length formal syntax [ <length> | <percentage> ]{1,4} examples setting padding with pixels html <h4>this element has moderate padding.</h4> <h3>the padding is huge in this element!</h3> css h4 { background-color: lime; padding: 20px 50px; } h3 { background-color: cyan; padding: 110px 50px 50px 110px; } result setting padding with pixels and percentages padding: 5%; ...
page-break-after - CSS: Cascading Style Sheets
user agents may also apply it to other elements like table-row elements.inheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | always | avoid | left | right | recto | verso examples setting a page break after footnotes /* move to a new page after footnotes */ div.footnotes { page-break-after: always; } specifications specification status comment css logical properties and values level 1the definition of 'recto and verso' in that specification.
page-break-before - CSS: Cascading Style Sheets
user agents may also apply it to other elements like table-row elements.inheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | always | avoid | left | right | recto | verso examples avoid a page break before the dic /* avoid page break before the div */ div.note { page-break-before: avoid; } specifications specification status comment css logical properties and values level 1the definition of 'recto and verso' in that specification.
page-break-inside - CSS: Cascading Style Sheets
user agents may also apply it to other elements like table-row elements.inheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | avoid examples avoiding page breaks inside elements html <div class="page"> <p>this is the first paragraph.</p> <section class="list"> <span>a list</span> <ol> <li>one</li> <!-- <li>two</li> --> </ol> </section> <ul> <li>one</li> <!-- <li>two</li> --> </ul> <p>this is the second paragraph.</p> <p>this is the third pa...
paint-order - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies totext elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | [ fill | stroke | markers ] examples reversing the paint order of stroke and fill svg <svg xmlns="http://www.w3.org/2000/svg" width="400" height="200"> <text x="10" y="75">stroke in front</text> <text x="10" y="150" class="stroke-behind">stroke behind</text> </svg> css text { font-family: sans-serif; font-size: 50px; font-weight: bold; fill: blac...
paint() - CSS: Cascading Style Sheets
WebCSSpaint
<li>item 13</li> <li>item 14</li> <li>item 15</li> <li>item 16</li> <li>item 17</li> <li>item 18</li> <li>item 19</li> <li>item 20</li> </ul> css.paintworklet.addmodule('https://mdn.github.io/houdini-examples/csspaint/intro/worklets/hilite.js'); li { --boxcolor: hsla(55, 90%, 60%, 1.0); background-image: paint(hollowhighlights, stroke, 2px); } li:nth-of-type(3n) { --boxcolor: hsla(155, 90%, 60%, 1.0); background-image: paint(hollowhighlights, filled, 3px); } li:nth-of-type(3n+1) { --boxcolor: hsla(255, 90%, 60%, 1.0); background-image: paint(hollowhighlights, stroke, 1px); } we've included a custom property in the selector block defining a boxcolor.
perspective-origin - CSS: Cascading Style Sheets
formal definition initial value50% 50%applies totransformable elementsinheritednopercentagesrefer to the size of bounding boxcomputed valuefor <length> the absolute value, otherwise a percentageanimation typesimple list of length, percentage, or calc formal syntax <position>where <position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]?
perspective - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies totransformable elementsinheritednocomputed valuethe absolute length or noneanimation typea lengthcreates stacking contextyes formal syntax none | <length> examples setting perspective this example shows a cube with the perspective set at different positions.
place-content - CSS: Cascading Style Sheets
size of the alignment container, any auto-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container formal definition initial valuenormalapplies tomulti-line flex containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'align-content'> <'justify-content'>?
place-items - CSS: Cascading Style Sheets
formal definition initial valueas each of the properties of the shorthand:align-items: normaljustify-items: legacyapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:align-items: as specifiedjustify-items: as specifiedanimation typediscrete formal syntax <'align-items'> <'justify-items'>?
place-self - CSS: Cascading Style Sheets
otherwise the specified value.justify-self: as specifiedanimation typediscrete formal syntax <'align-self'> <'justify-self'>?
pointer-events - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | none | visiblepainted | visiblefill | visiblestroke | visible | painted | fill | stroke | all | inherit examples disabling pointer events on all images this example disables pointer events (clicking, dragging, hovering, etc.) on all images.
quotes - CSS: Cascading Style Sheets
WebCSSquotes
formal definition initial valuedepends on user agentapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | auto | [ <string> <string> ]+ examples basic quote marks html <q>to be or not to be.
right - CSS: Cascading Style Sheets
WebCSSright
formal definition initial valueautoapplies topositioned elementsinheritednopercentagesrefer to the width of the containing blockcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typea length, percentage or calc(); formal syntax <length> | <percentage> | auto examples absolute and relative positioning using right html <div id="relative">relatively positioned</div> <div id="absolute">absolutely positioned</div> css #relative { width: 100px; height: 100px; background-color: #ffc7e4; position: relative; top: 20px; left: 20px; } #absolute { width: 100px; ...
rotate - CSS: Cascading Style Sheets
WebCSSrotate
formal definition initial valuenoneapplies totransformable elementsinheritednocomputed valueas specifiedanimation typea transformcreates stacking contextyes formal syntax none | <angle> | [ x | y | z | <number>{3} ] && <angle> examples rotate an element on hover html <div> <p class="rotate">rotation</p> </div> css * { box-sizing: border-box; } html { font-family: sans-serif; } div { width: 150px; margin: 0 auto; } p { padding: 10px 5px; border: 3px solid black; border-radius: 20px; w...
row-gap (grid-row-gap) - CSS: Cascading Style Sheets
WebCSSrow-gap
formal definition initial valuenormalapplies tomulti-column elements, flex containers, grid containersinheritednopercentagesrefer to corresponding dimension of the content areacomputed valueas specified, with <length>s made absolute, and normal computing to zero except on multi-column elementsanimation typea length, percentage or calc(); formal syntax normal | <length-percentage>where <length-percentage> = <length> | <percentage> examples flex layout html <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; row-gap: 20px; } #flexbox > div { border: 1px solid gr...
ruby-align - CSS: Cascading Style Sheets
formal definition initial valuespace-aroundapplies toruby bases, ruby annotations, ruby base containers, ruby annotation containersinheritedyescomputed valueas specifiedanimation typediscrete formal syntax start | center | space-between | space-around examples ruby aligned at the start of the base text html <ruby> <rb>this is a long text to check</rb> <rp>(</rp><rt>short ruby</rt><rp>)</rp> </ruby> css ruby { ruby-align: start; } result ruby aligned at the center of the base text html <ruby> <rb>this is a long text to check</rb> <rp>(</rp><rt>sho...
ruby-position - CSS: Cascading Style Sheets
formal definition initial valueoverapplies toruby annotations containersinheritedyescomputed valueas specifiedanimation typediscrete formal syntax over | under | inter-character examples ruby positioned over the text html <ruby> <rb>超電磁砲</rb> <rp>(</rp><rt>レールガン</rt><rp>)</rp> </ruby> css ruby { ruby-position:over; } result ruby positioned under the text html <ruby> <rb>超電磁砲</rb> <rp>(</rp><rt>レールガン</rt><rp>)</rp> </ruby> css ruby { ruby-positi...
scale - CSS: Cascading Style Sheets
WebCSSscale
formal definition initial valuenoneapplies totransformable elementsinheritednocomputed valueas specifiedanimation typea transformcreates stacking contextyes formal syntax none | <number>{1,3} examples scaling an element on hover html <div> <p class="scale">scaling</p> </div> css * { box-sizing: border-box; } html { font-family: sans-serif; } div { width: 150px; margin: 0 auto; } p { padding: 10px 5px; border: 3px solid black; border-radius: 20px; width: 150px; font-size: 1.2rem; t...
scroll-behavior - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toscrolling boxesinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | smooth examples setting smooth scroll behavior html <nav> <a href="#page-1">1</a> <a href="#page-2">2</a> <a href="#page-3">3</a> </nav> <scroll-container> <scroll-page id="page-1">1</scroll-page> <scroll-page id="page-2">2</scroll-page> <scroll-page id="page-3">3</scroll-page> </scroll-container> css a { display: inline-block; width: 50px; t...
scroll-margin-block-end - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-block-end' in that specification.
scroll-margin-block-start - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-block-start' in that specification.
scroll-margin-block - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length>{1,2} specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-block' in that specification.
scroll-margin-bottom - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-bottom' in that specification.
scroll-margin-left - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-left' in that specification.
scroll-margin-right - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-right' in that specification.
scroll-margin-top - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-top' in that specification.
scroll-padding-block-end - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-block-end' in that specification.
scroll-padding-block-start - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-block-start' in that specification.
scroll-padding-block - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type formal syntax [ auto | <length-percentage> ]{1,2}where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-block' in that specification.
scroll-padding-bottom - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-bottom' in that specification.
scroll-padding-inline-end - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-inline-end' in that specification.
scroll-padding-inline-start - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-inline-start' in that specification.
scroll-padding-inline - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type formal syntax [ auto | <length-percentage> ]{1,2}where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-inline' in that specification.
scroll-padding-left - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-left' in that specification.
scroll-padding-right - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-right' in that specification.
scroll-padding-top - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-top' in that specification.
scroll-padding - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type formal syntax [ auto | <length-percentage> ]{1,4}where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding' in that specification.
scroll-snap-align - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ none | start | end | center ]{1,2} specifications specification status comment css scroll snap module level 1the definition of 'scroll-snap-align' in that specification.
scroll-snap-points-x - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toscroll containersinheritednopercentagesrelative to same axis of the padding-box of the scroll containercomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typediscrete formal syntax none | repeat( <length-percentage> )where <length-percentage> = <length> | <percentage> examples setting horizontal scroll snap points html <div id="container"> <div>1</div> <div>2</div> <div>3</div> </div> css #container { width: 200px; overflow: auto; white-space: nowrap; scroll-snap-points-x: repeat(100%); scroll-snap-type: mandatory; font-size: ...
scroll-snap-points-y - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toscroll containersinheritednopercentagesrelative to same axis of the padding-box of the scroll containercomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typediscrete formal syntax none | repeat( <length-percentage> )where <length-percentage> = <length> | <percentage> examples setting vertical scroll snap points html <div id="container"> <div>1</div> <div>2</div> <div>3</div> </div> css #container { height: 200px; width: 220px; overflow-x: hidden; overflow-y: auto; scroll-snap-points-y: repeat(200px); scroll-snap-type: mandato...
scrollbar-color - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toscrolling boxesinheritedyescomputed valueas specifiedanimation typea color formal syntax auto | dark | light | <color>{2}where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
shape-image-threshold - CSS: Cascading Style Sheets
formal definition initial value0.0applies tofloatsinheritednocomputed valuethe same as the specified value after clipping the <number> to the range [0.0, 1.0].animation typea number formal syntax <alpha-value>where <alpha-value> = <number> | <percentage> examples aligning text to a gradient this example creates a <div> block with a gradient background image.
shape-margin - CSS: Cascading Style Sheets
formal definition initial value0applies tofloatsinheritednopercentagesrefer to the width of the containing blockcomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typea length, percentage or calc(); formal syntax <length-percentage>where <length-percentage> = <length> | <percentage> examples adding a margin to a polygon html <section> <div class="shape"></div> we are not quite sure of any one thing in biology; our knowledge of geology is relatively very slight, and the economic laws of society are uncertain to every one except some individual who attempts...
tab-size - CSS: Cascading Style Sheets
WebCSStab-size
formal definition initial value8applies toblock containersinheritedyescomputed valuethe specified integer or an absolute lengthanimation typea length formal syntax <integer> | <length> examples expanding by character count pre { tab-size: 4; /* set tab size to 4 characters wide */ } collapse tabs pre { tab-size: 0; /* remove indentation */ } comparing to the default size this example compares a default tab size with a custom tab size.
table-layout - CSS: Cascading Style Sheets
formal definition initial valueautoapplies totable and inline-table elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | fixed examples fixed-width tables with text-overflow this example uses a fixed table layout, combined with the width property, to restrict the table's width.
text-align-last - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toblock containersinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | start | end | left | right | center | justify examples justifying the last line <p>integer elementum massa at nulla placerat varius.
text-align - CSS: Cascading Style Sheets
g wcag 2.0 formal definition initial valuestart, or a nameless value that acts as left if direction is ltr, right if direction is rtl if start is not supported by the browser.applies toblock containersinheritedyescomputed valueas specified, except for the match-parent value which is calculated against its parent's direction value and results in a computed value of either left or rightanimation typediscrete formal syntax start | end | left | right | center | justify | match-parent examples left alignment html <p class="example"> integer elementum massa at nulla placerat varius.
text-decoration-line - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritednocomputed valueas specifiedanimation typediscrete formal syntax none | [ underline | overline | line-through | blink ] | spelling-error | grammar-error examples <p class="wavy">here's some text with wavy red underline!</p> <p class="both">this text has lines both above and below it.</p> .wavy { text-decoration-line: underline; text-decoration-style: wavy; text-decoration-color: red; } .both { text-decoration-line: underline...
text-decoration-skip-ink - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | all | none examples html <p>you should go on a quest for a cup of coffee.</p> <p class="no-skip-ink">or maybe you'd prefer some tea?</p> <p>この文は、 text-decoration-skip-ink: auto の使用例を示しています。</p> <p class="skip-ink-all">この文は、 text-decoration-skip-ink: all の使用例を示しています。</p> css p { font-size: 1.
text-decoration-skip - CSS: Cascading Style Sheets
formal definition initial valueobjectsapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | [ objects | [ spaces | [ leading-spaces | trailing-spaces ] ] | edges | box-decoration ] examples skipping edges html <p>hey, grab a cup of <em>coffee!</em></p> css p { margin: 0; font-size: 3em; text-decoration: underline; text-decoration-skip: edges; } result specifications specification status comment css text decora...
text-decoration-style - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritednocomputed valueas specifiedanimation typediscrete formal syntax solid | double | dotted | dashed | wavy examples setting a wavy underline .example { -moz-text-decoration-line: underline; -moz-text-decoration-style: wavy; -moz-text-decoration-color: red; -webkit-text-decoration-line: underline; -webkit-text-decoration-style: wavy; -webkit-text-decoration-color: red; } css .wavy { text-decoration-l...
text-decoration-thickness - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the font size of the element itselfcomputed valueas specifiedanimation typeby computed value type formal syntax auto | from-font | <length> | <percentage> examples varying thickness html <p class="thin">here's some text with a 1px red underline.</p> <p class="thick">this one has a 5px red underline.</p> <p class="shorthand">this uses the equivalent shorthand.</p> css .thin { text-decoration-line: underline; text-decoration-style: solid; text-decoration-colo...
text-decoration - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritednocomputed valueas each of the properties of the shorthand:text-decoration-line: as specifiedtext-decoration-style: as specifiedtext-decoration-color: computed colortext-decoration-thickness: as specifiedanimation typeas each of the properties of the shorthand:text-decoration-color: a colortext-decoration-style: discretetext-decoration-line: discretetext-decoration-thickness: by computed value type formal syntax <'text-decoration-line'> | <'text-decoration-style'> | <'text-decoration-color'> | <'text-decoration-thickness'> examples .under { text-decoration: underline red; } .over { text-decoration: wav...
text-emphasis-color - CSS: Cascading Style Sheets
formal definition initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typea color formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
text-emphasis-position - CSS: Cascading Style Sheets
formal definition initial valueover rightapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ over | under ] && [ right | left ] examples preferring ruby over emphasis marks some editors prefer to hide emphasis marks when they conflict with ruby.
text-emphasis-style - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | [ [ filled | open ] | [ dot | circle | double-circle | triangle | sesame ] ] | <string> examples h2 { text-emphasis-style: sesame; } specifications specification status comment css text decoration module level 3the definition of 'text-emphasis' in that specification.
text-emphasis - CSS: Cascading Style Sheets
formal definition initial valueas each of the properties of the shorthand:text-emphasis-style: nonetext-emphasis-color: currentcolorapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:text-emphasis-style: as specifiedtext-emphasis-color: computed coloranimation typeas each of the properties of the shorthand:text-emphasis-color: a colortext-emphasis-style: discrete formal syntax <'text-emphasis-style'> | <'text-emphasis-color'> examples a heading with emphasis shape and color this example draws a heading with triangles used to emphasize each character.
text-indent - CSS: Cascading Style Sheets
formal definition initial value0applies toblock containersinheritedyespercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute length, plus any keywords as specifiedanimation typea length, percentage or calc(); formal syntax <length-percentage> && hanging?
text-orientation - CSS: Cascading Style Sheets
formal definition initial valuemixedapplies toall elements, except table row groups, rows, column groups, and columnsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax mixed | upright | sideways examples html <p>lorem ipsum dolet semper quisquam.</p> css p { writing-mode: vertical-rl; text-orientation: upright; } result specifications specification status comment css writing modes module level 3the definition of 'text-orientation' in that specification.
text-overflow - CSS: Cascading Style Sheets
formal definition initial valueclipapplies toblock container elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ clip | ellipsis | <string> ]{1,2} examples css p { width: 200px; border: 1px solid; padding: 2px 5px; /* both of the following are required for text-overflow */ white-space: nowrap; overflow: hidden; } .overflow-visible { white-space: initial; } .overflow-clip { text-overflow: clip; } .overflow-ellipsis { text-overflow: ellipsis; } .overflow-st...
text-rendering - CSS: Cascading Style Sheets
formal definition initial valueautoapplies totext elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | optimizespeed | optimizelegibility | geometricprecision examples automatic application of optimizelegibility this demonstrates how optimizelegibility is used by browsers automatically when the font-size is smaller than 20px.
text-shadow - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritedyescomputed valuea color plus three absolute lengthsanimation typea shadow list formal syntax none | <shadow-t>#where <shadow-t> = [ <length>{2,3} && <color>?
text-size-adjust - CSS: Cascading Style Sheets
formal definition initial valueauto for smartphone browsers supporting inflation, none in other cases (and then not modifiable).applies toall elementsinheritedyespercentagesyes, refer to the corresponding size of the text fontcomputed valueas specifiedanimation typediscrete formal syntax none | auto | <percentage> examples basic disabling usage as hinted at above, on a properly designed responsive site the text-size-adjust behavior is not needed, so developers can elect to turn it off by specifying a vlaue of none: p { -webkit-text-size-adjust: none; text-size-adjust: none; } specifications specification status comment ...
text-underline-offset - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritedyespercentagesrefer to the font size of the element itselfcomputed valueas specifiedanimation typeby computed value type formal syntax auto | <length> | <percentage> examples <p class="oneline">here's some text with an offset wavy red underline!</p> <br> <p class="twolines">this text has lines both above and below it.
text-underline-position - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | from-font | [ under | [ left | right ] ] examples a simple example let's take a couple of simple example paragraphs: <p class="horizontal">lorem ipsum dolor sit amet, consectetur adipiscing elit.
top - CSS: Cascading Style Sheets
WebCSStop
formal definition initial valueautoapplies topositioned elementsinheritednopercentagesrefer to the height of the containing blockcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typea length, percentage or calc(); formal syntax <length> | <percentage> | auto examples body { background: beige; } div { position: absolute; top: 10%; right: 40%; bottom: 20%; left: 15%; background: gold; border: 1px solid blue; } <div>the size of this content is determined by the position of its edges.</div> specifications specification status comment ...
touch-action - CSS: Cascading Style Sheets
mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | understanding wcag 2.0 formal definition initial valueautoapplies toall elements except: non-replaced inline elements, table rows, row groups, table columns, and column groupsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | none | [ [ pan-x | pan-left | pan-right ] | [ pan-y | pan-up | pan-down ] | pinch-zoom ] | manipulation examples disabling all gestures the most common usage is to disable all gestures on an element (and its non-scrollable descendants) that provides its own dragging and zooming behavior – such as a map or game surface.
transform-box - CSS: Cascading Style Sheets
formal definition initial valueview-boxapplies totransformable elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax content-box | border-box | fill-box | stroke-box | view-box examples svg transform-origin scoping in this example we have an svg: <svg id="svg" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 50 50"> <g> <circle id="center" fill="red" r="1" transform="translate(25 25)" /> <circle id="boxcenter" fill="blue" r=".5" transform="translate(15 15)" /> <rect id="...
matrix() - CSS: Cascading Style Sheets
its result is a <transform-function> data type.
matrix3d() - CSS: Cascading Style Sheets
its result is a <transform-function> data type.
perspective() - CSS: Cascading Style Sheets
its result is a <transform-function> data type.
rotate() - CSS: Cascading Style Sheets
its result is a <transform-function> data type.
rotate3d() - CSS: Cascading Style Sheets
its result is a <transform-function> data type.
rotateX() - CSS: Cascading Style Sheets
its result is a <transform-function> data type.
rotateY() - CSS: Cascading Style Sheets
its result is a <transform-function> data type.
rotateZ() - CSS: Cascading Style Sheets
its result is a <transform-function> data type.
scale3d() - CSS: Cascading Style Sheets
its result is a <transform-function> data type.
scaleX() - CSS: Cascading Style Sheets
its result is a <transform-function> data type.
scaleY() - CSS: Cascading Style Sheets
its result is a <transform-function> data type.
scaleZ() - CSS: Cascading Style Sheets
its result is a <transform-function> data type.
skew() - CSS: Cascading Style Sheets
its result is a <transform-function> data type.
skewX() - CSS: Cascading Style Sheets
its result is a <transform-function> data type.
skewY() - CSS: Cascading Style Sheets
its result is a <transform-function> data type.
translate() - CSS: Cascading Style Sheets
its result is a <transform-function> data type.
translate3d() - CSS: Cascading Style Sheets
its result is a <transform-function> data type.
translateX() - CSS: Cascading Style Sheets
its result is a <transform-function> data type.
translateY() - CSS: Cascading Style Sheets
its result is a <transform-function> data type.
translateZ() - CSS: Cascading Style Sheets
its result is a <transform-function> data type.
transform-origin - CSS: Cascading Style Sheets
and match the following <percentage> values: keyword value left 0% center 50% right 100% top 0% bottom 100% formal definition initial value50% 50% 0applies totransformable elementsinheritednopercentagesrefer to the size of bounding boxcomputed valuefor <length> the absolute value, otherwise a percentageanimation typesimple list of length, percentage, or calc formal syntax [ <length-percentage> | left | center | right | top | bottom ] | [ [ <length-percentage> | left | center | right ] && [ <length-percentage> | top | center | bottom ] ] <length>?where <length-percentage> = <length> | <percentage> examples code sample transform: none; <div class="box1">&nbsp;</di...
transition-delay - CSS: Cascading Style Sheets
formal definition initial value0sapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <time># examples transition-delay: 0.5s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; font-size: 20px; left: 0px; top: 0px; position:absolute; -webkit-transition-property: width height background-color font-size left top ...
transition-duration - CSS: Cascading Style Sheets
formal definition initial value0sapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <time># examples transition-duration: 0.5s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; font-size: 20px; left: 0px; top: 0px; position:absolute; -webkit-transition-property: width height background-color font-size left t...
transition-property - CSS: Cascading Style Sheets
formal definition initial valueallapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | <single-transition-property>#where <single-transition-property> = all | <custom-ident> examples there are several examples of css transitions included in the main css transitions article.
transition-timing-function - CSS: Cascading Style Sheets
formal definition initial valueeaseapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <timing-function>#where <timing-function> = linear | <cubic-bezier-timing-function> | <step-timing-function>where <cubic-bezier-timing-function> = ease | ease-in | ease-out | ease-in-out | cubic-bezier(<number <a href="/docs/css/value_definition_syntax#brackets" title="brackets: enclose several entities, combinators, and multipliers to transform them as a single component"...
transition - CSS: Cascading Style Sheets
roperties of the shorthand:transition-delay: 0stransition-duration: 0stransition-property: alltransition-timing-function: easeapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas each of the properties of the shorthand:transition-delay: as specifiedtransition-duration: as specifiedtransition-property: as specifiedtransition-timing-function: as specifiedanimation typediscrete formal syntax <single-transition>#where <single-transition> = [ none | <single-transition-property> ] | <time> | <timing-function> | <time>where <single-transition-property> = all | <custom-ident><timing-function> = linear | <cubic-bezier-timing-function> | <step-timing-function>where <cubic-bezier-timing-function> = ease | ease-in | ease-out | ease-in-out | cubic-bezier(<number <a href...
url() - CSS: Cascading Style Sheets
WebCSSurl()
the url() functional notation is the value for the <url> data type.
user-select - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | text | none | contain | all examples html <p>you should be able to select this text.</p> <p class="unselectable">hey, you can't select this text!</p> <p class="all">clicking once will select all of this text.</p> css .unselectable { -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .all { -moz-user-select...
visibility - CSS: Cascading Style Sheets
formal definition initial valuevisibleapplies toall elementsinheritedyescomputed valueas specifiedanimation typea visibility formal syntax visible | hidden | collapse examples basic example html <p class="visible">the first paragraph is visible.</p> <p class="not-visible">the second paragraph is not visible.</p> <p class="visible">the third paragraph is visible.
white-space - CSS: Cascading Style Sheets
collapse collapse no wrap remove pre preserve preserve no wrap preserve pre-wrap preserve preserve wrap hang pre-line preserve collapse wrap remove break-spaces preserve preserve wrap wrap formal definition initial valuenormalapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | pre | nowrap | pre-wrap | pre-line | break-spaces examples basic example code { white-space: pre; } line breaks inside <pre> elements pre { word-wrap: break-word; /* ie 5.5-7 */ white-space: pre-wrap; /* modern browsers */ } in action html <div id="css-code" class="box"> p { white-space: <select> <option>normal</option> <option...
width - CSS: Cascading Style Sheets
WebCSSwidth
mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | understanding wcag 2.0 formal definition initial valueautoapplies toall elements but non-replaced inline elements, table rows, and row groupsinheritednopercentagesrefer to the width of the containing blockcomputed valuea percentage or auto or the absolute lengthanimation typea length, percentage or calc(); formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> examples default width p.goldie { background: gold; } <p class="goldie">the mozilla community produces a lot of great software.</p> pixels and ems .px_length { width: 200px; background-color: r...
will-change - CSS: Cascading Style Sheets
.slide { will-change: transform; } formal definition initial valueautoapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | <animateable-feature>#where <animateable-feature> = scroll-position | contents | <custom-ident> examples 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.
word-break - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | break-all | keep-all | break-word examples html <p>1.
word-spacing - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritedyespercentagesrefer to the width of the affected glyphcomputed valuean optimum, minimum, and maximum value, each consisting of either an absolute length, a percentage, or the keyword normalanimation typea length formal syntax normal | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css text module level 3the definition of 'word-spacing' in that specification.
writing-mode - CSS: Cascading Style Sheets
formal definition initial valuehorizontal-tbapplies toall elements except table row groups, table column groups, table rows, and table columnsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax horizontal-tb | vertical-rl | vertical-lr | sideways-rl | sideways-lr examples using multiple writing modes this example demonstrates all of the writing modes, showing each with text in various languages.
z-index - CSS: Cascading Style Sheets
WebCSSz-index
formal definition initial valueautoapplies topositioned elementsinheritednocomputed valueas specifiedanimation typean integercreates stacking contextyes formal syntax auto | <integer> examples visually layering elements html <div class="dashed-box">dashed box <span class="gold-box">gold box</span> <span class="green-box">green box</span> </div> css .dashed-box { position: relative; z-index: 1; border: dashed; height: 8em; margin-bottom: 1em; margin-top: 2em; } .gold-box { position: a...
zoom - CSS: Cascading Style Sheets
WebCSSzoom
formal definition initial valuenormalapplies toall elementsinheritednocomputed valueas specifiedanimation typean integer formal syntax normal | reset | <number> | <percentage> examples first example html <p class="small">small</p> <p class="normal">normal</p> <p class="big">big</p> css p.small { zoom: 75%; } p.normal { zoom: normal; } p.big { zoom: 2.5; } p { display: inline-block; } p:hover { zoom: reset; } result second example html <div id="a" class="circle"></div> <div id="b" ...
CSS: Cascading Style Sheets
WebCSS
this module looks at the cascade and inheritance, all the selector types we have available, units, sizing, styling backgrounds and borders, debugging, and lots more.
Common (exsl) - EXSLT
WebEXSLTexsl
this lets you process the xml created within a variable to process it in multiple steps.exsl:object-type()exsl:object-type() returns a string that indicates the type of the specified object.
math:max() - EXSLT
WebEXSLTmathmax
to compute the maximum value of the node-set, the node set is sorted into descending order as it would be using xsl:sort() with a data type of number.
math:min() - EXSLT
WebEXSLTmathmin
to compute the minimum value of the node-set, the node set is sorted into ascending order as it would be using xsl:sort() with a data type of number.
EXSLT
functions exsl:node-set() exsl:object-type() math the exslt math package provides functions for working with numeric values and comparing nodes.
touchstart - Event reference
two types of object can be the target of this event.
Live streaming web audio and video - Developer guides
opus opus is a royalty-free and open format that manages to optimize quality at various bit-rates for different types of audio.
Web Audio playbackRate explained - Developer guides
next we set playbackrate to 0.5, which represents half normal speed (the playbackrate is a multiplier applied to the original rate.) a complete example let's create a <video> element first, and set up video and playback rate controls in html: <video id="myvideo" controls> <source src="https://udn.realityripple.com/samples/6f/08625b424a.m4v" type='video/mp4' /> <source src="https://udn.realityripple.com/samples/5b/8cd6da9c65.webm" type='video/webm' /> </video> <form> <input id="pbr" type="range" value="1" min="0.5" max="4" step="0.1" > <p>playback rate <span id="currentpbr">1</span></p> </form> and apply some javascript to it: window.onload = function () { var v = document.getelementbyid("myvideo"); var p = document.geteleme...
Writing Web Audio API code that works in every browser - Developer guides
things that are not ready yet second, ensure that your project doesn't use node types that are not implemented yet in firefox: mediastreamaudiosourcenode, mediaelementaudiosourcenode and oscillatornode.
Creating and triggering events - Developer guides
event, allow bubbling, and provide any data you want to pass to the "detail" property const eventawesome = new customevent('awesome', { bubbles: true, detail: { text: () => textarea.value } }); // the form element listens for the custom "awesome" event and then consoles the output of the passed text() method form.addeventlistener('awesome', e => console.log(e.detail.text())); // as the user types, the textarea inside the form dispatches/triggers the event to fire, and uses itself as the starting point textarea.addeventlistener('input', e => e.target.dispatchevent(eventawesome)); creating and dispatching events dynamically elements can listen for events that haven't been created yet: <form> <textarea></textarea> </form> const form = document.queryselector('form'); const textarea =...
Mouse gesture events - Developer guides
types of gesture events mozswipegesture the mozswipegesture event is sent when the user uses three fingers to "swipe" the trackpad.
Touch events (Mozilla experimental) - Developer guides
types of touch events moztouchdown sent when the user begins a screen touch action.
Introduction to Web development - Developer guides
basic structure of a web page — the doctype and document 'tree' fundamental html elements — structural, head, list, form elements and more, explained by category.
Writing forward-compatible websites - Developer guides
here's an example that works in browsers without html5 support but breaks in a browser supporting html5: <form action="http://www.example.com"> <input type="submit" value="submit the form" </form> due to the missing > on the input tag.
HTML attribute: maxlength - HTML: Hypertext Markup Language
examples <input type="password" maxlength="4"/> specifications specification status html living standardthe definition of 'maxlength attribute' in that specification.
HTML attribute: minlength - HTML: Hypertext Markup Language
<label for="fruit">enter a fruit name that is at least 5 letters long</label> <input type="text" minlength="5" id="fruit"> we can use pseudoclasses to style the element based on whether the value is valid.
DASH Adaptive Streaming for HTML 5 Video - HTML: Hypertext Markup Language
dash works via http, so as long as your http server supports byte range requests, and it's set up to serve .mpd files with mimetype="application/dash+xml", then you're all set.
Date and time formats used in HTML - HTML: Hypertext Markup Language
for <input>, the values of type that return a value which contains a string representing a date and/or time are: date datetime datetime-local month time week examples before getting into the intricacies of how date and time strings are written and parsed in html, here are some examples that should give you a good idea what the more commonly-used date and time string formats look like.
<address>: The Contact Address element - HTML: Hypertext Markup Language
WebHTMLElementaddress
the contact information provided by an <address> element's contents can take whatever form is appropriate for the context, and may include any type of contact information that is needed, such as a physical address, url, email address, phone number, social media handle, geographic coordinates, and so forth.
<bgsound>: The Background Sound element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementbgsound
src this attribute specifies the url of the sound file to be played, which must be one of the following types: .wav, .au, or .mid.
<canvas>: The Graphics Canvas element - HTML: Hypertext Markup Language
WebHTMLElementcanvas
permitted content transparent but with no interactive content descendants except for <a> elements, <button> elements, <input> elements whose type attribute is checkbox, radio, or button.
<details>: The Details disclosure element - HTML: Hypertext Markup Language
WebHTMLElementdetails
the <summary> element supports the list-style shorthand property and its longhand properties, such as list-style-type, to change the disclosure triangle to whatever you choose (usually with list-style-image).
<dialog>: The Dialog element - HTML: Hypertext Markup Language
WebHTMLElementdialog
vascript var updatebutton = document.getelementbyid('updatedetails'); var favdialog = document.getelementbyid('favdialog'); var outputbox = document.queryselector('output'); var selectel = document.queryselector('select'); var confirmbtn = document.getelementbyid('confirmbtn'); // "update details" button opens the <dialog> modally updatebutton.addeventlistener('click', function onopen() { if (typeof favdialog.showmodal === "function") { favdialog.showmodal(); } else { alert("the <dialog> api is not supported by this browser"); } }); // "favorite animal" input sets the value of the submit button selectel.addeventlistener('change', function onselect(e) { confirmbtn.value = selectel.value; }); // "confirm" button of form triggers "close" on dialog because of [method="dialog"] fa...
<em>: The Emphasis element - HTML: Hypertext Markup Language
WebHTMLElementem
typically this element is displayed in italic type.
<head>: The Document Metadata (Header) element - HTML: Hypertext Markup Language
WebHTMLElementhead
example <!doctype html> <html> <head> <title>document title</title> </head> </html> notes html5-compliant browsers automatically create a <head> element if its tags are omitted in the markup.
<hgroup> - HTML: Hypertext Markup Language
WebHTMLElementhgroup
ine in with a colon character and space (“: ”) or other such punctuation after the primary heading and before the first secondary heading (and with the same or similar punctuation before any other secondary headings an <hgroup> might be shown in a rendered outline in with the primary heading followed by parentheses around the secondary heading(s) consider the following html document: <!doctype html> <title>html standard</title> <body> <hgroup id="document-title"> <h1>html</h1> <h2>living standard — last updated 12 august 2016</h2> </hgroup> <p>some intro to the document.</p> <h2>table of contents</h2> <ol id=toc>...</ol> <h2>first section</h2> <p>some intro to the first section.</p> </body> a rendered outline for that document might look like the following: ...
<kbd>: The Keyboard Input element - HTML: Hypertext Markup Language
WebHTMLElementkbd
<p>if a syntax error occurs, the tool will output the initial command you typed for your review:</p> <blockquote> <samp><kbd>custom-git ad my-new-file.cpp</kbd></samp> </blockquote> representing onscreen input options nesting a <samp> element inside a <kbd> element represents input which is based on text presented by the system, such as the names of menus and menu items, or the names of buttons displayed on the screen.
<meter>: The HTML Meter element - HTML: Hypertext Markup Language
WebHTMLElementmeter
this attribute is only used if the <meter> element is being used as a form-associated element, such as one displaying a range corresponding to an <input type="number">.
<noscript> - HTML: Hypertext Markup Language
WebHTMLElementnoscript
the html <noscript> element defines a section of html to be inserted if a script type on the page is unsupported or if scripting is currently turned off in the browser.
<output>: The Output element - HTML: Hypertext Markup Language
WebHTMLElementoutput
<form oninput="result.value=parseint(a.value)+parseint(b.value)"> <input type="range" id="b" name="b" value="50" /> + <input type="number" id="a" name="a" value="10" /> = <output name="result" for="a b">60</output> </form> accessibility concerns many browsers implement this element as an aria-live region.
<plaintext>: The Plain Text element (Deprecated) - HTML: Hypertext Markup Language
instead serve a text file with the text/plain mime-type.
<select>: The HTML Select element - HTML: Hypertext Markup Language
WebHTMLElementselect
however, these properties don't produce a consistent result across browsers, and it is hard to do things like line different types of form element up with one another in a column.
<var>: The Variable element - HTML: Hypertext Markup Language
WebHTMLElementvar
it's typically presented using an italicized version of the current typeface, although that behavior is browser-dependent.
autocapitalize - HTML: Hypertext Markup Language
the autocapitalize attribute never causes autocapitalization to be enabled for an <input> element with a type attribute whose value is url, email, or password.
dropzone - HTML: Hypertext Markup Language
the dropzone global attribute is an enumerated attribute indicating what types of content can be dropped on an element, using the html drag and drop api.
is - HTML: Hypertext Markup Language
this attribute can only be used if the specified custom element name has been successfully defined in the current document, and extends the element type it is being applied to.
spellcheck - HTML: Hypertext Markup Language
if this attribute is not set, its default value is element-type and browser-defined.
HTML reference - HTML: Hypertext Markup Language
link types in html, the following link types indicate the relationship between two documents, in which one links to the other using an <a>, <area>, or <link> element.
Reason: CORS request not HTTP - HTTP
cors requests may only use the https url scheme, but the url specified by the request is of a different type.
HTTP conditional requests - HTTP
both last-modified and etag allow both types of validation, though the complexity to implement it on the server side may vary.
Connection management in HTTP/1.x - HTTP
not all types of http requests can be pipelined: only idempotent methods, that is get, head, put and delete, can be replayed safely: should a failure happen, the pipeline content can simply be repeated.
Feature Policy - HTTP
types of policy-controlled features though feature policy provides control of multiple features using a consistent syntax, the behavior of policy controlled features varies and depends on several factors.
Accept-CH-Lifetime - HTTP
header type response header forbidden header name ?
Accept-CH - HTTP
header type response header forbidden header name ?
Accept-Encoding - HTTP
header type request header forbidden header name yes syntax accept-encoding: gzip accept-encoding: compress accept-encoding: deflate accept-encoding: br accept-encoding: identity accept-encoding: * // multiple algorithms, weighted with the quality value syntax: accept-encoding: deflate, gzip;q=1.0, *;q=0.5 directives gzip a compression format using the lempel-ziv coding (lz77), w...
Accept-Ranges - HTTP
header type response header forbidden header name no syntax accept-ranges: <range-unit> accept-ranges: none directives <range-unit> defines the range unit the server supports.
Access-Control-Allow-Credentials - HTTP
header type response header forbidden header name no syntax access-control-allow-credentials: true directives true the only valid value for this header is true (case-sensitive).
Access-Control-Allow-Headers - HTTP
header type response header forbidden header name no syntax access-control-allow-headers: <header-name>[, <header-name>]* access-control-allow-headers: * directives <header-name> the name of a supported request header.
Access-Control-Allow-Methods - HTTP
header type response header forbidden header name no syntax access-control-allow-methods: <method>, <method>, ...
Access-Control-Allow-Origin - HTTP
header type response header forbidden header name no syntax access-control-allow-origin: * access-control-allow-origin: <origin> access-control-allow-origin: null directives * for requests without credentials, the literal value "*" can be specified, as a wildcard; the value tells browsers to allow requesting code from any origin to access the resource.
Access-Control-Max-Age - HTTP
header type response header forbidden header name no syntax access-control-max-age: <delta-seconds> directives <delta-seconds> maximum number of seconds the results can be cached.
Access-Control-Request-Method - HTTP
header type request header forbidden header name yes syntax access-control-request-method: <method> directives <method> one of the http request methods, for example get, post, or delete.
Age - HTTP
WebHTTPHeadersAge
header type response header forbidden header name no syntax age: <delta-seconds> directives <delta-seconds> a non-negative integer, representing time in seconds the object has been in a proxy cache.
Allow - HTTP
WebHTTPHeadersAllow
header type entity header forbidden header name no syntax allow: <http-methods> directives <http-methods> the comma-separated list of allowed http request methods.
Connection - HTTP
header type general header forbidden header name yes syntax connection: keep-alive connection: close directives close indicates that either the client or the server would like to close the connection.
Content-Length - HTTP
header type entity header forbidden header name yes syntax content-length: <length> directives <length> the length in decimal number of octets.
Content-Range - HTTP
header type response header forbidden header name no cors-safelisted response-header no syntax content-range: <unit> <range-start>-<range-end>/<size> content-range: <unit> <range-start>-<range-end>/* content-range: <unit> */<size> directives <unit> the unit in which ranges are specified.
CSP: report-to - HTTP
csp version 1 directive type reporting directive this directive is not supported in the <meta> element.
CSP: sandbox - HTTP
csp version 1.1 / 2 directive type document directive this directive is not supported in the <meta> element or by the content-security-policy-report-only header field.
Cookie - HTTP
WebHTTPHeadersCookie
header type request header forbidden header name yes syntax cookie: <cookie-list> cookie: name=value cookie: name=value; name2=value2; name3=value3 <cookie-list> a list of name-value pairs in the form of <cookie-name>=<cookie-value>.
Cookie2 - HTTP
WebHTTPHeadersCookie2
header type request header forbidden header name yes examples cookie2: $version="1" specifications specification title rfc 2965: cookie2 historic specification of http state management mechanism, obsoleted by rfc 6265 ...
Cross-Origin-Embedder-Policy - HTTP
header type response header forbidden header name no syntax cross-origin-embedder-policy: unsafe-none | require-corp directives unsafe-none this is the default value.
Cross-Origin-Opener-Policy - HTTP
header type response header forbidden header name no syntax cross-origin-opener-policy: unsafe-none | same-origin-allow-popups | same-origin directives unsafe-none this is the default value.
Cross-Origin-Resource-Policy - HTTP
header type response header forbidden header name no syntax cross-origin-resource-policy: same-site | same-origin | cross-origin examples the response header below will cause compatible user agents to disallow cross-origin no-cors requests: cross-origin-resource-policy: same-origin for more examples, see https://resourcepolicy.fyi/.
DNT - HTTP
WebHTTPHeadersDNT
header type request header forbidden header name yes syntax dnt: 0 dnt: 1 dnt: null directives 0 the user prefers to allow tracking on the target site.
DPR - HTTP
WebHTTPHeadersDPR
header type request header forbidden header name ?
Date - HTTP
WebHTTPHeadersDate
note that date is listed in the forbidden header names in the fetch spec - so this code will not send date header: fetch('https://httpbin.org/get', { 'headers': { 'date': (new date()).toutcstring() } }) header type general header forbidden header name yes syntax date: <day-name>, <day> <month> <year> <hour>:<minute>:<second> gmt directives <day-name> one of "mon", "tue", "wed", "thu", "fri", "sat", or "sun" (case-sensitive).
Device-Memory - HTTP
header type request header forbidden header name ?
ETag - HTTP
WebHTTPHeadersETag
header type response header forbidden header name no syntax etag: w/"<etag_value>" etag: "<etag_value>" directives w/ optional 'w/' (case-sensitive) indicates that a weak validator is used.
Early-Data - HTTP
header type request header forbidden header name no syntax early-data: 1 examples get /resource http/1.0 host: example.com early-data: 1 specifications specification title rfc 8470, section 5.1: the early-data header field using early data in http ...
Expires - HTTP
WebHTTPHeadersExpires
header type response header forbidden header name no cors-safelisted response header yes syntax expires: <http-date> directives <http-date> an http-date timestamp.
Feature-Policy: fullscreen - HTTP
when this policy is enabled, the returned promise rejects with a typeerror.
Forwarded - HTTP
header type request header forbidden header name no syntax forwarded: by=<identifier>;for=<identifier>;host=<host>;proto=<http|https> directives <identifier> an identifier disclosing the information that is altered or lost when using a proxy.
From - HTTP
WebHTTPHeadersFrom
header type request header forbidden header name no syntax from: <email> directives <email> a machine-usable email address.
Host - HTTP
WebHTTPHeadersHost
header type request header forbidden header name yes syntax host: <host>:<port> directives <host> the domain name of the server (for virtual hosting).
If-Match - HTTP
WebHTTPHeadersIf-Match
header type request header forbidden header name no syntax if-match: <etag_value> if-match: <etag_value>, <etag_value>, … directives <etag_value> entity tags uniquely representing the requested resources.
If-Modified-Since - HTTP
header type request header forbidden header name no syntax if-modified-since: <day-name>, <day> <month> <year> <hour>:<minute>:<second> gmt directives <day-name> one of "mon", "tue", "wed", "thu", "fri", "sat", or "sun" (case-sensitive).
If-None-Match - HTTP
header type request header forbidden header name no syntax if-none-match: "<etag_value>" if-none-match: "<etag_value>", "<etag_value>", … if-none-match: * directives <etag_value> entity tags uniquely representing the requested resources.
If-Range - HTTP
WebHTTPHeadersIf-Range
header type request header forbidden header name no syntax if-range: <day-name>, <day> <month> <year> <hour>:<minute>:<second> gmt if-range: <etag> directives <etag> an entity tag uniquely representing the requested resource.
If-Unmodified-Since - HTTP
header type request header forbidden header name no syntax if-unmodified-since: <day-name>, <day> <month> <year> <hour>:<minute>:<second> gmt directives <day-name> one of "mon", "tue", "wed", "thu", "fri", "sat", or "sun" (case-sensitive).
Large-Allocation - HTTP
header type response header forbidden header name no syntax large-allocation: 0 large-allocation: <megabytes> directives 0 0 is a special value which represents uncertainty as to what the size of the allocation is.
Last-Modified - HTTP
header type response header forbidden header name no cors-safelisted response header yes syntax last-modified: <day-name>, <day> <month> <year> <hour>:<minute>:<second> gmt directives <day-name> one of "mon", "tue", "wed", "thu", "fri", "sat", or "sun" (case-sensitive).
Location - HTTP
WebHTTPHeadersLocation
header type response header forbidden header name no syntax location: <url> directives <url> a relative (to the request url) or absolute url.
NEL - HTTP
WebHTTPHeadersNEL
header type response header forbidden header name no syntax nel: { "report_to": "name_of_reporting_group", "max_age": 12345, "include_subdomains": false, "success_fraction": 0.0, "failure_fraction": 1.0 } specifications specification network error logging ...
Origin - HTTP
WebHTTPHeadersOrigin
header type request header forbidden header name yes syntax origin: null origin: <scheme> "://" <hostname> [ ":" <port> ] directives <scheme> the protocol that is used.
Pragma - HTTP
WebHTTPHeadersPragma
header type general header, but response behavior is not specified and thus implementation-specific.
Public-Key-Pins-Report-Only - HTTP
header type response header forbidden header name no syntax public-key-pins-report-only: pin-sha256="<pin-value>"; max-age=<expire-time>; includesubdomains; report-uri="<uri>" directives pin-sha256="<pin-value>" the quoted string is the base64 encoded subject public key information (spki) finger...
Public-Key-Pins - HTTP
header type response header forbidden header name no syntax public-key-pins: pin-sha256="<pin-value>"; max-age=<expire-time>; includesubdomains; report-uri="<uri>" directives pin-sha256="<pin-value>" the quoted string is the base64 encoded subject public key information (spki) fingerprint.
Range - HTTP
WebHTTPHeadersRange
header type request header forbidden header name no syntax range: <unit>=<range-start>- range: <unit>=<range-start>-<range-end> range: <unit>=<range-start>-<range-end>, <range-start>-<range-end> range: <unit>=<range-start>-<range-end>, <range-start>-<range-end>, <range-start>-<range-end> range: <unit>=-<suffix-length> directives <unit> the unit in which ranges are specified.
Referer - HTTP
WebHTTPHeadersReferer
header type request header forbidden header name yes syntax referer: <url> directives <url> an absolute or partial address of the previous web page from which a link to the currently requested page was followed.
Referrer-Policy - HTTP
header type response header forbidden header name no syntax the original header name referer is a misspelling of the word "referrer".
Retry-After - HTTP
header type response header forbidden header name no syntax retry-after: <http-date> retry-after: <delay-seconds> directives <http-date> a date after which to retry.
Save-Data - HTTP
with save-data: on request: get /image.jpg http/1.0 host: example.com save-data: on response: http/1.0 200 ok content-length: 102832 vary: accept-encoding, save-data cache-control: public, max-age=31536000 content-type: image/jpeg [...] without save-data request: get /image.jpg http/1.0 host: example.com response: http/1.0 200 ok content-length: 481770 vary: accept-encoding, save-data cache-control: public, max-age=31536000 content-type: image/jpeg [...] specifications specification title draft-grigorik-http-client-hints-03, section 7: save-data http client hints ...
Sec-Fetch-Dest - HTTP
header type fetch metadata request header forbidden header name yes, since it has prefix sec- cors-safelisted request header syntax sec-fetch-dest: audio sec-fetch-dest: audioworklet sec-fetch-dest: document sec-fetch-dest: embed sec-fetch-dest: empty sec-fetch-dest: font sec-fetch-dest: image sec-fetch-dest: manifest sec-fetch-dest: nested-document sec-fetch-dest: object sec-fetch-dest: paintworklet sec-fetch-dest: report sec-fetch-dest: script sec-fetch-dest: serviceworker sec-fetch-dest: sharedworker sec-fetch-dest: style sec-fetch-dest: track sec-fetch-dest: video sec-fetch-dest: worker sec-fetch-dest: xslt sec-fetch-dest:...
Sec-Fetch-Mode - HTTP
header type fetch metadata request header forbidden header name yes, since it has prefix sec- cors-safelisted request header syntax sec-fetch-mode: cors sec-fetch-mode: navigate sec-fetch-mode: nested-navigate sec-fetch-mode: no-cors sec-fetch-mode: same-origin sec-fetch-mode: websocket values cors navigate nested-navigate no-cors same-origin websocket examples todo specifications specification title fetch metadata request headers the sec-fetch-mode http request header ...
Sec-Fetch-Site - HTTP
header type fetch metadata request header forbidden header name yes, since it has prefix sec- cors-safelisted response header cors-safelisted request header syntax sec-fetch-site: cross-site sec-fetch-site: same-origin sec-fetch-site: same-site sec-fetch-site: none values cross-site same-origin same-site none this request does not relate to any context like site, origin, or frame.
Sec-Fetch-User - HTTP
header type fetch metadata request header forbidden header name yes, since it has prefix sec- cors-safelisted request header syntax sec-fetch-user: ?0 sec-fetch-user: ?1 values the value is a boolean structured header.
Sec-WebSocket-Accept - HTTP
header type response header forbidden header name no syntax sec-websocket-accept: <hashed key> directives <hashed key> the server takes the value of the sec-websocket-key sent in the handshake request, appends 258eafa5-e914-47da-95ca-c5ab0dc85b11, takes sha-1 of the new value, and is then base64 encoded.
Server-Timing - HTTP
header type response header forbidden header name no syntax the syntax of the server-timing header allows you to communicate metrics in different ways: server metric name only, metric with value, metric with value and description, and metric with description.
Server - HTTP
WebHTTPHeadersServer
header type response header forbidden header name no syntax server: <product> directives <product> the name of the software or product that handled the request.
Set-Cookie - HTTP
header type response header forbidden header name no forbidden response-header name yes syntax set-cookie: <cookie-name>=<cookie-value> set-cookie: <cookie-name>=<cookie-value>; expires=<date> set-cookie: <cookie-name>=<cookie-value>; max-age=<non-zero-digit> set-cookie: <cookie-name>=<cookie-value>; domain=<domain-value> set-cookie: <cookie-name>=<cookie-value>; path=<path...
Set-Cookie2 - HTTP
header type response header forbidden header name no syntax set-cookie2: <cookie-name>=<cookie-value> set-cookie2: <cookie-name>=<cookie-value>; comment=<value> set-cookie2: <cookie-name>=<cookie-value>; commenturl=<http-url> set-cookie2: <cookie-name>=<cookie-value>; discard set-cookie2: <cookie-name>=<cookie-value>; domain=<domain-value> set-cookie2: <cookie-name>=<cookie-value>; max-age=<non-zero-digit> set-cookie2: <cookie-name>=<cookie-value>; path=<path-value> set-cookie2: <cookie-name>=<cookie-value>; port=<port-number> set-cookie2: <cookie-name>=<cookie-value>; secure set-c...
SourceMap - HTTP
header type response header forbidden header name no syntax sourcemap: <url> x-sourcemap: <url> (deprecated) directives <url> a relative (to the request url) or absolute url pointing to a source map file.
TE - HTTP
WebHTTPHeadersTE
header type request header forbidden header name yes syntax te: compress te: deflate te: gzip te: trailers // multiple directives, weighted with the quality value syntax: te: trailers, deflate;q=0.5 directives compress a format using the lempel-ziv-welch (lzw) algorithm is accepted as a transfer coding name.
Timing-Allow-Origin - HTTP
header type response header forbidden header name no syntax timing-allow-origin: * timing-allow-origin: <origin>[, <origin>]* directives * the server may specify "*" as a wildcard, thereby allowing any origin to see timing resources.
Tk - HTTP
WebHTTPHeadersTk
header type response header forbidden header name no syntax tk: !
Upgrade-Insecure-Requests - HTTP
header type request header forbidden header name no syntax upgrade-insecure-requests: 1 examples a client's request signals to the server that it supports the upgrade mechanisms of upgrade-insecure-requests: get / http/1.1 host: example.com upgrade-insecure-requests: 1 the server can now redirect to a secure version of the site.
User-Agent - HTTP
header type request header forbidden header name no syntax user-agent: <product> / <product-version> <comment> common format for web browsers: user-agent: mozilla/5.0 (<system-information>) <platform> (<platform-details>) <extensions> directives <product> a product identifier — its name or development codename.
Vary - HTTP
WebHTTPHeadersVary
header type response header forbidden header name no syntax vary: * vary: <header-name>, <header-name>, ...
Via - HTTP
WebHTTPHeadersVia
header type general header forbidden header name yes syntax via: [ <protocol-name> "/" ] <protocol-version> <host> [ ":" <port> ] or via: [ <protocol-name> "/" ] <protocol-version> <pseudonym> directives <protocol-name> optional.
Want-Digest - HTTP
header type general header forbidden header name no syntax want-digest: <digest-algorithm> // multiple algorithms, weighted with the quality value syntax: want-digest: <digest-algorithm><q-value>,<digest-algorithm><q-value> directives <digest-algorithm> supported digest algorithms are defined in rfc 3230 and rfc 5843, and include sha-256 and sha-512.
X-Forwarded-For - HTTP
header type request header forbidden header name no syntax x-forwarded-for: <client>, <proxy1>, <proxy2> directives <client> the client ip address <proxy1>, <proxy2> if a request goes through multiple proxies, the ip addresses of each successive proxy is listed.
X-Forwarded-Host - HTTP
header type request header forbidden header name no syntax x-forwarded-host: <host> directives <host> the domain name of the forwarded server.
X-Forwarded-Proto - HTTP
header type request header forbidden header name no syntax x-forwarded-proto: <protocol> directives <protocol> the forwarded protocol (http or https).
X-Frame-Options - HTTP
header type response header forbidden header name no syntax there are two possible directives for x-frame-options: x-frame-options: deny x-frame-options: sameorigin directives if you specify deny, not only will attempts to load the page in a frame fail when loaded from other sites, attempts to do so will fail when loaded from the same site.
X-XSS-Protection - HTTP
header type response header forbidden header name no syntax x-xss-protection: 0 x-xss-protection: 1 x-xss-protection: 1; mode=block x-xss-protection: 1; report=<reporting-uri> 0 disables xss filtering.
PATCH - HTTP
WebHTTPMethodsPATCH
request has body yes successful response has body yes safe no idempotent no cacheable no allowed in html forms no syntax patch /file.txt http/1.1 example request patch /file.txt http/1.1 host: www.example.com content-type: application/example if-match: "e0023aa4e" content-length: 100 [description of changes] response a successful response is indicated by any 2xx status code.
PUT - HTTP
WebHTTPMethodsPUT
request has body yes successful response has body no safe no idempotent yes cacheable no allowed in html forms no syntax put /new.html http/1.1 example request put /new.html http/1.1 host: example.com content-type: text/html content-length: 16 <p>new file</p> responses if the target resource does not have a current representation and the put request successfully creates one, then the origin server must inform the user agent by sending a 201 (created) response.
TRACE - HTTP
WebHTTPMethodsTRACE
the final recipient of the request should reflect the message received, excluding some fields described below, back to the client as the message body of a 200 (ok) response with a content-type of message/http.
Proxy Auto-Configuration (PAC) file - HTTP
the auto-config file should be saved to a file with a .pac filename extension: proxy.pac and the mime type should be set to: application/x-ns-proxy-autoconfig next, you should configure your server to map the .pac filename extension to the mime type.
301 Moved Permanently - HTTP
WebHTTPStatus301
even if the specification requires the method (and the body) not to be altered when the redirection is performed, not all user-agents align with it - you can still find this type of bugged software out there.
302 Found - HTTP
WebHTTPStatus302
even if the specification requires the method (and the body) not to be altered when the redirection is performed, not all user-agents conform here - you can still find this type of bugged software out there.
422 Unprocessable Entity - HTTP
WebHTTPStatus422
the hypertext transfer protocol (http) 422 unprocessable entity response status code indicates that the server understands the content type of the request entity, and the syntax of the request entity is correct, but it was unable to process the contained instructions.
426 Upgrade Required - HTTP
WebHTTPStatus426
status 426 upgrade required examples http/1.1 426 upgrade required upgrade: http/2.0 connection: upgrade content-length: 53 content-type: text/plain this service requires use of the http/2.0 protocol specifications specification title rfc 7231, section 6.5.15: 426 upgrade required hypertext transfer protocol (http/1.1): semantics and content ...
429 Too Many Requests - HTTP
WebHTTPStatus429
status 429 too many requests example http/1.1 429 too many requests content-type: text/html retry-after: 3600 specifications specification title rfc 6585, section 4: 429 too many requests additional http status codes ...
451 Unavailable For Legal Reasons - HTTP
WebHTTPStatus451
http/1.1 451 unavailable for legal reasons link: <https://spqr.example.org/legislatione>; rel="blocked-by" content-type: text/html <html> <head><title>unavailable for legal reasons</title></head> <body> <h1>unavailable for legal reasons</h1> <p>this request may not be serviced in the roman province of judea due to the lex julia majestatis, which disallows access to resources hosted on servers deemed to be operated by the people's front of jud...
HTTP response status codes - HTTP
WebHTTPStatus
415 unsupported media type the media format of the requested data is not supported by the server, so the server is rejecting the request.
HTTP
WebHTTP
http messages describes the type and structure of the different kind of messages of http/1.x and http/2.
Character classes - JavaScript
types the following table is also duplicated on this cheatsheet.
Groups and ranges - JavaScript
types the following section is also duplicated on this cheatsheet.
Quantifiers - JavaScript
types the following table is also duplicated on this cheatsheet.
Using Promises - JavaScript
in both cases, the event (of type promiserejectionevent) has as members a promise property indicating the promise that was rejected, and a reason property that provides the reason given for the promise to be rejected.
Memory Management - JavaScript
for instance, a javascript object has a reference to its prototype (implicit reference) and to its properties values (explicit reference).
About the JavaScript reference - JavaScript
more reference pages deprecated and obsolete features lexical grammar data types and data structures ...
extends - JavaScript
the .prototype of the extension must be an object or null.
Warning: -file- is being assigned a //# sourceMappingURL, but already has one - JavaScript
error type a warning.
Warning: 08/09 is not a legal ECMA-262 octal constant - JavaScript
error type warning.
SyntaxError: invalid regular expression flag "x" - JavaScript
message syntaxerror: syntax error in regular expression (edge) syntaxerror: invalid regular expression flag "x" (firefox) syntaxerror: invalid regular expression flags (chrome) error type syntaxerror what went wrong?
SyntaxError: return not in function - JavaScript
message syntaxerror: 'return' statement outside of function (edge) syntaxerror: return not in function (firefox) syntaxerror: yield not in function (firefox) error type syntaxerror.
ReferenceError: can't access lexical declaration`X' before initialization - JavaScript
message referenceerror: use before delaration (edge) referenceerror: can't access lexical declaration `x' before initialization (firefox) referenceerror: 'x' is not defined (chrome) error type referenceerror what went wrong?
SyntaxError: applying the 'delete' operator to an unqualified name is deprecated - JavaScript
(chrome) error type syntaxerror in strict mode only.
Warning: expression closures are deprecated - JavaScript
message warning: expression closures are deprecated error type warning.
SyntaxError: "0"-prefixed octal literals and octal escape seq. are deprecated - JavaScript
message syntaxerror: octal numeric literals and escape characters not allowed in strict mode (edge) syntaxerror: "0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead error type syntaxerror in strict mode only.
SyntaxError: Using //@ to indicate sourceURL pragmas is deprecated. Use //# instead - JavaScript
use //# instead error type a warning that a syntaxerror occurred.
Warning: JavaScript 1.6's for-each-in loops are deprecated - JavaScript
message warning: javascript 1.6's for-each-in loops are deprecated; consider using es6 for-of instead error type warning what went wrong?
SyntaxError: identifier starts immediately after numeric literal - JavaScript
message syntaxerror: unexpected identifier after numeric literal (edge) syntaxerror: identifier starts immediately after numeric literal (firefox) syntaxerror: unexpected number (chrome) error type syntaxerror what went wrong?
RangeError: invalid array length - JavaScript
message rangeerror: array length must be a finite positive integer (edge) rangeerror: invalid array length (firefox) rangeerror: invalid array length (chrome) rangeerror: invalid array buffer length (chrome) error type rangeerror what went wrong?
ReferenceError: invalid assignment left-hand side - JavaScript
message referenceerror: invalid assignment left-hand side error type referenceerror.
RangeError: invalid date - JavaScript
message rangeerror: invalid date (edge) rangeerror: invalid date (firefox) rangeerror: invalid time value (chrome) rangeerror: provided date is not in valid range (chrome) error type rangeerror what went wrong?
SyntaxError: for-in loop head declarations may not have initializers - JavaScript
(chrome) error type syntaxerror in strict mode only.
SyntaxError: a declaration in the head of a for-of loop can't have an initializer - JavaScript
(chrome) error type syntaxerror what went wrong?
SyntaxError: JSON.parse: bad parsing - JavaScript
n.parse: expected ',' or '}' after property-value pair in object literal syntaxerror: json.parse: property names must be double-quoted strings syntaxerror: json.parse: expected property name or '}' syntaxerror: json.parse: unexpected character syntaxerror: json.parse: unexpected non-whitespace character after json data syntaxerror: json.parse error: invalid character at position {0} (edge) error type syntaxerror what went wrong?
URIError: malformed URI sequence - JavaScript
message urierror: the uri to be encoded contains invalid character (edge) urierror: malformed uri sequence (firefox) urierror: uri malformed (chrome) error type urierror what went wrong?
SyntaxError: Malformed formal parameter - JavaScript
message syntaxerror: expected {x} (edge) syntaxerror: malformed formal parameter (firefox) error type syntaxerror what went wrong?
SyntaxError: missing ] after element list - JavaScript
message syntaxerror: missing ] after element list error type syntaxerror.
SyntaxError: missing : after property id - JavaScript
message syntaxerror: expected ':' (edge) syntaxerror: missing : after property id (firefox) error type syntaxerror what went wrong?
SyntaxError: missing } after function body - JavaScript
message syntaxerror: expected '}' (edge) syntaxerror: missing } after function body (firefox) error type syntaxerror what went wrong?
SyntaxError: missing } after property list - JavaScript
message syntaxerror: expected '}' (edge) syntaxerror: missing } after property list (firefox) error type syntaxerror what went wrong?
SyntaxError: missing formal parameter - JavaScript
message syntaxerror: missing formal parameter (firefox) error type syntaxerror what went wrong?
SyntaxError: missing = in const declaration - JavaScript
message syntaxerror: const must be initalized (edge) syntaxerror: missing = in const declaration (firefox) syntaxerror: missing initializer in const declaration (chrome) error type syntaxerror what went wrong?
SyntaxError: missing name after . operator - JavaScript
operator error type syntaxerror what went wrong?
SyntaxError: missing ) after argument list - JavaScript
message syntaxerror: expected ')' (edge) syntaxerror: missing ) after argument list (firefox) error type syntaxerror.
SyntaxError: missing ) after condition - JavaScript
message syntaxerror: expected ')' (edge) syntaxerror: missing ) after condition (firefox) error type syntaxerror what went wrong?
SyntaxError: missing ; before statement - JavaScript
message syntaxerror: expected ';' (edge) syntaxerror: missing ; before statement (firefox) error type syntaxerror.
SyntaxError: missing variable name - JavaScript
message syntaxerror: missing variable name (firefox) syntaxerror: unexpected token = (chrome) error type syntaxerror what went wrong?
RangeError: argument is not a valid code point - JavaScript
message rangeerror: {0} is not a valid code point (firefox) rangeerror: invalid code point {0} (chromium) error type rangeerror what went wrong?
SyntaxError: redeclaration of formal parameter "x" - JavaScript
message syntaxerror: let/const redeclaration (edge) syntaxerror: redeclaration of formal parameter "x" (firefox) syntaxerror: identifier "x" has already been declared (chrome) error type syntaxerror what went wrong?
SyntaxError: "x" is a reserved identifier - JavaScript
message syntaxerror: the use of a future reserved word for an identifier is invalid (edge) syntaxerror: "x" is a reserved identifier (firefox) syntaxerror: unexpected reserved word (chrome) error type syntaxerror what went wrong?
Warning: unreachable code after return statement - JavaScript
message warning: unreachable code after return statement (firefox) error type warning what went wrong?
SyntaxError: "use strict" not allowed in function with non-simple parameters - JavaScript
t apply strict mode on functions with non-simple parameter list firefox: syntaxerror: "use strict" not allowed in function with default parameter syntaxerror: "use strict" not allowed in function with rest parameter syntaxerror: "use strict" not allowed in function with destructuring parameter chrome: syntaxerror: illegal 'use strict' directive in function with non-simple parameter list error type syntaxerror.
InternalError: too much recursion - JavaScript
message error: out of stack space (edge) internalerror: too much recursion (firefox) rangeerror: maximum call stack size exceeded (chrome) error type internalerror.
ReferenceError: assignment to undeclared variable "x" - JavaScript
message referenceerror: assignment to undeclared variable "x" (firefox) referenceerror: "x" is not defined (chrome) referenceerror: variable undefined in strict mode (edge) error type referenceerror warning in strict mode only.
SyntaxError: Unexpected token - JavaScript
message syntaxerror: expected expression, got "x" syntaxerror: expected property name, got "x" syntaxerror: expected target, got "x" syntaxerror: expected rest argument name, got "x" syntaxerror: expected closing parenthesis, got "x" syntaxerror: expected '=>' after argument list, got "x" error type syntaxerror what went wrong?
SyntaxError: function statement requires a name - JavaScript
message syntax error: expected identifier (edge) syntaxerror: function statement requires a name [firefox] syntaxerror: unexpected token ( [chrome] error type syntaxerror what went wrong?
SyntaxError: unterminated string literal - JavaScript
message syntaxerror: unterminated string constant (edge) syntaxerror: unterminated string literal (firefox) error type syntaxerror what went wrong?
arguments[@@iterator]() - JavaScript
the initial value of the @@iterator property is the same function object as the initial value of the array.prototype.values property.
setter - JavaScript
setters are most often used in conjunction with getters to create a type of pseudo-property.
ArrayBuffer.isView() - JavaScript
the arraybuffer.isview() method determines whether the passed value is one of the arraybuffer views, such as typed array objects or a dataview.
Atomics.isLockFree() - JavaScript
it returns true, if the given size is one of the bytes_per_element property of integer typedarray types.
BigInt() constructor - JavaScript
the bigint() constructor returns a value of type bigint.
Function.length - JavaScript
property of the function prototype object the length property of the function prototype object has a value of 0.
Intl.DisplayNames() constructor - JavaScript
"narrow" "short" "long" type the type to use, the default is "language".
Intl.PluralRules.select() - JavaScript
the intl.pluralrules.prototype.select method returns a string indicating which plural rule to use for locale-aware formatting.
Math.fround() - JavaScript
if the parameter is of a different type, it will get converted to a number or to nan if it cannot be converted.
Math.imul() - JavaScript
b >>> 16) & 0xffff; var blo = b & 0xffff; // the shift by 0 fixes the sign on the high part // the final |0 converts the unsigned value into a signed value return ((alo * blo) + (((ahi * blo + alo * bhi) << 16) >>> 0) | 0); }; however, the following function is more performant because it is likely that browsers in which this polyfill would be used do not optimize with an internal integer type in javascript, instead using floating points for all numbers.
Math.max() - JavaScript
examples using math.max() math.max(10, 20); // 20 math.max(-10, -20); // -10 math.max(-10, 20); // 20 getting the maximum element of an array array.reduce() can be used to find the maximum element in a numeric array, by comparing each value: var arr = [1,2,3]; var max = arr.reduce(function(a, b) { return math.max(a, b); }); the following function uses function.prototype.apply() to get the maximum of an array.
Math.sign() - JavaScript
-1 : 0 ) // if x is negative, then negative one // || // if x is 0, -0, or nan, or not a number, // +x // then the result will be x, (or) if x is // // not a number, then x converts to number }; } in the above polyfill, no extra type-coercing is needed to make (x > 0) or (x < 0) numbers because subtracting them from each other forces a type conversion from booleans to numbers.
Math.trunc() - JavaScript
the argument passed to this method will be converted to number type implicitly.
Math - JavaScript
math works with the number type.
NaN - JavaScript
there are five different types of operations that return nan: number cannot be parsed (e.g.
Number.isInteger() - JavaScript
polyfill number.isinteger = number.isinteger || function(value) { return typeof value === 'number' && isfinite(value) && math.floor(value) === value; }; examples using isinteger number.isinteger(0); // true number.isinteger(1); // true number.isinteger(-100000); // true number.isinteger(99999999999999999999999); // true number.isinteger(0.1); // false number.isinteger(math.pi); // false number.isinteger(nan); // false number.is...
Number.isSafeInteger() - JavaScript
for larger integers, consider using the bigint type.
Object.is() - JavaScript
the == operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as "" == false being true), but object.is doesn't coerce either value.
Object.values() - JavaScript
(the only difference is that a for...in loop enumerates properties in the prototype chain as well.) the source for this interactive example is stored in a github repository.
Promise() constructor - JavaScript
the signatures of these two functions are simple, they accept a single parameter of any type.
Promise.resolve() - JavaScript
ng a thenable object var p1 = promise.resolve({ then: function(onfulfill, onreject) { onfulfill('fulfilled!'); } }); console.log(p1 instanceof promise) // true, object casted to a promise p1.then(function(v) { console.log(v); // "fulfilled!" }, function(e) { // not called }); // thenable throws before callback // promise rejects var thenable = { then: function(resolve) { throw new typeerror('throwing'); resolve('resolving'); }}; var p2 = promise.resolve(thenable); p2.then(function(v) { // not called }, function(e) { console.error(e); // typeerror: throwing }); // thenable throws after callback // promise resolves var thenable = { then: function(resolve) { resolve('resolving'); throw new typeerror('throwing'); }}; var p3 = promise.resolve(thenable); p3.then(function...
handler.apply() - JavaScript
interceptions this trap can intercept these operations: proxy(...args) function.prototype.apply() and function.prototype.call() reflect.apply() invariants if the following invariants are violated, the proxy will throw a typeerror.
handler.deleteProperty() - JavaScript
interceptions this trap can intercept these operations: property deletion: delete proxy[foo] and delete proxy.foo reflect.deleteproperty() invariants if the following invariants are violated, the proxy will throw a typeerror: a property cannot be deleted, if it exists as a non-configurable own property of the target object.
Reflect.deleteProperty() - JavaScript
exceptions a typeerror, if target is not an object.
Reflect.get() - JavaScript
exceptions a typeerror, if target is not an object.
Reflect.ownKeys() - JavaScript
exceptions a typeerror, if target is not an object.
Reflect.set() - JavaScript
exceptions a typeerror, if target is not an object.
Set() constructor - JavaScript
the set constructor lets you create set objects that store unique values of any type, whether primitive values or object references.
String length - JavaScript
if you want to get the number of characters you need something like this: function getcharacterlength (str) { // the string iterator that is used here iterates over characters, // not mere code units return [...str].length; } console.log(getcharacterlength('a\ud87e\udc04z')); // 3 // while not recommended, you could add this to each string as follows: object.defineproperty(string.prototype, 'charlength', { get () { return getcharacterlength(this); } }); console.log('a\ud87e\udc04z'.charlength); // 3 examples basic usage let x = 'mozilla'; let empty = ''; console.log(x + ' is ' + x.length + ' code units long'); /* "mozilla is 7 code units long" */ console.log('the empty string has a length of ' + empty.length); // expected output: "the empty string has a length of 0" ...
String.raw() - JavaScript
exceptions typeerror a typeerror is thrown if the first argument is not a well-formed object.
Symbol.toPrimitive - JavaScript
the function is called with a string argument hint, which specifies the preferred type of the result primitive value.
WeakRef - JavaScript
instance methods weakref.prototype.deref() returns the weakref object's target object, or undefined if the target object has been reclaimed.
WebAssembly.Instance - JavaScript
instance properties instance.prototype.exports returns an object containing as its members all the functions exported from the webassembly module instance, to allow them to be accessed and used by javascript.
WebAssembly.Memory() constructor - JavaScript
exceptions if memorydescriptor is not of type object, a typeerror is thrown.
WebAssembly.Module() constructor - JavaScript
new webassembly.module(buffersource); parameters buffersource a typed array or arraybuffer containing the binary code of the .wasm module you want to compile.
WebAssembly.Module.customSections() - JavaScript
exceptions if module is not a webassembly.module object instance, a typeerror is thrown.
WebAssembly.Module.exports() - JavaScript
exceptions if module is not a webassembly.module object instance, a typeerror is thrown.
WebAssembly.Module.imports() - JavaScript
exceptions if module is not a webassembly.module object instance, a typeerror is thrown.
WebAssembly.RuntimeError() constructor - JavaScript
the webassembly.runtimeerror() constructor creates a new webassembly runtimeerror object — the type that is thrown whenever webassembly specifies a trap.
WebAssembly.compileStreaming() - JavaScript
exceptions if buffersource is not a typed array, a typeerror is thrown.
eval() - JavaScript
additonally, new things can be introduced to that variable through eval() such as changing the type of that variable, forcing the browser to re-evaluate all of the generated machine code to compensate.
Addition assignment (+=) - JavaScript
the types of the two operands determine the behavior of the addition assignment operator.
Exponentiation (**) - JavaScript
that is, you cannot put a unary operator (+/-/~/!/delete/void/typeof) immediately before the base number; doing so will cause a syntaxerror.
Less than (<) - JavaScript
otherwise javascript attempts to convert non-numeric types to numeric values: boolean values true and false are converted to 1 and 0 respectively.
yield - JavaScript
between the generator's code path, its yield operators, and the ability to specify a new starting value by passing it to generator.prototype.next(), generators offer enormous power and control.
class - JavaScript
the class declaration creates a new class with a given name using prototype-based inheritance.
for await...of - JavaScript
the for await...of statement creates a loop iterating over async iterable objects as well as on sync iterables, including: built-in string, array, array-like objects (e.g., arguments or nodelist), typedarray, map, set, and user-defined async/sync iterables.
function* - JavaScript
/ { value: undefined, done: true } generator as a computed property class foo { *[symbol.iterator] () { yield 1; yield 2; } } const someobj = { *[symbol.iterator] () { yield 'a'; yield 'b'; } } console.log(array.from(new foo)); // [ 1, 2 ] console.log(array.from(someobj)); // [ 'a', 'b' ] generators are not constructable function* f() {} var obj = new f; // throws "typeerror: f is not a constructor generator defined in an expression const foo = function* () { yield 10; yield 20; }; const bar = foo(); console.log(bar.next()); // {value: 10, done: false} generator example function* powers(n){ //endless loop to generate for(let current =n;; current *= n){ yield current; } } for(let power of powers(2)){ //controlling generator...
try...catch - JavaScript
conditional catch-blocks you can create "conditional catch-blocks" by combining try...catch blocks with if...else if...else structures, like this: try { myroutine(); // may throw three types of exceptions } catch (e) { if (e instanceof typeerror) { // statements to handle typeerror exceptions } else if (e instanceof rangeerror) { // statements to handle rangeerror exceptions } else if (e instanceof evalerror) { // statements to handle evalerror exceptions } else { // statements to handle any unspecified exceptions logmyerrors(e); // pass exception object ...
Trailing commas - JavaScript
when iterating arrays for example with array.prototype.foreach() or array.prototype.map(), array holes are skipped.
background_color - Web app manifests
type string mandatory no the background_color member defines a placeholder background color for the application page to display before its stylesheet is loaded.
categories - Web app manifests
type array of strings mandatory no the categories member is an array of strings defining the names of categories that the application supposedly belongs to.
description - Web app manifests
type string mandatory no the description member is a string in which developers can explain what the application does.
dir - Web app manifests
WebManifestdir
type string mandatory no the base direction in which to display direction-capable members of the manifest.
display - Web app manifests
type string mandatory no the display member is a string that determines the developers’ preferred display mode for the website.
iarc_rating_id - Web app manifests
type string mandatory no the iarc_rating_id member is a string that represents the international age rating coalition (iarc) certification code of the web application.
lang - Web app manifests
WebManifestlang
type string mandatory no the lang member is a string containing a single language tag.
name - Web app manifests
WebManifestname
type string mandatory yes the name member is a string that represents the name of the web application as it is usually displayed to the user (e.g., amongst a list of other applications, or as a label for an icon).
orientation - Web app manifests
type string mandatory no the orientation member defines the default orientation for all the website's top-level browsing contexts.
prefer_related_applications - Web app manifests
type boolean mandatory no the prefer_related_applications member is a boolean value that specifies that applications listed in related_applications should be preferred over the web application.
related_applications - Web app manifests
type array mandatory no the related_applications field is an array of objects specifying native applications that are installable by, or accessible to, the underlying platform — for example, a native android application obtainable through the google play store.
scope - Web app manifests
type string mandatory no the scope member is a string that defines the navigation scope of this web application's application context.
short_name - Web app manifests
type string mandatory no the short_name member is a string that represents the name of the web application displayed to the user if there is not enough space to display name (e.g., as a label for an icon on the phone home screen).
shortcuts - Web app manifests
type object mandatory no the shortcuts member defines an array of shortcuts or links to key tasks or pages within a web app.
start_url - Web app manifests
type string mandatory no the start_url member is a string that represents the start url of the web application — the prefered url that should be loaded when the user launches the web application (e.g., when the user taps on the web application's icon from a device's application menu or homescreen).
theme_color - Web app manifests
type string mandatory no the theme_color member is a string that defines the default theme color for the application.
<mstyle> - MathML
WebMathMLElementmstyle
actiontype on <maction> cannot be set on <mstyle>.
<semantics> - MathML
example <math> <semantics> <!-- presentation mathml --> <mrow> <msup> <mi>x</mi> <mn>2</mn> </msup> <mo>+</mo> <mi>y</mi> </mrow> <!-- content mathml --> <annotation-xml encoding="mathml-content"> <apply> <plus/> <apply> <power/> <ci>x</ci> <cn type="integer">2</cn> </apply> <ci>y</ci> </apply> </annotation-xml> <!-- annotate an image --> <annotation encoding="image/png" src="some/path/formula.png"/> <!-- annotate tex --> <annotation encoding="application/x-tex"> x^{2} + y </annotation> </semantics> </math> specifications specification status comment mathm...
MathML documentation index - MathML
WebMathMLIndex
10 <maction> mathml, mathml reference, mathml:element, mathml:enlivening expressions the following example uses the "toggle" actiontype: 11 <math> mathml, mathml reference, mathml:element the top-level element in mathml is <math>.
Mapping the width and height attributes of media container elements to their aspect-ratio - Web media technologies
this appears in the browser's internal ua stylesheet, similar to the following: img, input[type="image"], video, embed, iframe, marquee, object, table { aspect-ratio: attr(width) / attr(height); } this actually affects any element that acts as a container for complex or mixed visual media — <embed>, <iframe>, <marquee>, <object>, <table>, and <video>, in addition to actual images (<img> and <input type="image">).
Performance fundamentals - Web Performance
javascript is a dynamically-typed language, and the web platform allows loading code, html, css, images, and other resources dynamically.
Populating the page: how browsers work - Web Performance
<!doctype html> <html> <head> <meta charset="utf-8"/> <title>my simple page</title> <link rel="stylesheet" src="styles.css"/> <script src="myscript.js"></script> </head> <body> <h1 class="heading">my page</h1> <p>a paragraph with a <a href="https://example.com/about">link</a></p> <div> <img src="myimage.jpg" alt="image description"/> </div> <script src="anotherscript.js"></script> </...
Performance budgets - Web Performance
it can apply to a file, a file type, all files loaded on a page, a specific metric (e.g.
Understanding latency - Web Performance
different browser developer tools have different preset options, the characteristics emulated include download speed, upload speed, and minimum latency, or the minimum amount of type it takes to send a packet of data.
Progressive web app structure - Progressive web apps (PWAs)
the folder structure looks like this: the html from the html point of view, the app shell is everything outside the content section: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>js13kgames a-frame entries</title> <meta name="description" content="a list of a-frame entries submitted to the js13kgames 2017 competition, used as an example for the mdn articles about progressive web apps."> <meta name="author" content="end3r"> <meta name="theme-color" content="#b12a34"> <meta name="viewport" content="width=devi...
Progressive loading - Progressive web apps (PWAs)
we can also split css files and add media types to them: <link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="print.css" media="print"> this will tell the browser to load them only when the condition is met.
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
after that, both arrays are merged using the array.prototype.concat() function.
Graphic design for responsive sites - Progressive web apps (PWAs)
javascript javascript has functions that enable developers to create animations, and any other type of interactivity you want.
Mobile first - Progressive web apps (PWAs)
i put modernizr inside my js/lib directory, then included it by putting the following construct inside my html file: <script type="text/javascript" src="js/lib/modernizr.js"></script> with modernizr in place, we can now use the following js block to test whether media queries are supported, and if not, to load in respond.js, scott jehl's matchmedia and media query polyfill.
Structural overview of progressive web apps - Progressive web apps (PWAs)
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>js13kgames a-frame entries</title> <meta name="description" content="a list of a-frame entries submitted to the js13kgames 2017 competition, used as an example for the mdn articles about progressive web apps."> <meta name="author" content="end3r"> <meta name="theme-color" content="#b12a34"> <meta name="viewport" content="width=devi...
amplitude - SVG: Scalable Vector Graphics
the amplitude attribute controls the amplitude of the gamma function of a component transfer element when its type attribute is gamma.
attributeName - SVG: Scalable Vector Graphics
four elements are using this attribute: <animate>, <animatecolor>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 250 250" xmlns="http://www.w3.org/2000/svg"> <rect x="50" y="50" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="5s" repeatcount="indefinite"/> </rect> </svg> usage notes value <name> default value none animatable no <name> this value indicates the name of the css property or attribute of the target element to be animated.
baseFrequency - SVG: Scalable Vector Graphics
example <svg width="200" height="200" viewbox="0 0 220 220" xmlns="http://www.w3.org/2000/svg"> <filter id="displacementfilter"> <feturbulence type="turbulence" basefrequency="0.05" numoctaves="2" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50" xchannelselector="r" ychannelselector="g"/> </filter> <circle cx="100" cy="100" r="100" style="filter: url(#displacementfilter)"/> </svg> specifications specification status comment filter effects mo...
by - SVG: Scalable Vector Graphics
WebSVGAttributeby
nimatemotion>, and <animatetransform> html, body, svg { height: 100%; } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" width="100" height="100"> <animate attributename="width" fill="freeze" by="50" dur="3s"/> </rect> </svg> usage notes value see below default value none animatable no the exact value type for this attribute depends on the value of the attribute that will be animated.
color-interpolation - SVG: Scalable Vector Graphics
when a child element is blended into a background, the value of the color-interpolation property on the child determines the type of blending, not the value of the color-interpolation on the parent.
d - SVG: Scalable Vector Graphics
WebSVGAttributed
svg defines 6 types of path commands, for a total of 20 commands: moveto: m, m lineto: l, l, h, h, v, v cubic bézier curve: c, c, s, s quadratic bézier curve: q, q, t, t elliptical arc curve: a, a closepath: z, z note: commands are case-sensitive.
dur - SVG: Scalable Vector Graphics
WebSVGAttributedur
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 220 150" xmlns="http://www.w3.org/2000/svg"> <rect x="0" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatcount="indefinite"/> </rect> <rect x="120" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="3s" repeatcount="indefinite"/> </rect> </svg> usage notes value <clock-value> | media | indefinite default value indefinite animatable no <clock-value> this value specif...
externalResourcesRequired - SVG: Scalable Vector Graphics
this attribute applies to all types of resource references, including style sheets, color profiles and fonts specified by a reference using a <font-face> element or a css @font-face specification.
fill - SVG: Scalable Vector Graphics
WebSVGAttributefill
--> <circle cx="250" cy="50" r="20"> <animate attributetype="xml" attributename="r" from="0" to="40" dur="5s" fill="freeze" /> </circle> </svg> altglyph warning: as of svg2 <altglyph> is deprecated and shouldn't be used.
font-variant - SVG: Scalable Vector Graphics
candidate recommendation added many more keywords for different types of variations.
format - SVG: Scalable Vector Graphics
WebSVGAttributeformat
here is a list of font formats and their strings that can be used as values for this attribute: format string format truedoc-pfr truedoc™ portable font resource embedded-opentype embedded opentype type-1 postscript™ type 1 truetype truetype opentype opentype, including truetype open truetype-gx truetype with gx extensions speedo speedo intellifont intellifont specifications specification status comment scalable vector graphics (sv...
from - SVG: Scalable Vector Graphics
WebSVGAttributefrom
nimatemotion>, and <animatetransform> html, body, svg { height: 100%; } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" height="100"> <animate attributename="width" fill="freeze" from="100" to="150" dur="3s"/> </rect> </svg> usage notes value see below default value none animatable no the exact value type for this attribute depends on the value of the attribute that will be animated.
href - SVG: Scalable Vector Graphics
WebSVGAttributehref
refer to the descriptions of the individual animation elements for any restrictions on what types of elements can be targets of particular types of animations.
id - SVG: Scalable Vector Graphics
WebSVGAttributeid
<svg width="120" height="120" viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <style type="text/css"> <![cdata[ #smallrect { stroke: #000066; fill: #00cc00; } ]]> </style> <rect id="smallrect" x="10" y="10" width="100" height="100" /> </svg> usage notes value <id> default value none animatable no <id> specifies the element's id.
media - SVG: Scalable Vector Graphics
WebSVGAttributemedia
candidate recommendation changed the value definition from different media types as defined in css 2 to <media-query-list>.
rendering-intent - SVG: Scalable Vector Graphics
only one element is using this attribute: <color-profile> usage notes value auto | perceptual | relative-colorimetric | saturation | absolute-colorimetric default value auto animatable yes auto this value allows the user agent to determine the best intent based on the content type.
repeatCount - SVG: Scalable Vector Graphics
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 220 150" xmlns="http://www.w3.org/2000/svg"> <rect x="0" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatcount="5"/> </rect> <rect x="120" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatcount="indefinite"/> </rect> </svg> usage notes value <number> | indefinite default value none animatable no <number> this value specifies the numb...
repeatDur - SVG: Scalable Vector Graphics
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 220 150" xmlns="http://www.w3.org/2000/svg"> <rect x="0" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatdur="5s"/> </rect> <rect x="120" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatdur="indefinite"/> </rect> </svg> usage notes value <clock-value> | indefinite default values none animatable no <clock-value> this value specifies the...
requiredFeatures - SVG: Scalable Vector Graphics
p://www.w3.org/tr/svg11/feature#animationeventsattribute the browser supports the onbegin, onend, onrepeat and onload attributes http://www.w3.org/tr/svg11/feature#cursor the browser supports the <cursor> element http://www.w3.org/tr/svg11/feature#hyperlinking the browser supports the <a> element http://www.w3.org/tr/svg11/feature#xlinkattribute the browser supports the xlink:type, xlink:href, xlink:role, xlink:arcrole, xlink:title, xlink:show and xlink:actuate attributes http://www.w3.org/tr/svg11/feature#externalresourcesrequired the browser supports the externalresourcesrequired attribute http://www.w3.org/tr/svg11/feature#view the browser supports the <view> element http://www.w3.org/tr/svg11/feature#script the browser supports the <script> element ...
restart - SVG: Scalable Vector Graphics
WebSVGAttributerestart
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } a { fill: blue; text-decoration: underline; cursor: pointer; } <svg viewbox="0 0 220 200" xmlns="http://www.w3.org/2000/svg"> <rect y="30" width="100" height="100"> <animate attributetype="xml" attributename="y" from="30" to="100" dur="5s" repeatcount="1" restart="always" /> </rect> <rect x="120" y="30" width="100" height="100"> <animate attributetype="xml" attributename="y" from="30" to="100" dur="5s" repeatcount="1" restart="whennotactive"/> </rect> <a id="restart"><text y="20">restart animation</text></a> </svg> document.getelementbyid("restart").ad...
result - SVG: Scalable Vector Graphics
WebSVGAttributeresult
componenttransfer>, <fecomposite>, <feconvolvematrix>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <feflood>, <fegaussianblur>, <feimage>, <femerge>, <femorphology>, <feoffset>, <fespecularlighting>, <fetile>, and <feturbulence> html, body, svg { height: 100%; } <svg viewbox="0 0 220 220" xmlns="http://www.w3.org/2000/svg"> <filter id="displacementfilter"> <feturbulence type="turbulence" basefrequency="0.05" numoctaves="2" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50" xchannelselector="r" ychannelselector="g"/> </filter> <circle cx="100" cy="100" r="100" style="filter: url(#displacementfilter)"/> </svg> usage notes value <filter-primitive-reference> default value non...
scale - SVG: Scalable Vector Graphics
WebSVGAttributescale
only one element is using this attribute: <fedisplacementmap> html, body, svg { height: 100%; } <svg viewbox="0 0 480 220" xmlns="http://www.w3.org/2000/svg"> <filter id="displacementfilter" x="-20%" y="-20%" width="140%" height="140%"> <feturbulence type="turbulence" basefrequency="0.05" numoctaves="2" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="5"/> </filter> <filter id="displacementfilter2" x="-20%" y="-20%" width="140%" height="140%"> <feturbulence type="turbulence" basefrequency="0.05" numoctaves="2" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50"/...
string - SVG: Scalable Vector Graphics
WebSVGAttributestring
the available types are: "woff", "woff2", "truetype", "opentype", "embedded-opentype", and "svg".
style - SVG: Scalable Vector Graphics
WebSVGAttributestyle
note: in theory, the contentstyletype attribute could be used to specify styling languages other than css, like xsl(t).
tableValues - SVG: Scalable Vector Graphics
efs> <lineargradient id="gradient" gradientunits="userspaceonuse" x1="0" y1="0" x2="200" y2="0"> <stop offset="0" stop-color="#ff0000" /> <stop offset="0.5" stop-color="#00ff00" /> <stop offset="1" stop-color="#0000ff" /> </lineargradient> </defs> <filter id="componenttransfer1" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="table" tablevalues="0 1"/> <fefuncg type="table" tablevalues="0 1"/> <fefuncb type="table" tablevalues="0 1"/> </fecomponenttransfer> </filter> <filter id="componenttransfer2" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="table" tablevalues="1 0"/> <fefuncg type="table" tablevalues="1 0"/> <fefuncb type="table" tablevalues=...
text-anchor - SVG: Scalable Vector Graphics
it is not applicable to other types of auto-wrapped text.
units-per-em - SVG: Scalable Vector Graphics
the units-per-em attribute specifies the number of coordinate units on the "em square", an abstract square whose height is the intended distance between lines of type in the same type size.
visibility - SVG: Scalable Vector Graphics
8l18 14z" class="invisible" /> <path d="m0 0h24v24h0z" fill="none" /> </svg> <span> click me </span> </button> css svg { display: inline !important; } span { vertical-align: 50%; } button { line-height: 1em; } .invisible { visibility: hidden; } javascript document.queryselector("button").addeventlistener("click", function (evt) { this.queryselector("svg > path:nth-of-type(1)").classlist.toggle("invisible"); this.queryselector("svg > path:nth-of-type(2)").classlist.toggle("invisible"); }); specifications specification status comment css level 2 (revision 1)the definition of 'visibility' in that specification.
xlink:href - SVG: Scalable Vector Graphics
refer to the descriptions of the individual animation elements for any restrictions on what types of elements can be targets of particular types of animations.
xlink:title - SVG: Scalable Vector Graphics
the use of this information is highly dependent on the type of processing being done.
<animateColor> - SVG: Scalable Vector Graphics
example svg <svg width="120" height="120" xmlns="http://www.w3.org/2000/svg"> <circle cx="60" cy="60" r="50"> <animatecolor attributename="fill" attributetype="xml" from="black" to="red" dur="6s" repeatcount="indefinite"/> </circle> </svg> result specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of '<animatecolor>' in that specification.
<clipPath> - SVG: Scalable Vector Graphics
WebSVGElementclipPath
value type: userspaceonuse|objectboundingbox ; default value: userspaceonuse; animatable: yes global attributes core attributes most notably: id styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage presentation attributes most notably: clip-path, clip-rule, color, display, fill, fill-opacity, fill-rule, filter, mask, opacity, shape-re...
<feDisplacementMap> - SVG: Scalable Vector Graphics
example <svg width="200" height="200" viewbox="0 0 220 220" xmlns="http://www.w3.org/2000/svg"> <filter id="displacementfilter"> <feturbulence type="turbulence" basefrequency="0.05" numoctaves="2" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50" xchannelselector="r" ychannelselector="g"/> </filter> <circle cx="100" cy="100" r="100" style="filter: url(#displacementfilter)"/> </svg> specifications specification status comment filter effects mo...
<font-face-format> - SVG: Scalable Vector Graphics
the <font-face-format> svg element describes the type of font referenced by its parent <font-face-uri>.
Linking - SVG: Scalable Vector Graphics
WebSVGLinking
when svg documents are embedded within a parent html document using the tag: page1.html: <html> <body> <p>this is a svg button:</p> <object width="100" height="50" type="image/svg+xml" data="button.svg"/> </body> </html> button.svg: <?xml version="1.1" encoding="utf-8"?> <svg xmlns="http://www.w3.org/2000/svg"> <a xlink:href="page2.html" target="_top"> <g> <!-- button graphical elements here --> </g> </a> </svg> the specification says that the browser should navigate to the html document page2.html when the button graphics are clicked.
SVG 1.1 Support in Firefox - SVG: Scalable Vector Graphics
svgsvgelement unimplemented attributes: contentscripttype, contentstyletype, viewport, currentview unimplemented bindings: getintersectionlist, getenclosurelist, checkintersection, checkenclosure g implemented.
SVG animation with SMIL - SVG: Scalable Vector Graphics
<svg width="300" height="100"> <title>svg smil animate with transform</title> <rect x="0" y="0" width="300" height="100" stroke="black" stroke-width="1" /> <rect x="0" y="50" width="15" height="34" fill="blue" stroke="black" stroke-width="1"> <animatetransform attributename="transform" begin="0s" dur="20s" type="rotate" from="0 60 60" to="360 100 60" repeatcount="indefinite" /> </rect> </svg> animation following a path the <animatemotion> element lets you animate an element position and rotation according to a path.
Scripting - SVG: Scalable Vector Graphics
WebSVGScripting
ssage=message this.rect=document.createelementns("http://www.w3.org/2000/svg","rect") this.rect.setattributens(null,"x",x) this.rect.setattributens(null,"y",y) this.rect.setattributens(null,"width",w) this.rect.setattributens(null,"height",h) document.documentelement.appendchild(this.rect) this.rect.addeventlistener("click",this,false) this.handleevent= function(evt){ switch (evt.type){ case "click": alert(this.message) break; } } } inter-document scripting: referencing embedded svg when using svg within html, adobe's svg viewer 3.0 automatically includes a window property called svgdocument that points to the svg document.
Other content in SVG - SVG: Scalable Vector Graphics
« previousnext » apart from graphic primitives like rectangles and circles, svg offers a set of elements to embed other types of content in images as well.
Patterns - SVG: Scalable Vector Graphics
WebSVGTutorialPatterns
« previousnext » patterns patterns are arguably one of the more confusing fill types to use in svg.
SVG image element - SVG: Scalable Vector Graphics
in this basic example, a .jpg image referenced by an href attribute will be rendered inside an svg object: <?xml version="1.0" standalone="no"?> <!doctype svg public "-//w3c//dtd svg 1.1//en" "http://www.w3.org/graphics/svg/1.1/dtd/svg11.dtd"> <svg width="5cm" height="4cm" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <image href="firefox.jpg" x="0" y="0" height="50px" width="50px"/> </svg> there are some important things to take note of (referenced from the w3 specs): if you do not set the x or y attributes, they will be set to 0.
SVG fonts - SVG: Scalable Vector Graphics
option: use css @font-face you can use @font-face to reference remote (and not so remote) fonts: <font id="super_sans"> <!-- and so on --> </font> <style type="text/css"> @font-face { font-family: "super sans"; src: url(#super_sans); } </style> <text font-family="super sans">my text uses super sans</text> option: reference a remote font the above mentioned font-face-uri element allows you to reference an external font, hence allowing greater re-usability: <font> <font-face font-family="super sans"> <font-face-src> <font-face-uri xli...
Tools for SVG - SVG: Scalable Vector Graphics
batik offers a viewer (squiggle), a rasterizer for png output, an svg pretty printer to format svg files, and a truetype-to-svg-font converter.
Certificate Transparency - Web security
this can be accomplished via a number of different mechanisms: x.509v3 certificate extension which embeds signed certificate timestamps directly into the leaf certificate a tls extension of type signed_certificate_timestamp sent during the handshake ocsp stapling (that is, the status_request tls extension) and providing a signedcertificatetimestamplist with one or more scts with the x.509 certificate extension, the included scts are decided by the issuing ca.
How to fix a website with blocked mixed content - Web security
passive mixed content is displayed by default, but users can set a preference to block this type of content, as well.
Referer header: privacy and security concerns - Web security
see link types and search for noreferrer for more information.
How to turn off form autocompletion - Web security
disabling autocompletion to disable autocompletion in forms, you can set the autocomplete attribute to "off": autocomplete="off" you can do this either for an entire form, or for specific input elements in a form: <form method="post" action="/form" autocomplete="off"> […] </form> <form method="post" action="/form"> […] <div> <label for="cc">credit card:</label> <input type="text" id="cc" name="cc" autocomplete="off"> </div> </form> setting autocomplete="off" on fields has two effects: it tells the browser not to save data inputted by the user for later autocompletion on similar forms, though heuristics for complying vary by browser.
HTML Imports - Web Components
you import an html file by using a <link> tag in an html document like this: <link rel="import" href="myfile.html"> the import link type is new.
Using shadow DOM - Web Components
as an example, consider the following html fragment: <!doctype html> <html> <head> <meta charset="utf-8"> <title>simple dom example</title> </head> <body> <section> <img src="dinosaur.png" alt="a red tyrannosaurus rex: a two legged dinosaur standing upright like a human, with small arms, and a large head with lots of sharp teeth."> <p>here we will add a link to the <a href="https://www.mozilla.org/">mozilla homepage</a></p...
Using templates and slots - Web Components
full example <!doctype html> <html> <head> <title>slot example</title> <style> dl { margin-left: 6px; } dt { font-weight: bold; color: #217ac0; font-size: 110% } dt { font-family: consolas, "liberation mono", courier } dd { margin-left: 16px } </style> </head> <body> <template id="element-details-template"> <style> details {font-family: "open sans light",helve...
xml:base - XML: Extensible Markup Language
WebXMLxml:base
<svg xml:base="https://foobar.s3-eu-west-1.amazonaws.com/uploads/15066845653629" width="909" height="1286" viewbox="0 0 909 1286"xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <style type="text/css"><![cdata[ .s9_999{ font-size: 9.17px; font-family: zapfdingbats_ghr; fill: #161615; } ]]></style> <text x="647" y="412" dx="0" class="s9_999" >r</text> <style type="text/css"><![cdata[ @font-face { font-family: zapfdingbats_ghr; src: url("fonts/zapfdingbats_ghr.woff") format("woff"); } ]]></style> </svg> setting the xml:base on the svg element means ...
boolean - XPath
an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type.
number - XPath
an object of a type other than the four basic types is converted to a number in a way that is dependent on that type.
Functions - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the following is an annotated list of core xpath functions and xslt-specific additions to xpath, including a description, syntax, a list of arguments, result-type, source in the appropriate w3c recommendation, and degree of present gecko support.
<xsl:apply-imports> - XSLT: Extensible Stylesheet Language Transformations
type instruction, appears within a template.
<xsl:apply-templates> - XSLT: Extensible Stylesheet Language Transformations
type instruction, appears within a template.
<xsl:attribute-set> - XSLT: Extensible Stylesheet Language Transformations
type top-level, must be the child of <xsl:stylesheet> or <xsl:transform>.
<xsl:attribute> - XSLT: Extensible Stylesheet Language Transformations
type instruction, appears within a template or an <xsl:attribute-set> element.
<xsl:call-template> - XSLT: Extensible Stylesheet Language Transformations
type instruction, appears within a template.
<xsl:choose> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementchoose
type instruction, appears with a template.
<xsl:comment> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementcomment
type instruction, appears within a template.
<xsl:copy-of> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementcopy-of
type instruction, appears within a template.
<xsl:copy> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementcopy
type instruction, appears within a template.
<xsl:decimal-format> - XSLT: Extensible Stylesheet Language Transformations
type top-level, must be the child of <xsl:stylesheet> or <xsl:transform>.
<xsl:element> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementelement
type instruction, appears within a template.
<xsl:fallback> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementfallback
type instruction, appears within a template.
<xsl:for-each> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementfor-each
type instruction, appears within a template.
<xsl:if> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementif
type instruction, appears within a template.
<xsl:import> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementimport
type top-level, must appear before any other child of <xsl:stylesheet> or <xsl:transform> in the importing stylesheet.
<xsl:include> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementinclude
type top-level, may appear in any order as a child of <xsl:stylesheet> or <xsl:transform>.
<xsl:key> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementkey
type top-level, must be the child of <xsl:stylesheet> or <xsl:transform>.
<xsl:message> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementmessage
type instruction, appears within a template.
<xsl:namespace-alias> - XSLT: Extensible Stylesheet Language Transformations
type top-level, must be the child of <xsl:stylesheet> or <xsl:transform>.
<xsl:number> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementnumber
type instruction, appears within a template.
<xsl:otherwise> - XSLT: Extensible Stylesheet Language Transformations
type subinstruction, must appear as the last child of an <xsl:choose> element, within a template.
<xsl:param> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementparam
type instruction, can appear as a top-level element or within a template.
<xsl:preserve-space> - XSLT: Extensible Stylesheet Language Transformations
type top-level, must be a child of <xsl:stylesheet> or <xsl:transform>.
<xsl:processing-instruction> - XSLT: Extensible Stylesheet Language Transformations
type instruction, appears within a template.
<xsl:strip-space> - XSLT: Extensible Stylesheet Language Transformations
type top-level, must be a child of <xsl:stylesheet> or <xsl:transform>.
<xsl:template> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementtemplate
type top-level, must be the child of <xsl:stylesheet> or <xsl:transform>.
<xsl:text> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementtext
type instruction, appears within a template.
<xsl:value-of> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementvalue-of
type instruction, appears with a template.
<xsl:variable> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementvariable
type top-level or instruction.
<xsl:when> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementwhen
type subinstruction, always appears within an <xsl:choose> element.
<xsl:with-param> - XSLT: Extensible Stylesheet Language Transformations
type subinstruction, always appears within an <xsl:apply-templates> or an <xsl:call-template> element.
For Further Reading - XSLT: Extensible Stylesheet Language Transformations
ken holman location: http://www.xml.com/pub/a/2000/08/holman/index.html tutorials/examples zvon xsl programmers: http://www.zvon.org/o_html/group_xsl.html jeni's xslt pages index: http://www.jenitennison.com/xslt/ xmlpitstop.com stylesheet center: http://www.xmlpitstop.com/default.asp?datatype=ssc xsl tutorial index: http://www.nwalsh.com/docs/tutorials/xsl/ other cover pages extensible stylesheet language (xsl): http://www.oasis-open.org/cover/xsl.html xsl-list subscribe: http://www.mulberrytech.com/xsl/xsl-list/ archives: http://www.biglist.com/lists/xsl-list/archives/ the xsl-list is a very active general mailing list, hosted by mulber...
Transforming XML with XSLT - XSLT: Extensible Stylesheet Language Transformations
our focus here is on the second type of stylesheet that gecko supports: the xslt stylesheet.
Using the Mozilla JavaScript interface to XSL Transformations - XSLT: Extensible Stylesheet Language Transformations
instead of this: var processor = new xsltprocessor(); do this: var processor = components.classes["@mozilla.org/document-transformer;1?type=xslt"] .createinstance(components.interfaces.nsixsltprocessor); see also the xslt javascript interface in gecko document.load() regarding the loading of xml documents (as used above) original document information author(s): mike hearn last updated date: december 21, 2005 copyright information: copyright (c) mike hearn ...
Advanced Example - XSLT: Extensible Stylesheet Language Transformations
// xsl stylesheet: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output method="html" indent="yes" /> <xsl:param name="myorder" /> <xsl:template match="/"> <xsl:apply-templates select="/div//div"> <xsl:sort select="." data-type="number" order="{$myorder}" /> </xsl:apply-templates> </xsl:template> <xsl:template match="div"> <xsl:copy-of select="." /> </xsl:template> </xsl:stylesheet> ...
Basic Example - XSLT: Extensible Stylesheet Language Transformations
lt stylesheet <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:myns="http://devedge.netscape.com/2002/de"> <xsl:output method="html" /> <xsl:template match="/"> <html> <head> <title> <xsl:value-of select="/myns:article/myns:title"/> </title> <style type="text/css"> .mybox {margin:10px 155px 0 50px; border: 1px dotted #639ace; padding:0 5px 0 5px;} </style> </head> <body> <p class="mybox"> <span class="title"> <xsl:value-of select="/myns:article/myns:title"/> </span> <br /> authors: <br /> <xsl:apply-templates select="/myns:article/myns:authors/myns:a...
Caching compiled WebAssembly modules - WebAssembly
it is ideal for persisting assets locally for the saved state of an application, including text, blobs, and any other type of cloneable object.
Index - WebAssembly
found 12 pages: # page tags and summary 1 webassembly landing, webassembly, wasm webassembly is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as c/c++ with a compilation target so that they can run on the web.
onunload - XUL
« xul reference home onunload type: script code specifies a set of scripts to execute when the browser window is closed by the user.