Search completed in 1.59 seconds.
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%.proto
type[@@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%.proto
type.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%.proto
type.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%.proto
type.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 proto
type-based).
...each object has a private property which holds a link to another object called its proto
type.
... that proto
type object has a proto
type of its own, and so on until an object is reached with null as its proto
type.
...And 78 more matches
Object prototypes - Learn web development
previous overview: objects next proto
types are the mechanism by which javascript objects inherit features from one another.
... in this article, we explain how proto
type chains work and look at how the proto
type property can be used to add methods to existing constructors.
... objective: to understand javascript object proto
types, how proto
type chains work, and how to add new methods onto the proto
type property.
...And 50 more matches
ctypes
the c
types object contains methods and predefined data
types used to create and manage a library.
... method overview c
type array
type(
type[, length]); cdata cast(data,
type); c
type function
type(abi, return
type[, arg
type1, ...]); cdata int64(n); string libraryname(name); library open(libspec); c
type pointer
type(
typespec); c
type struct
type(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-c
types.
...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
proto
type 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 proto
type of the jsobject for the wrapper (unless the c++ object's class info has the flag nsixpcscriptable::dont_share_proto
type 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 proto
type (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-c
types.
... this guide explains how to convert objective-c code into js-c
types code.
... converting objective-c code to c code to convert objective-c code to js-c
types, we need to convert it to c code first.
...And 29 more matches
<input type="file"> - HTML: Hypertext Markup Language
<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-c
types api are represented by c
type 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
struct
type represents c structures.
... syntax returns a c
type 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
<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
array
type represents c arrays syntax returns a new c
type representing an array data
type.
... c
type array
type()
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 c
type 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
<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
<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
<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
<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
<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 c
types object offers a number of constructor methods that let you declare
types.
... every
type is represented by a c
type object, which, in turn, provides a constructor method you can call to define values of those
types.
... each
type you declare using js-c
types corresponds to a compatible c declaration.
...And 22 more matches
Using js-ctypes
before you can use js-c
types, you need to import the c
types.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/c
types.jsm") loading a native library once you've imported the code module, you can call the c
types.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 = c
types.open("user32.dll"); on mac os x, you can load the core foundation library from the core foundation framework like this: var corefoundation = c
types.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
function
type represents c function.
... syntax returns a new c
type object describing a c function.
... c
type function
type( abi, return
type[, arg
type1, ...] ); parameters abi the abi
type for the function; this is one of the abi constants.
...And 22 more matches
PointerType
pointer
type represents c pointer.
... syntax returns a new c
type object describing a new pointer data
type.
... c
type pointer
type(
type ); parameters
type specifies the
type to which the pointer
type points.
...And 21 more matches
<input type="image"> - HTML: Hypertext Markup Language
<input> elements of
type image are used to create graphical submit buttons, i.e.
... supported common attributes alt, src, width, height, formaction, formenc
type, 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 [[proto
type]] 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 [[proto
type]] has been altered.
... if you care about performance you should avoid setting the [[proto
type]] of an object.
...And 21 more matches
<input type="date"> - HTML: Hypertext Markup Language
<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
c
types reference the c
types object is the base of the c
types api.
... it is obtained by by loading the c
types module: components.utils.import("resource://gre/modules/c
types.jsm"); you can use the c
types object to load libraries, construct
types, and perform miscellaneous tasks such as
type casting.
... the c
types 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
<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
<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
<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
<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.setproto
typeof() method sets the proto
type (i.e., the internal [[proto
type]] property) of a specified object to another object or null.
... warning: changing the [[proto
type]] 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.setproto
typeof(...) statement, but may extend to any code that has access to any object whose [[proto
type]] 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-c
types, data could be converted implicitly when passing to or returning from a function
type call, or setting pointer content, an array element or a struct field.
... var buffer = c
types.char.array(10)(); var somecfunction = library.declare("somecfunction", c
types.default_abi, c
types.void_t, c
types.char.ptr); somecfunction(buffer); // here c
types.char.array(10)() is converted to c
types.char.ptr
type implicit conversion can be tested in the following way: var mystruct = c
types.struct
type("mystruct
type", [ { "v": c
types.bool } ])(); mystruct.v = 1; console.log(mystruct.v.tostring()); // 'true' boolean
type target
type source converted value c
types.bool js boolean src js number (0 or 1) if src == 0: false if src == 1: true var mystruct = c
types.struct
type("mystruct
type", [ { "v": c
types.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 c
types.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 = c
types.struct
type("mystruct
type", [ { "v": c
types.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 open
type font.
...these are all referred to as open
type 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 open
type font features in css.
...And 15 more matches
<input type="text"> - HTML: Hypertext Markup Language
<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 nsmsgfolderflag
type; /// 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 nsmsgfolderflag
type 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-c
types.
... this documentaion explains how to convert the com c++ code into js-c
types 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 jsc
types converting com code to c code to convert com code to js-c
types, we need to write c++ vtable pointers in c.
...And 12 more matches
XPathResult.resultType - Web APIs
the read-only result
type property of the xpathresult interface represents the
type of the result, as defined by the
type constants.
... syntax var result
type = result.result
type; 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
<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 item
type 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 item
type 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.proto
type.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.proto
type.bind) (function(){ var slice = array.proto
type.slice; function.proto
type.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.proto
type.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.proto
type.bind) (function(){ var arrayproto
typeslice = array.proto
type.slice; function.proto
type.bind = function(otherthis) { if (
typeof this !== 'function') { // closest thing possible to the ecmascript 5 // internal iscallable function throw new
typeerror('function.proto
type.bind - what is trying to be bound is not callable'); } var baseargs= arrayproto
typeslice.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
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
<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 document
type interface represents a node containing a doc
type.
...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/document
type" 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">document
type</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties fr...
... document
type.entities read only a namednodemap of entities declared in the dtd.
...And 9 more matches
Node.nodeType - Web APIs
the read-only node.node
type property is an integer that identifies what the node is.
... syntax var
type = node.node
type; 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 response
type 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 response
type, the default value of text is used.
...And 9 more matches
Intl.Locale.prototype.collation - JavaScript
the intl.locale.proto
type.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.setproto
typeof() method is the same method as object.setproto
typeof(), except for its return
type.
... it sets the proto
type (i.e., the internal [[proto
type]] property) of a specified object to another object or to null, and returns true if the operation was successful, or false otherwise.
... syntax reflect.setproto
typeof(target, proto
type) parameters target the target object of which to set the proto
type.
...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 proto
type.
... syntax bool js_getproto
type(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 proto
type.
...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
<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.proto
type.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.setproto
typeof() method is a trap for object.setproto
typeof().
... syntax const p = new proxy(target, { setproto
typeof: function(target, proto
type) { } }); parameters the following parameters are passed to the setproto
typeof() method.
... proto
type the object's new proto
type or null.
...And 8 more matches
Mozilla's DOCTYPE sniffing - Archive of obsolete content
this document describes how mozilla uses the doc
type declaration to determine strict mode vs.
... pages written using any public identifiers in doc
type 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 js
type enumeration represent the
types of javascript values.
... value description js
type_void the undefined value.
... js
type_object javascript objects.
...And 7 more matches
JS_SetPrototype
set a javascript object's proto
type.
... syntax bool js_setproto
type(jscontext *cx, js::handleobject obj, js::handleobject proto); name
type description cx jscontext * the context in which to set the object's proto
type.
... proto js::handleobject the object to set as the new proto
type of obj.
...And 7 more matches
js-ctypes
js-c
types 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-c
types.
...other work made possible by js-c
types is jni, this is elaborated on in the jni.jsm section and not the js-c
types section due to the jsm abstracting away all of the js-c
types.
...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 mime
type 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
<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
<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.proto
type.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.proto
type.tosource() — array object.
... boolean.proto
type.tosource() — boolean object.
...And 7 more matches
Reflect.getPrototypeOf() - JavaScript
the static reflect.getproto
typeof() method is almost the same method as object.getproto
typeof().
... it returns the proto
type (i.e.
... the value of the internal [[proto
type]] 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 getentriesby
type() 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.getentriesby
type(
type); parameters
type the
type of entry to retrieve such as "frame".
...And 6 more matches
RTCIceCandidateStats.networkType - Web APIs
the rtcicecandidatestats dictionary's network
type property specifies the
type of network used by a local candidate to communicate with a remote peer.
... note: the network
type 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 network
type = rtcicecandidatestats.network
type; value a domstring whose value is taken from the rtcnetwork
type enumerated
type.
...And 6 more matches
<input type="color"> - HTML: Hypertext Markup Language
<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.proto
type.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.proto
type.includes().
... if you need to find if any element satisfies the provided testing function, use array.proto
type.some().
...And 6 more matches
Intl.DateTimeFormat.prototype.formatToParts() - JavaScript
the intl.datetimeformat.proto
type.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
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/nsiaccessible
types.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.is
typesupported() 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.is
typesupported(mime
type); parameters mime
type the mime media
type that you want to test support for in the current browser.
...And 5 more matches
MimeTypeArray - Web APIs
the mime
typearray interface returns an array of mime
type instances, each of which contains information about a supported browser plugins.
... this object is returned by navigatorplugins.mime
types.
... properties mime
typearray.length the number of items in the array.
...And 5 more matches
performance.getEntriesByType() - Web APIs
the getentriesby
type() method returns a list of performanceentry objects for a given
type.
... syntax entries = window.performance.getentriesby
type(
type); arguments
type the
type of entry to retrieve such as "mark".
... the valid entry
types are listed in performanceentry.entry
type.
...And 5 more matches
PointerEvent.pointerType - Web APIs
the pointer
type read-only property of the pointerevent interface indicates the device
type (mouse, pen, or touch) that caused a given pointer event.
... syntax var p
type = pointerevent.pointer
type; return value p
type 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 rtcstats
type 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 svgunit
types 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/svgunit
types" 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">svgunit
types</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.proto
type.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.proto
type.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.proto
type.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 xrreferencespace
type 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
<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.proto
type.call.
... // production steps of ecma-262, edition 5, 15.4.4.19 // reference: http://es5.github.io/#x15.4.4.19 if (!array.proto
type.map) { array.proto
type.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.getproto
typeof() method is a trap for the [[getproto
typeof]] internal method.
... syntax const p = new proxy(obj, { getproto
typeof(target) { ...
... } }); parameters the following parameter is passed to the getproto
typeof() 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 js
type.
... syntax bool js::getfirstargumentas
typehint(jscontext* cx, callargs args, js
type *result); name
type description cx jscontext * the context in which to define functions.
... behavior js
type * receives the result of conversion.
...And 4 more matches
JS_GetClassPrototype
get the builtin class proto
type object.
... syntax bool js_getclassproto
type(jscontext *cx, jsprotokey key, js::mutablehandle<jsobject*> objp); name
type description cx jscontext * a context.
... key jsprotokey the key of the proto
type.
...And 4 more matches
Document.doctype - Web APIs
returns the document
type declaration (dtd) associated with current document.
... the returned object implements the document
type interface.
... use domimplementation.createdocument
type() to create a document
type.
...And 4 more matches
InputEvent.inputType - Web APIs
the input
type read-only property of the inputevent interface returns the
type of change made to editible content.
... syntax var astring = inputevent.input
type; 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
the mime
type interface provides contains information about a mime
type associated with a particular plugin.
... navigatorplugins.mime
types returns an array of this object.
... properties mime
type.
type returns the mime
type of the associated plugin.
...And 4 more matches
XMLHttpRequest.overrideMimeType() - Web APIs
the xmlhttprequest method overridemime
type() 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.overridemime
type(mime
type) parameters mime
type 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.proto
type.every(), array.proto
type.some(), array.proto
type.foreach(), array.proto
type.map(), array.proto
type.filter(), array.proto
type.reduce(), array.proto
type.reduceright(), array.proto
type.find() when working with map and set objects: map.proto
type.foreach() and set.proto
type.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.proto
type.reduce(), array.proto
type.reduceright() and
typedarray.proto
type.reduce(),
typedarray.proto
type.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.proto
type.tolocalestring(), and for dates see date.proto
type.tolocalestring().
... polyfill // https://tc39.github.io/ecma402/#sup-array.proto
type.tolocalestring if (!array.proto
type.tolocalestring) { object.defineproperty(array.proto
type, '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.proto
type.formattoparts() method allows locale-aware formatting of strings produced by numberformat formatters.
... syntax intl.numberformat.proto
type.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.proto
type.valueof() to call a custom method instead of the default object method.
... suppose you have an object
type mynumber
type and you want to create a valueof method for it.
... the following code assigns a user-defined function to the object's valueof method: mynumber
type.proto
type.valueof = function() { return customprimitivevalue; }; with the preceding code in place, any time an object of
type mynumber
type 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.proto
type.replace() page.
...the arguments supplied to this function are described in the specifying a function as a parameter section in string.proto
type.replace() page.
... description this method is called internally in string.proto
type.replace() if the pattern argument is a regexp object.
...And 4 more matches
PerformanceEntry.entryType - Web APIs
the entry
type property returns a domstring representing the
type of performance metric such as, for example, "mark".
... syntax var
type = entry.entry
type; return value the return value depends on the sub
type of the performanceentry object and affects the value of the performanceentry.name property as shown by the table below.
... performance entry
type names value sub
type 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 tcp
type property is included on tcp candidates to provide additional details about the candidate
type.
... the tcp
type field's value is set when the rtcicecandidate() constructor is used.
... syntax var tcp
type = rtcicecandidate.tcp
type; value a domstring whose value is one of those defined by the rtcicetcpcandidate
type enumerated
type.
...And 3 more matches
RTCNetworkType - Web APIs
the webrtc rtcnetwork
type 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 network
type rtcstunserverconnectionstats's network
type 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 change
type() 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.change
type(
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
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.proto
type.charat instead warning: string.charcodeat is deprecated; use string.proto
type.charcodeat instead warning: string.concat is deprecated; use string.proto
type.concat instead warning: string.contains is deprecated; use string.proto
type.contains instead warning: string.endswith is deprecated; use string.proto
type.endswith instead warning: string.includes is deprecated; use string.proto
type.includes instead warning: string.indexof is deprecated; use string.proto
type.in...
...dexof instead warning: string.lastindexof is deprecated; use string.proto
type.lastindexof instead warning: string.localecompare is deprecated; use string.proto
type.localecompare instead warning: string.match is deprecated; use string.proto
type.match instead warning: string.normalize is deprecated; use string.proto
type.normalize instead warning: string.replace is deprecated; use string.proto
type.replace instead warning: string.search is deprecated; use string.proto
type.search instead warning: string.slice is deprecated; use string.proto
type.slice instead warning: string.split is deprecated; use string.proto
type.split instead warning: str...
...ing.startswith is deprecated; use string.proto
type.startswith instead warning: string.substr is deprecated; use string.proto
type.substr instead warning: string.substring is deprecated; use string.proto
type.substring instead warning: string.tolocalelowercase is deprecated; use string.proto
type.tolocalelowercase instead warning: string.tolocaleuppercase is deprecated; use string.proto
type.tolocaleuppercase instead warning: string.tolowercase is deprecated; use string.proto
type.tolowercase instead warning: string.touppercase is deprecated; use string.proto
type.touppercase instead warning: string.trim is deprecated; use string.proto
type.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.proto
type.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.proto
type.findindex if (!array.proto
type.findindex) { object.defineproperty(array.proto
type, '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.proto
type.every() array.proto
type.some() array.proto
type.find() array.proto
type.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.proto
type.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.proto
type.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.proto
type.indexof().
...this algorithm matches the one specified in ecma-262, 5th edition, assuming
typeerror and math.abs() have their original values.
...if (!array.proto
type.indexof) array.proto
type.indexof = (function(object, max, min) { "use strict" return function indexof(member, fromindex) { if (this === null || this === undefined) throw
typeerror("array.proto
type.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.proto
type.construct = function(aargs) { let onew = object.create(this.proto
type); 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.proto
type.construct = function (aargs) { let onew = {}; onew.__proto__ = this.proto
type; this.apply(onew, aargs); return onew; }; using closures: function.proto
type.construct = function(aargs) { let fconstructor = this, fnewconstr = function() { fconstructor.apply(this, aargs); }; fnewconstr.proto
type = fconstructor.proto
type; return new fnewconstr(); }; using the function constructor: function.proto
type.construct = function (aargs) { let fnewconstr = new function(""); fnewconstr.proto
type = this.proto
type; let onew = new fnewconstr(); this.apply(onew, aargs); return onew; }; example usage: function myconstructor() { for (let nprop = 0; nprop < ...
...And 3 more matches
Intl.ListFormat.prototype.formatToParts() - JavaScript
the intl.listformat.proto
type.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.proto
type.formattoparts(list) parameters list an array of values to be formatted according to a locale.
... description whereas intl.listformat.proto
type.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.getproto
typeof() method returns the proto
type (i.e.
... the value of the internal [[proto
type]] property) of the specified object.
... syntax object.getproto
typeof(obj) parameters obj the object whose proto
type 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.proto
type.tostring = function dogtostring() { const ret = 'dog ' + this.name + ' is a ' + this.sex + ' ' + this.color + ' ' + this.breed; return ret; } or, using es6 template strings: dog.proto
type.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 contentstyle
type 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 contentstyle
type is ommitted, the attribute is not well supported in user agents.
...And 3 more matches
type - SVG: Scalable Vector Graphics
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.proto
type for an object's global object.
... syntax jsobject * js_getarrayproto
type(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.proto
type is being retrieved.
...And 2 more matches
JS_GetFunctionPrototype
this article covers features introduced in spidermonkey 17 retrieves the original, canonical function.proto
type for an object's global object.
... syntax jsobject * js_getfunctionproto
type(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.proto
type is being retrieved.
...And 2 more matches
JS_GetObjectPrototype
this article covers features introduced in spidermonkey 17 retrieves the original, canonical object.proto
type for an object's global object.
... syntax jsobject * js_getobjectproto
type(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.proto
type 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_get
typename(jscontext *cx, js
type type); name
type description cx jscontext * pointer to a js context from which to derive runtime information.
...
type js
type one of js
type_void, js
type_object, js
type_function, js
type_string, js
type_number, or js
type_boolean.
...And 2 more matches
JS_TypeOfValue
determines the js data
type of a js value.
... syntax js
type 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.createdocument
type() method returns a document
type 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 doc
type = document.implementation.createdocument
type(qualifiednamestr, publicid, systemid); parameters qualifiednamestr is a domstring containing the qualified name, like svg:svg.
... example var dt = document.implementation.createdocument
type('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.doc
type.publicid); // -//w3c//dtd svg 1.1//en specifications specification status comment domthe definition of 'domimplementation.createdocument
type' in that specification.
...And 2 more matches
File.type - Web APIs
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="show
type(this)"> function show
type(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 msaudiodevice
type property of the html <audio> element, is a read/write proprietary attribute, specific to internet explorer and microsoft edge.
... msaudiodevice
type specifies the output device id that the audio will be sent to.
... syntax <audio src="sound.mp3" msaudiodevice
type="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 nondocument
typechildnode.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...
....proto
type, "nextelementsibling", { get: function(){ var e = this.nextsibling; while(e && 1 !== e.node
type) e = e.nextsibling; return e; } }); } polyfill for internet explorer 9+ and safari // source: https://github.com/jserz/js_piece/blob/master/dom/nondocument
typechildnode/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.node
type === 1) { return el; } } return n...
...And 2 more matches
PerformanceResourceTiming.initiatorType - Web APIs
the initiator
type read-only property is a string that represents the
type of resource that initiated the performance event.
... syntax resource.initiator
type; return value a string representing the
type of resource that initiated the performance event, as specified above.
... example function print_performanceentries() { // use getentriesby
type() to just get the "resource" events var p = performance.getentriesby
type("resource"); for (var i=0; i < p.length; i++) { print_initiator
type(p[i]); } } function print_initiator
type(perfentry) { // print this performance entry object's initiator
type value var value = "initiator
type" in perfentry; if (value) console.log("...
...And 2 more matches
RTCDataChannel.binaryType - Web APIs
the property binary
type 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.binary
type 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 binary
type.
...And 2 more matches
Report.type - Web APIs
the
type read-only property of the report interface returns the
type of report generated, e.g.
... syntax let report
type = 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
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 my
type = response.
type; value a response
type string indicating the
type of the response.
...And 2 more matches
TypeInfo - Web APIs
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 xmlhttprequestresponse
type 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 response
type on the request.
... values "" an empty response
type 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 trusted
types.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.proto
type.tolocaleformat is deprecated; consider using intl.datetimeformat instead" occurs when the non-standard date.proto
type.tolocaleformat method is used.
... message warning: date.proto
type.tolocaleformat is deprecated; consider using intl.datetimeformat instead error
type warning.
... the non-standard date.proto
type.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 proto
type 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 proto
type 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.proto
type.call.
... if (!array.proto
type.every) { array.proto
type.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.proto
type, not object.proto
type.
... date.proto
type.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.proto
type.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.proto
type.tostring.
... the tostring() method will throw a
typeerror exception ("function.proto
type.tostring called on incompatible object"), if its this value object is not a function object.
... function.proto
type.tostring.call('foo'); //
typeerror if the tostring() method is called on built-in function objects or a function created by function.proto
type.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.proto
type.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.proto
type.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.proto
type.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.
... effective
type 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.effective
type; see also: network information api networkinformation networkinformation.effective
type ...
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 add
typelistener() and will then receive notification as addon
type are registered and unregistered.
... method overview void on
typeadded(in addon
type type) void on
typeremoved(in addon
type type) methods on
typeadded() called when an add-on
type has been added.
... void on
typeadded( in addon
type type ) parameters
type the addon
type that is being added needsrestart true if an application restart is necessary for the change to take effect on
typeremoved() called when an add-on
type has been removed.
... void on
typeremoved( in addon
type type, ) parameters
type the addon
type that has been removed ...
PR_GetDescType
describes what
type of file is referenced by a specified file descriptor.
... syntax #include <prio.h> prdesc
type pr_getdesc
type(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 prdesc
type enumeration constant that describes the
type of file.
... description the prdesc
type enumeration is defined as follows:
typedef enum prdesc
type { pr_desc_file = 1, pr_desc_socket_tcp = 2, pr_desc_socket_udp = 3, pr_desc_layered = 4 } prdesc
type; 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 proto
type 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 jsexn
type jserrorformatstring bug 684526 ...
JS_GetErrorPrototype
this article covers features introduced in spidermonkey 38 return the original value of error.proto
type.
... syntax jsobject * js_geterrorproto
type(jscontext *cx); name
type description cx jscontext * pointer to a js context whose errors should be reported via your function.
... description js_geterrorproto
type returns the original value of error.proto
type from the global object of the current compartment of cx.
... see also mxr id search for js_geterrorproto
type bug 997285 ...
JS_InitCTypesClass
this article covers features introduced in spidermonkey 1.8.5 initialize the c
types object on a global object.
... the c
types object will be frozen.
... syntax jsbool js_initc
typesclass(jscontext *cx, jsobject *global); name
type description cx jscontext * the context.
... description c
types capability is disabled in a build by default.
nsIAccessibleCoordinateType
accessible/public/nsiaccessible
types.idlscriptable these constants define which coordinate system a point is located in.
...constants constant value description coord
type_screen_relative 0x00 the coordinates are relative to the screen.
... coord
type_window_relative 0x01 the coordinates are relative to the window.
... coord
type_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 supported
types 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.supported
types = [card
type1...card
typen]; value an array containing one or more domstrings, which describe the card
types the retailer supports.
... legal values are defined in basiccard
type 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 supported
types properties.
... var supportedinstruments = [{ supportedmethods: 'basic-card', data: { supportednetworks: ['visa', 'mastercard', 'amex', 'jcb', 'diners', 'discover', 'mir', 'unionpay'], supported
types: ['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 biquadfilter
type.
...
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 cssnumeric
type = cssnumericvalue.
type(); parameters none.
... return value a cssnumeric
type 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 cssnumeric
type = 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.get
type() 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.get
type(
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.moz
typesat() method returns a list of the format
types that are stored for an item at the specified index.
... syntax nsivariant datatransfer.moz
typesat(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 moz
typesat() 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.moz
typesat(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.content
type 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 content
type = document.content
type; value content
type is a read-only property.
... specifications specification status comment domthe definition of 'document.content
type' in that specification.
NavigatorPlugins.mimeTypes - Web APIs
returns a mime
typearray object, which contains a list of mime
type objects representing the mime
types recognized by the browser.
... note: named properties of mime
typearray objects are no longer enumerable in the latest browser versions.
... syntax var mime
types[] = navigator.mime
types; mime
types is a mime
typearray 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.mime
types; } function getjavaplugindescription() { var mime
type = navigator.mime
types['application/x-java-applet']; if (mime
type === undefined) { // no java plugin present return undefined; } return mime
type.enabledplugin.description; } specifications specification status comment html living standardthe definition of 'navigatorplugins.mime
types' in that specification.
NonDocumentTypeChildNode.previousElementSibling - Web APIs
the nondocument
typechildnode.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.proto
type, "previouselementsibling", { get: function(){ var e = this.previoussibling; while(e && 1 !== e.node
type) e = e.previoussibling; return e; } }); } polyfill for internet explorer 9+ and safari // source: https://github.com/jserz/js_piece/blob/master/dom/nondocument
typechildnode/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.node
type === 1) { return el; } } return null; }, set: undefined }); }); })([element.proto
type, characterdata.proto
type]); specifications specification status comment domthe definition of 'nondocument
typechildnode.previouselementsibling' in that specification.
... living standard splitted the elementtraversal interface in childnode, parentnode, and nondocument
typechildnode.
PaymentRequest.shippingType - Web APIs
the shipping
type 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 shipping
type = paymentrequest.shipping
type value one of "shipping", "delivery", "pickup", or null.
... specifications specification status comment payment request apithe definition of 'shipping
type' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetshipping
typechrome 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 getentriesby
type() to just get the "navigation" events var perfentries = performance.getentriesby
type("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 rtcicecandidate
type 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 rtcicecandidate
type enumeration is used by the
type property of rtcicecandidate objects, as well as when reporting statistics on candidates using rtcicecandidatestats.candidate
type.
... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidate
type' in that specification.
RTCIceServer.credentialType - Web APIs
the rtciceserver dictionary's credential
type property is a string value from the rtcicecredential
type enum which indicates what
type of credential the rtciceserver.credential value is.
... credential
type = newcredential
type, ...
... }; var credential
type = iceserver.credential
type; iceserver.credential
type = newcredential
type; value the permitted values are found in the rtcicecredential
type 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", credential
type: "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 rtcsdp
type 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 rtcsdp
type.
... the allowed values are those of an enum of
type rtcsdp
type: "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
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 rtcstats
type.
... syntax var
type = rtcstats.
type; value a domstring which specifies which
type of statistic is represented by the object.
... the string comes from the rtcstats
type 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 internet
typechrome full support 38edge full support 79firefox full support 43ie no support noopera full support 25safari no support nowebview ...
Selection.type - Web APIs
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 container
type readonly property of the taskattributiontiming interface returns the
type of frame container, one of iframe, embed, or object.
... syntax var container
type = taskattributiontiming.container
type; value a domstring containing the container's
type, one of iframe, embed, or object.
... specifications specification status comment long tasks api 1the definition of 'container
type' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcontainer
type experimentalchrome full support 58edge full support ≤79firefox no support noie ?
CSS data types - CSS: Cascading Style Sheets
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
the obsolete html tele
type 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 tele
type, text-only screen, or line printer.
... the terms non-proportional, mono
type, 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.proto
type[@@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.proto
type.keys() method was introduced.
...this is where now the built-in @@unscopables array.proto
type[@@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.proto
type) { keys.push('something'); } object.keys(array.proto
type[symbol.unscopables]); // ["copywithin", "entries", "fill", "find", "findindex", // "includes", "keys", "values"] specifications specification ecmascript (ecma-262)the definition of 'array.proto
type[@@unscopables]' in that specification.
Array.prototype.copyWithin() - JavaScript
this especially applies to the
typedarray method of the same name.
... polyfill if (!array.proto
type.copywithin) { object.defineproperty(array.proto
type, '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.proto
type.copywithin' in that s...
Array.prototype.fill() - JavaScript
polyfill if (!array.proto
type.fill) { object.defineproperty(array.proto
type, '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.proto
type 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.proto
type.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.proto
type.bind(), and that array.proto
type.push() has its original value.
... if (!array.proto
type.filter){ array.proto
type.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.proto
type.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.proto
type.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.proto
type.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.proto
type.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.proto
type.push' in that specification.
Intl.DateTimeFormat.prototype.formatRangeToParts() - JavaScript
the intl.datetimeformat.proto
type.formatrangetoparts() method allows locale-specific tokens representing each part of the formatted date range produced by datetimeformat formatters.
... syntax intl.datetimeformat.proto
type.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.proto
type.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.proto
type.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 proto
type chain.
...inherited properties the following example differentiates between direct properties and properties inherited through the proto
type 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 proto
type for this purpose object.proto
type.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.proto
type.hasownproperty' in that specification.
Promise.prototype.catch() - JavaScript
it behaves the same as calling promise.proto
type.then(undefined, onrejected) (in fact, calling obj.catch(onrejected) internally calls obj.then(undefined, onrejected)).
... return value internally calls promise.proto
type.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.proto
type.then/catch just to add some logs (function(promise){ var originalthen = promise.proto
type.then; var originalcatch = promise.proto
type.catch; promise.proto
type.then = function(){ console.log('> > > > > > called .then on %o with arguments: %o', this, arguments); return originalthen.apply(this, arguments); }; promise.proto
type.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.proto
type.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.proto
type.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.proto
type.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.proto
type.then' in that specification.
RegExp.prototype[@@match]() - JavaScript
description this method is called internally in string.proto
type.match().
... examples direct call this method can be used in almost the same way as string.proto
type.match(), except the different this and the different arguments order.
... class myregexp extends regexp { [symbol.match](str) { let result = regexp.proto
type[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.proto
type.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.proto
type[@@match]' in that specification.
RegExp.prototype[@@matchAll]() - JavaScript
description this method is called internally in string.proto
type.matchall().
... examples direct call this method can be used in almost the same way as string.proto
type.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.proto
type[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.proto
type[@@matchall]' in that specification.
RegExp.prototype[@@search]() - JavaScript
description this method is called internally in string.proto
type.search().
... examples direct call this method can be used in almost the same way as string.proto
type.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.proto
type.search calls re[@@search].
... console.log(result); // 3 specifications specification ecmascript (ecma-262)the definition of 'regexp.proto
type[@@search]' in that specification.
RegExp.prototype[@@split]() - JavaScript
description this method is called internally in string.proto
type.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.proto
type.split(), except the different this and the different order of arguments.
... class myregexp extends regexp { [symbol.split](str, limit) { let result = regexp.proto
type[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.proto
type.split calls re[@@split].
... console.log(result); // ["(2016)", "(01)", "(02)"] specifications specification ecmascript (ecma-262)the definition of 'regexp.proto
type[@@split]' in that specification.
String.prototype.codePointAt() - JavaScript
https://mths.be/codepointat v0.2.0 by @mathias */ if (!string.proto
type.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.proto
type, 'codepointat', { 'value': codepointat, 'configurable': true, 'writable': true }); } else { string.proto
type.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.proto
type.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.proto
type.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.proto
type.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() proto
type 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.proto
type.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.proto
type.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 dlg
type 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 dlg
type 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 window
type 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=window
type 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.singletonwindow
type", "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.singletonwindow
type preference causes xulrunner to search for a window with the attribute window
type as specified in this preference (e.g.
... <window window
type="xulmine"> in our example).
calIFileType - Archive of obsolete content
summary the califile
type interface provides information about a specific file
type.
... califile
type 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 califile
type : 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.proto
type.tolocaledatestring().
...see warning: date.proto
type.tolocaleformat is deprecated for more information and migration help.
... polyfill when using the datejs library you can polyfill date.proto
type.tolocaledatestring() like this: if (!date.proto
type.tolocaleformat) { (function() { date.proto
type.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 doc
type is the required "<!doc
type 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 "<!doc
type html>" doc
type 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 doc
type in the html specification quirks mode and standards mode technical reference document.doc
type, a javascript method that returns the doc
type ...
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.mime
type ...
Prototype-based programming - MDN Web Docs Glossary: Definitions of Web-related terms
proto
type-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 proto
type-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 prthread
type { pr_user_thread, pr_system_thread } prthread
type; 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 nsmsgnavigation
type 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.nsmsgnavigation
type.nextmessage, resultid, resultindex, threadindex, true); the nsmsgnavigation
type interface is defined as a global variable in thunderbird: var nsmsgviewcommand
type = components.interfaces.nsmsgviewcommand
type; mailnews/base/public/nsimsgdbview.idlscriptable please add a summary to this article.
... togglethreadkilled 5 must match nsmsgviewcommand
type togglethreadkilled.
CSSPrimitiveValue.primitiveType - Web APIs
the primitive
type read-only property of the cssprimitivevalue interface represents the
type of a css value.
... syntax
type = cssprimitivevalue.primitive
type; 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.primitive
type); specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssprimitivevalue.primitive
type' in that specification.
CSSValue.cssValueType - Web APIs
the cssvalue
type read-only property of the cssvalue interface represents the
type of the current computed css property value.
... syntax cssvalue
type = cssvalue.cssvalue
type; 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.cssvalue
type); specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssvalue.cssvalue
type' in that specification.
Client.type - Web APIs
the
type read-only property of the client interface indicates the
type of client the service worker is controlling.
... syntax var myclient
type = 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 myactuator
type = gamepadhapticactuatorinstance.
type; value an enum of
type gamepadhapticactuator
type; currently available
types are: vibration — vibration hardware, which creates a rumbling effect.
... examples tbc specifications specification status comment gamepad extensionsthe definition of 'gamepadhapticactuator
type' 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.initdata
types 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 data
types[] = mediasystemconfiguration.initdata
types; specifications specification status comment encrypted media extensionsthe definition of 'initdata
types' in that specification.
NDEFRecord.mediaType - Web APIs
the media
type property ofthe ndefrecord interface is usvstring containing the mime
type of the record payload.
... syntax ndefrecord.media
type value a usvstring, corresponding to a mime
type of the record payload.
... specifications specification status comment web nfc, ndefrecord.media
type draft initial definition.
NetworkInformation.effectiveType - Web APIs
the effective
type 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 effective
type = networkinformation.effective
type value a string containing one of 'slow-2g', '2g', '3g', or '4g'.
... specifications specification status comment network information apithe definition of 'effective
type' in that specification.
RTCIceCandidateStats.candidateType - Web APIs
the rtcicecandidatestats interface's candidate
type property is a string which indicates the
type of ice candidate the object represents.
... syntax candidate
type = rtcicecandidatestats.candidate
type; value a domstring whose value is one of the strings found in the rtcicecandidate
type 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.candidate
type' in that specification.
RTCIceTcpCandidateType - Web APIs
the webrtc api's rtcicetcpcandidate
type enumerated
type provides a set of domstring values representing the
types of tcp candidates.
... usage notes the rtcicetcpcandidate
type type is used by the tcp
type property of rtcicecandidate objects.
... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicetcpcandidate
type' in that specification.
StorageQuota.supportedTypes - Web APIs
the supported
types read-only property of the storagequota interface returns a list of the available storage
types.
... syntax var storage
types = storagequota.supported
types value a frozen array of available storage
types.
... specifications specification status comment quota management apithe definition of 'supported
types' in that specification.
WebSocket.binaryType - Web APIs
the websocket.binary
type property returns the
type of binary data being transmitted by the connection.
... syntax var binary
type = awebsocket.binary
type; value a domstring: "blob" if blob objects are used.
... specifications specification status comment html living standardthe definition of 'websocket: binary
type' 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
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
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 (==) mis
typed as assignment (=)?" occurs when there was an assignment (=) when you would normally expect a test for equality (==).
... message warning: syntaxerror: test for equality (==) mis
typed 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.proto
type.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].proto
type.values method.
... function logiterable(it) { if (!(symbol.iterator in object.getproto
typeof(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.proto
type[@@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.proto
type.lastindexof) { array.proto
type.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.proto
type.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.proto
type.call().
... // production steps of ecma-262, edition 5, 15.4.4.17 // reference: http://es5.github.io/#x15.4.4.17 if (!array.proto
type.some) { array.proto
type.some = function(fun, thisarg) { 'use strict'; if (this == null) { throw new
typeerror('array.proto
type.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.proto
type.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.proto
type.values is default implementation of array.proto
type[symbol.iterator].
... array.proto
type.values === array.proto
type[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.proto
type.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.proto
type.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.proto
type.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.proto
type.@@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.proto
type.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.proto
type.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.proto
type.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.proto
type.name' in that specification.
Error.prototype.toString() - JavaScript
description the error object overrides the object.proto
type.tostring() method inherited by all objects.
... its semantics are as follows (assuming object and string have their original values): error.proto
type.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.proto
type.tostring' in that specification.
Intl.Collator.prototype.compare() - JavaScript
the intl.collator.proto
type.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.proto
type.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.proto
type.compare' in that specification.
Intl.DisplayNames.prototype.resolvedOptions() - JavaScript
the intl.displaynames.proto
type.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.ListFormat.prototype.resolvedOptions() - JavaScript
the intl.listformat.proto
type.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.proto
type.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.proto
type.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.proto
type.format' in that specification.
Intl.PluralRules.prototype.resolvedOptions() - JavaScript
the intl.pluralrules.proto
type.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.proto
type.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.proto
type.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.proto
type.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.proto
type.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.proto
type.tolocalestring' in that specification.
... ecmascript internationalization api (ecma-402)the definition of 'number.proto
type.tolocalestring' in that specification.
Number.prototype.toPrecision() - JavaScript
see the discussion of rounding in the description of the number.proto
type.tofixed() method, which also applies to toprecision().
... if the precision argument is omitted, behaves as number.proto
type.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.proto
type.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 proto
type chain.
...inherited properties var a = []; a.propertyisenumerable('constructor'); // returns false function firstconstructor() { this.property = 'is not enumerable'; } firstconstructor.proto
type.firstmethod = function() {}; function secondconstructor() { this.method = function() { return 'is enumerable'; }; } secondconstructor.proto
type = new firstconstructor; secondconstructor.proto
type.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 proto
type which // propertyisenumerable does not consider (even though the last two // are iteratable with for-in) o.propertyisenumerable('proto
type'); // 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.proto
type.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.proto
type.match().
... a newer function has been proposed to simplify matching multiple parts of a string (with capture groups): string.proto
type.matchall().
... if you are executing a match simply to find true or false, use regexp.proto
type.test() method or string.proto
type.search() instead.
RegExp.prototype.test() - JavaScript
test() returns a boolean, unlike the string.proto
type.search() method (which returns the index of a match, or -1 if not found).
...(this is similar to the string.proto
type.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.proto
type.exec() also advances the lastindex property.) further calls to test(str) will resume searching str starting from lastindex.
SharedArrayBuffer.prototype.slice() - JavaScript
the sharedarraybuffer.proto
type.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.proto
type.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.proto
type.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.proto
type.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.proto
type.tolocalelowercase' in that specification.
... ecmascript internationalization api (ecma-402)the definition of 'string.proto
type.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.proto
type.tolocaleuppercase' in that specification.
... ecmascript internationalization api (ecma-402)the definition of 'string.proto
type.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.proto
type.tostring().
... for string objects, the tostring() method returns a string representation of the object and is the same as the string.proto
type.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.proto
type.tostring' in that specification.
String.prototype.toUpperCase() - JavaScript
exceptions
typeerror when called on null or undefined, for example, string.proto
type.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.proto
type.touppercase.call({ tostring: function tostring() { return 'abcdef'; } }); const b = string.proto
type.touppercase.call(true); // prints out 'abcdef true'.
... console.log(a, b); specifications specification ecmascript (ecma-262)the definition of 'string.proto
type.touppercase' in that specification.
String.prototype.trimStart() - JavaScript
aliasing for consistency with functions like string.proto
type.padstart the standard method name is trimstart.
...in some engines this means: string.proto
type.trimleft.name === "trimstart"; polyfill //https://github.com/fabiovergani/js-polyfill_string-trimstart (function(w){ var string=w.string, proto=string.proto
type; (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.proto
type; ((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.proto
type.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.proto
type.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.proto
type.valueof' in that specification.
Symbol.prototype.description - JavaScript
the symbol.proto
type.description property can be used to read that description.
... it is different to symbol.proto
type.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.proto
type.description' in that specification.
attributeType - SVG: Scalable Vector Graphics
the attribute
type 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 attribute
type="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 'attribute
type' in that specification.
contentScriptType - SVG: Scalable Vector Graphics
the contentscript
type 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 'contentscript
type' in that specification.
editortype - Archive of obsolete content
« xul reference home editor
type 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 home
typetype: 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 editor
type 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.
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.message
type read-only property indicates the
type of message.
... syntax var message
type = mediakeymessageevent.message
type; specifications specification status comment encrypted media extensionsthe definition of 'message
type' 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
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.proto
type.foreach) { nodelist.proto
type.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.proto
type.foreach) { nodelist.proto
type.foreach = array.proto
type.foreach; } the above behavior is how many browsers actuall...
...y implement nodelist.proto
type.foreach() (chrome, for example).
RTCIceCredentialType - Web APIs
the webrtc api's rtcicecredential
type 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 'rtcicecredential
type' in that specification.
StyleSheet.type - Web APIs
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.proto
type.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.proto
type.encode()' in that specification.
TrackDefault.type - Web APIs
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 my
type = 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.setproto
typeof 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.setproto
typeof() 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.setproto
typeof({}); //
typeerror: object.setproto
typeof requires at least 2 arguments, but only 1 were passed you can fix this by setting null as the proto
type, for example: var obj = object.create(null); var obj = object.setproto
typeof({}, 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.proto
type.concat' in that specification.
Array.prototype.flatMap() - JavaScript
description see array.proto
type.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.proto
type.flatmap' in that specification.
Array.prototype.includes() - JavaScript
(function() { console.log(array.proto
type.includes.call(arguments, 'a')) // true console.log(array.proto
type.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.proto
type.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.proto
type.call on array.proto
type.join.
... function f(a, b, c) { var s = array.proto
type.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.proto
type.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.proto
type.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.proto
type.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.proto
type.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.proto
type.pop' in that specification.
Array.prototype.shift() - JavaScript
array.proto
type.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.proto
type.shift' in that specification.
Array.prototype.slice() - JavaScript
function list() { return array.proto
type.slice.call(arguments) } let list1 = list(1, 2, 3) // [1, 2, 3] binding can be done with the call() method of function.proto
type and it can also be reduced using [].slice.call(arguments) instead of array.proto
type.slice.call.
... let unboundslice = array.proto
type.slice let slice = function.proto
type.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.proto
type.slice' in that specification.
Array.prototype.toString() - JavaScript
object.proto
type.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.proto
type.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.proto
type.tolocalestring()' in that specification.
... ecmascript internationalization api (ecma-402)the definition of 'bigint.proto
type.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.proto
type.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.proto
type.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.proto
type.valueof' in that specification.
Date.prototype.getDay() - JavaScript
for the day of the month, see date.proto
type.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.proto
type.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.proto
type.toisostring) { (function() { function pad(number) { if (number < 10) { return '0' + number; } return number; } date.proto
type.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.proto
type.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.proto
type.tolocaledatestring' in that specification.
... ecmascript internationalization api (ecma-402)the definition of 'date.proto
type.tolocaledatestring' in that specification.
Date.prototype.toLocaleString() - JavaScript
specifications specification ecmascript (ecma-262)the definition of 'date.proto
type.tolocalestring' in that specification.
... ecmascript internationalization api (ecma-402)the definition of 'date.proto
type.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.proto
type.tolocaletimestring' in that specification.
... ecmascript internationalization api (ecma-402)the definition of 'date.proto
type.tolocaletimestring' in that specification.
Promise.prototype.finally() - JavaScript
examples using finally let isloading = true; fetch(myrequest).then(function(response) { var content
type = response.headers.get("content-
type"); if(content
type && content
type.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.proto
type.finally' in that specification.
RegExp.prototype.dotAll - JavaScript
property attributes of regexp.proto
type.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.proto
type.dotall' in that specification.
RegExp.prototype.flags - JavaScript
property attributes of regexp.proto
type.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.proto
type.flags === undefined) { object.defineproperty(regexp.proto
type, '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.proto
type.flags' in that specification.
RegExp.prototype.global - JavaScript
property attributes of regexp.proto
type.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.proto
type.global' in that specification.
RegExp.prototype.ignoreCase - JavaScript
property attributes of regexp.proto
type.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.proto
type.ignorecase' in that specification.
RegExp.prototype.multiline - JavaScript
property attributes of regexp.proto
type.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.proto
type.multiline' in that specification.
RegExp.prototype.source - JavaScript
property attributes of regexp.proto
type.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.proto
type.source' in that specification.
RegExp.prototype.sticky - JavaScript
property attributes of regexp.proto
type.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.proto
type.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.proto
type.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.proto
type.tostring' in that specification.
RegExp.prototype.unicode - JavaScript
property attributes of regexp.proto
type.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.proto
type.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.proto
type.concat' in that specification.
String.prototype.endsWith() - JavaScript
however, you can polyfill string.proto
type.endswith() with the following snippet: if (!string.proto
type.endswith) { string.proto
type.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.proto
type.endswith' in that specification.
String.prototype.includes() - JavaScript
however, you can easily polyfill this method: if (!string.proto
type.includes) { string.proto
type.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.proto
type.includes' in that specification.
String.prototype.indexOf() - JavaScript
note: for the array method, see array.proto
type.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.proto
type.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.proto
type.localecompare' in that specification.
... ecmascript internationalization api (ecma-402)the definition of 'string.proto
type.localecompare' in that specification.
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-c
types 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
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 accessible
type, 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 un
typed block is secitem, which contains a size and an un
typed c pointer variable.
...jss also provides a pure java interface for asn.1
types and ber/der encoding.
... /* nspr headers */ #include <prprf.h> #include <pr
types.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 proto
type derives from the standard object proto
type).
...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 accessible
type, 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
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 amime
type, 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 amime
type, 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 amime
type); void getitemannotationbinary(in long long aitemid, in autf8string aname,[array, size_is(adatalen)] out octet adata, out unsigned long adatalen, out autf8string amime
type); void getpageannotationinfo(in nsiuri auri, in autf8string aname, out print32 aflags, out unsigned short aexpiration, out autf8string amime
type, out unsigned short a
type); void getitemannotationinfo(...
...in long long aitemid, in autf8string aname, out long aflags, out unsigned short aexpiration, out autf8string amime
type, out unsigned short a
type); pruint16 getpageannotation
type(in nsiuri auri, in autf8string aname); pruint16 getitemannotation
type(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 proto
types, rather than being class-based.
...proto
type-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 proto
type-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 acontent
type, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amime
typeguess, in nsisupports aextra, in nsiprincipal arequestprincipal); short shouldprocess(in unsigned long acontent
type, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amime
type, 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
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.proto
type 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 nsmsgviewsort
typevalue sort
type, in nsmsgviewsortordervalue sortorder, in nsmsgviewflags
typevalue viewflags, out long count); void openwithhdrs(in nsisimpleenumerator aheaders, in nsmsgviewsort
typevalue asort
type, in nsmsgviewsortordervalue asortorder, in nsmsgviewflags
typevalue aviewflags, out long acount); void close(); void init(in nsimessenger amessengerinstance, in nsimsgwindow amsgwindow, in nsimsgdbviewcommandupdater acommandupdater); void sort(in nsmsgviewsort
typevalue sort
type, in nsmsgviewsortordervalue sortorder); void docommand(in nsmsgviewcommand
typevalue command); void docommandwithfolder(in nsmsgviewcommand
typevalue command, in nsimsgfolder destfolder); ...
...And 46 more matches
HTML documentation index - HTML: Hypertext Markup Language
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 item
type attribute, global attribute, html, html microdata, microdata, reference the global attribute item
type 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 accessible
type, 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
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.proto
type.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.proto
type.setformat = function setfo...
...rmat(format) { if (format === 'hsv') this.format = 'hsv'; if (format === 'hsl') this.format = 'hsl'; }; /*========== methods to set color properties ==========*/ color.proto
type.isvalidrgbvalue = function isvalidrgbvalue(value) { return (
typeof(value) === 'number' && isnan(value) === false && value >= 0 && value <= 255); }; color.proto
type.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.proto
type.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.proto
type.sethsv = function sethsv(hue, saturation, value) { this.hue = hue; this.saturation = saturation; this.value = value; this.hsvtorgb(); }; color.proto
type.sethsl = function sethsl(hue, saturation, lightness) { this.hue = hue; this.saturation = saturation; this.lightness = lightness; this.hsltorgb(); }; color.proto
type.sethue = function sethue(value) { if (
typeof(value) !== 'number' || isnan(value) === true || value < 0 || value > 359) return; this.hue = value; this.updatergb(); }; color.proto
type.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.proto
type=i.proto
type;}d.proto
type.constructor=d;if(a){var e=a.tolowercase();d.proto
type.$family={name:e};native.typize(d,e);}var j=function(n,l,o,m){if(!b||m||!n.proto
type[l]){n.proto
type[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.proto
type[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.proto
type[c]=="function"){b[c]=function(){var d=array.proto
type.slice.call(arguments); return b.proto
type[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, sel
type, suppressonselect, tabindex, value properties accessible
type, currentindex, currentitem, disabled, disablekeynavigation, itemcount, listboxobject, selectedcount, selectedindex, selecteditem, selecteditems, sel
type, 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, dlg
type, group, image, label, oncommand, open, orient, tabindex, title,
type, validate properties accesskey, accessible
type, autocheck, checkstate, checked, command, crop, dir, disabled, dlg
type, 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-c
types 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, sel
type, suppressonselect, tabindex, value properties accessible
type, currentindex, currentitem, disabled, disablekeynavigation, itemcount, scrollboxobject, selectedcount, selectedindex, selecteditem, selecteditems, sel
type, 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-c
types are represented by c
type 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, dlg
type, group, icon, image, label, open, orient, tabindex,
type properties accesskey, accessible
type, autocheck, checkstate, checked, command, crop, dir, disabled, dlg
type, 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 a
type, nsiuri aoverrideuri); array unwrapnodes(string blob, string a
type); 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 markpageas
typed(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 accessible
type, 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
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.proto
type; /* make love with the gc :-) */ daemon.blank.proto
type = /* important!
... */ daemon.proto
type; daemon.context.constructor = object; /* these properties can be manually reconfigured after the creation of the daemon */ daemon.proto
type.owner = daemon.context; daemon.proto
type.task = null; daemon.proto
type.rate = 100; daemon.proto
type.length = infinity; daemon.proto
type.reversals = 0; daemon.proto
type.onstart = null; daemon.proto
type.onstop = null; /* these properties should be read-only after the creation of the daemon */ daemon.proto
type.session = -1; daemon.proto
type.index = 0; daemon.proto
type.paused = true; daemon.proto
type.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 getcursor
type(); 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 a
type); obsolete since gecko 9 void sendcompositionevent(in astring a
type, in astring adata, in astring alocale); obsolete since gecko 38.0 void sendcontentcommandevent(in astring a
type, [optional] in nsitransferable atransferable); void getclassname(in object aobj); boolean sendkeyevent(in astring a
type, in long akeycode, in long acharcode, in long amodifiers, [optional] in boolean apreventdefault); obsolete since gecko 15.0 boolean sendkeyevent(in astring a
type, 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.proto
type.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.proto
type.setformat = function setfo...
...rmat(format) { if (format === 'hsv') this.format = 'hsv'; if (format === 'hsl') this.format = 'hsl'; }; /*========== methods to set color properties ==========*/ color.proto
type.isvalidrgbvalue = function isvalidrgbvalue(value) { return (
typeof(value) === 'number' && isnan(value) === false && value >= 0 && value <= 255); }; color.proto
type.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.proto
type.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.proto
type.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 proto
type 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"?> <!doc
type 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
node
type 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 node
type 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-c
types.
... these libraries are what enable js-c
types 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-c
types.
...And 34 more matches
Classes and Inheritance - Archive of obsolete content
each constructor function has an associated object, known as its proto
type, which is shared between all instances of that class.
... we will show how to define classes using constructors, and how to use proto
types to efficiently define member functions on each instance.
... classical inheritance can be implemented in javascript using constructors and proto
types.
...And 33 more matches
Introduction to using XPath in JavaScript - XPath
var xpathresult = document.evaluate( xpathexpression, contextnode, namespaceresolver, result
type, result ); parameters the evaluate function takes a total of five parameters: xpathexpression: a string containing the xpath expression to be evaluated.
... result
type: 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 accessible
type, 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
no
typeinfo 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 proto
types, 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.proto
type, although these properties may be shadowed (a.k.a.
...with object.setproto
typeof).
...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
« 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 accessible
type, 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 expire
type, [optional] in print64 expiretime); void addfromprincipal(in nsiprincipal principal, in string
type, in pruint32 permission, [optional] in pruint32 expire
type, [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
attributes accesskey, afterselected, beforeselected, command, crop, disabled, first-tab, image, label, last-tab, linkedpanel, oncommand, pending, pinned, selected, tabindex, unread, validate, value properties accesskey, accessible
type, 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, proto
type, 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, proto
types 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 proto
type 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 proto
type.
... for example: person.proto
type.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
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 doc
type.
... 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 doc
type.
... incorrect layout mode specified by doc
type.
...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 awindow
type); nsidomwindow getmostrecentwindow(in wstring awindow
type); nsidomwindow getouterwindowwithid(in unsigned long long aouterwindowid); nsisimpleenumerator getxulwindowenumerator(in wstring awindow
type); pruint32 getzlevel(in nsixulwindow awindow); native code only!
... nsisimpleenumerator getzorderdomwindowenumerator(in wstring awindow
type, in boolean afronttoback); nsisimpleenumerator getzorderxulwindowenumerator(in wstring awindow
type, 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 accessible
type, 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 accessible
type, 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, window
type 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.proto
type.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 getundotransaction
type(); unsigned long getredotransaction
type(); 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 content
typearray, [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 acontent
type, 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 content
typearray, [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 content
type, 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
formenc
type string: returns / sets the element's formenc
type attribute, containing the
type of content that is used to submit the form to the server.
... this overrides the enc
type 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
svg length interface the svglength interface correspond to the <length> basic data
type.
... interface overview also implement none methods void newvaluespecifiedunits(in unsigned short unit
type, in float valueinspecifiedunits) void converttospecifiedunits(in unsigned short unit
type) properties readonly unsigned short unit
type float value float valueinspecifiedunits domstring valueasstring constants svg_length
type_unknown = 0 svg_length
type_number = 1 svg_length
type_percentage = 2 svg_length
type_ems = 3 svg_length
type_exs = 4 svg_length
type_px = 5 svg_length
type_cm = 6 svg_length
type_mm = 7 ...
... svg_length
type_in = 8 svg_length
type_pt = 9 svg_length
type_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.unit
type + ": " + val.valueinspecifiedunits + ", valueasstring: " + val.valueasstring); // set x = 20pt and read it out in pixel and pt units val.newvaluespecifiedunits(svglength.svg_length
type_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
attributes acceltext, accesskey, allowevents, command, crop, disabled, image, label, menuactive, open, sizetopopup, tabindex, value properties accessible
type, 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 accessible
type, 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
attributes closebutton, disableclose, disabled, onclosetab, onnewtab, onselect, setfocus, selectedindex, tabbox, tabindex, tooltiptextnew, value, properties accessible
type, 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 jsexn
type 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...
...roto
type 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
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 proto
type 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.proto
type.buffer the arraybuffer referenced by this view.
... dataview.proto
type.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 editor
type 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 editor
type 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, window
type 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 aevent
type, function acallback); void removeeventlistener(string aevent
type, 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 proto
type : 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 aitem
type, 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 a
typehint, 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 acontent
type, 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.proto
type.getownpropertydescriptor and debugger.object.proto
type.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.proto
type.makedebuggeevalue to create debugger.object instances for given debuggee objects, or use debugger.object.proto
type.copy and debugger.object.proto
type.create to create new objects in debuggee compartments, allocated as if by particular debuggee globals.
... accessor properties of the debugger.object proto
type a debugger.object instance inherits the following accessor properties from its proto
type: proto the referent’s proto
type (as a new debugger.object instance), or null if it has no proto
type.
...And 20 more matches
HTTP Index - HTTP
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
attributes accesskey, command, crop, disabled, focused, group, image, label, selected, tabindex, value properties accesskey, accessible
type, 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 aitem
type, 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 aitem
type, 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 aitem
type, 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 aitem
type, 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 aitem
type, 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 atransition
type, 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
<!doc
type 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.
... <!doc
type 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.response
type =
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",data
type,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 accessible
type, 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 proto
type, 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 proto
type.
...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 markpageas
typed(in nsiuri auri); boolean canadduri(in nsiuri auri); long long addvisit(in nsiuri auri, in prtime atime, in nsiuri areferringuri, in long atransition
type, 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 proto
type of the newly created object.
... syntax object.create(proto, [propertiesobject]) parameters proto the object which should be the proto
type 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 proto
type 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 proto
type.
...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
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 npvariant
type enumeration.
... syntax
typedef struct _npvariant { npvariant
type 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 npvariant
type 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.
... query
type 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 a
type); void initwithcallback(in nsitimercallback acallback, in unsigned long adelay, in unsigned long a
type); void initwithfunccallback(in nstimercallbackfunc acallback, in voidptr aclosure, in unsigned long adelay, in unsigned long a
type); 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.proto
type.getownpropertydescriptor and debugger.object.proto
type.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.proto
type.makedebuggeevalue to create debugger.object instances for given debuggee objects, or use debugger.object.proto
type.copy and debugger.object.proto
type.create to create new objects in debuggee compartments, allocated as if by particular debuggee globals.
... accessor properties of the debugger.object proto
type a debugger.object instance inherits the following accessor properties from its proto
type: proto the referent's proto
type (as a new debugger.object instance), or null if it has no proto
type.
...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
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.proto
type.flags a string that contains the flags of the regexp object.
... regexp.proto
type.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, accessible
type, 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 accessible
type, 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 accessible
type 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 <pr
types.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 } command
type;
typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4, pubkey = 5, lab = 6, certenc= 7, certvfy= 8, sig = 9 } header
type; /* * 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 get
types(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 aactivity
type, in pruint32 aactivitysub
type, 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(s
type, nage) { this.
type = s
type; 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.proto
type.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 open
type 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 free
type 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 'proto
type' // property of the constructor function.
...dog.proto
type.
type = 'dog'; dog.proto
type.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 // 'proto
type' 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-c
types) 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/c
types.jsm'); var user32 = c
types.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', c
types.winapi_abi, c
types.bool, // return bool c
types.voidptr_t // hwnd ); var hwnd = c
types.voidptr_t(c
types.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 media
type 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 <pr
types.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 } command
type;
typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4, pubkey = 5, lab = 6, certenc= 7, certvfy= 8, sig = 9 } header
type; /* * 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, header
type 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 coord
type); long getoffsetatpoint(in long x, in long y, in unsigned long coord
type); void getrangeextents(in long startoffset, in long endoffset, out long x, out long y, out long width, out long height, in unsigned long coord
type); 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 boundary
type, out long startoffset, out long endoffset); astring gettextatoffset(in long offset, in nsaccessibletextboundary boundary
type, 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 boundary
type, out long startoffset, out long endoffset); void removeselection(in long selectionnum); void scrollsubstringto(in long startindex, in long endindex, in unsigned long scroll
type); void scrollsubstringtopoint(in long startindex, in long endindex, in unsigned long coordinate
type, 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 result
type is boolean_
type, the boolean value.
... numbervalue double if result
type is number_
type, the numeric value of the xpath value.
... result
type 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-c
types allows you to pass a regular javascript function as the callback.
...there is no concurrency logic in js-c
types, so invoking callbacks on other threads will cause things to crash.
... prerequiste understanding abi function
type declaring callbacks a callback is declared by using c
types.function
type.
...And 15 more matches
Document.evaluate() - Web APIs
syntax var xpathresult = document.evaluate( xpathexpression, contextnode, namespaceresolver, result
type, result ); xpathexpression is a string representing the xpath to be evaluated.
... result
type 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
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<jsobject*> pointer to the proto
type object to use for the new object.
... the new object will inherit all of the proto
type object's properties and methods, and the new object's __proto__ property will be a reference to the proto
type 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 xrreferencespace
type 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 result
type is boolean_
type.
...it is true if result
type 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.
... enc
type <form> defines the content
type of the form data when the method is post.
... formenc
type <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 un
typed 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.proto
type.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.proto
type.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.socket
type", 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/mime
types.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 browser
type = 'mozilla'; browser
type.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: browser
type[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: browser
type[browser
type.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 doc
type, 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 } command
type;
typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4, pubkey = 5, lab = 6 } header
type; /* 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 command
type 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 result
type 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 amime
type); native code only!
... void getplugincount(out unsigned long aplugincount); obsolete since gecko 1.8 nsiplugin getpluginfactory(in string amime
type); native code only!
... void instantiateembeddedplugin(in string amime
type, 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.proto
type.basename returns basic, core information about the locale in the form of a substring of the complete data string.
... intl.locale.proto
type.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.proto
type = { _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.proto
type = { __proto__: cryptowrapper.proto
type, _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.proto
type = { __proto__: cryptowrapper.proto
type, _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 mime
type -- 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 mime
types -- this is a subkey and contains individual mime
types 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, proto
type definition, and source code references.
...the mozilla cross reference (mxr) link for each function provides access to the function definition, proto
type definition, and source code references.
...the mozilla cross reference (mxr) link for each function provides access to the function definition, proto
type definition, and source code references.
...And 12 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 ...
... } 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 un
typed 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.proto
type.elementattributename returns.
...this is what debugger.source.proto
type.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 alist
type, in boolean entirelist, in astring abullet
type); boolean nodeisblock(in nsidomnode node); void pastenoformatting(in long aselection
type); 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 alist
type); 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
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 window
type 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 accessible
type, 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 accessible
type, 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&onlybookmarked=1&query
type=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 *component
type, 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 *component
type, 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 getvalue
type(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 proto
type object a debugger.script instance inherits the following accessor properties from its proto
type: 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.proto
type’s script, this is null.
...And 11 more matches
DevTools API - Firefox Developer Tools
showtoolbox(target [, toolid [, host
type [, hostoptions]]]) opens a toolbox for given target either by creating a new one or activating an existing one.
... host
type {string} - the position the toolbox will be placed.
...see host
type 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.proto
type.getownpropertydescriptor and debugger.object.proto
type.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 introduction
type property always being "wasm" and the former having its introduction
type 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.proto
type.getownpropertydescriptor and debugger.object.proto
type.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
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
web fonts (for cross-domain font usage in @font-face within css), so that servers can deploy true
type 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 proto
type, 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.proto
type.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-random
type" src="myfile.typ" width="50" height="50" pluginurl="http://my
typecompany.xyz/jarpacks/my
typeplugin.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, query
type, 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 <pr
types.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 } command
type;
typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4 } header
type; /* 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 <pr
types.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&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, js
type type, js::mutablehandlevalue vp); name
type description cx jscontext * the context in which to perform the conversion.
...
type js
type the
type to which the value is to be converted.
...And 10 more matches
imgIContainer
nsiframe getrootlayoutframe(); violates the xpcom interface guidelines pruint16 get
type(); 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 amime
type); 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-c
types equivalent is a c
types.uint8_t.array(###) (c
types.unsigned_char are also c
types.uint8_t).
... this feature is based on the following work: //github.com/realityripple/uxp/blob/master/js/src/c
types/c
types.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 c
types.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
instance properties blob.proto
type.size read only the size, in bytes, of the data contained in the blob object.
... blob.proto
type.
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
constants svg_angle
type_unknown some unknown
type of value.
... svg_angle
type_unspecified a unitless <number> interpreted as a value in degrees.
... svg_angle
type_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.getentriesby
type(entry
type), and performance.getentriesbyname(name, entry
type) ) 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
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, item
type, 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 item
type must have an associated itemref.
... note: find more about item
type attributes at http://schema.org/thing simple example html the following example specifies the itemscope attribute.
...And 10 more matches
Index - HTTP
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.proto
type.indexof, array.proto
type.lastindexof, and case-matching samevaluezero: used by %
typedarray% and arraybuffer constructors, as well as map and set operations, and also string.proto
type.includes and array.proto
type.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 proto
type-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 file
types 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, query
type, 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 accessible
type, 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
attributes accesskey, control, crop, disabled, href, value properties accesskey, accessible
type, 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 accessible
type, 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::selection
type (the latter is recommended because of
type safer).
... and editor sets these ime selections from mozilla::textrange
type 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-c
types required for writing jni code.
... jni.jsm contains all the js-c
types needed to communicate with the jni libraries.
... the js-c
types is abstracted away while all the underlying data is all c
type 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 data
type 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 key
type to a simple data
type; client does not need to declare or manage an entry class; nsdatahashtable data
type is a scalar such as pruint32; nsinterfacehashtable data
type is an interface; nsclasshashtable data
type 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 acontentpolicy
type); 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 acontentpolicy
type); 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 acontentpolicy
type); 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 acontentpolicy
type, ); 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 getitem
type(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 a
type, [iid_is(a
type), retval] out nsqiresult avalue); long getintpref(in string aprefname,requires gecko 54 [optional] in long adefaultvalue); long getpref
type(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 a
type, 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 is
typesupported(in acstring a
type, in nsiwebnavigation awebnav); constants support
type constants constant value description unsupported 0 returned by is
typesupported() 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 is
typesupported to detect whether a
type is supported at all.
... image 1 returned by is
typesupported() 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-c
types 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-c
types this explains how to use it in the js-c
types scope.
... three different abis exist: c
types.default_abi, c
types.stdcall_abi, and c
types.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 { npwindow
typewindow = 1, npwindow
typedrawable } npwindow
type;
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 */ npwindow
type 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
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.getproto
typeof() object.getproto
typeof() reflect.getproto
typeof() __proto__ object.proto
type.isproto
typeof() instanceof getproto
typeof method must return an object or null.
... if target is not extensible, object.getproto
typeof(proxy) method must return the same value as object.getproto
typeof(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.proto
type.size returns the number of values in the set object.
... instance methods set.proto
type.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
<!doc
type 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": <!doc
type 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": <!doc
type 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 smime
type = oscript.getattribute("
type").tolowercase(), obaton = document.createcomment(" the previous code has been automatically translated from \"" + smime
type + "\" 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 open
type 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
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 proto
type 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 proto
type (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 proto
type.
...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 proto
type).
... 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.proto
type.map() instead of array.proto
type.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.proto
type = { _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.proto
type.originalpositionfor(generatedposition) returns the original source, line, and column information for the generated source's line and column positions provided.
... sourcemapgenerator.proto
type.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.proto
type.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 } command
type;
typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4 } header
type; /* * 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 getitem
type(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 getstringevent
type(in unsigned long aevent
type); astring getstringrelation
type(in unsigned long arelation
type); 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.
... link
type 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.proto
type.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.proto
type.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 c
type the data
type of the cdata object, as a c
type.
... note: this is never c
types.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 c
types open() method.
... method overview close(); cdata declare(name, [abi, ], return
type[, arg
type1, ...]); methods close() closes the library.
... cdata declare( name[, abi, return
type arg
type1, ...] ); 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 c
types.default_abi for most libraries, except for windows libraries, which will be c
types.winapi_abi or c
types.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: <!doc
type 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 <!doc
type 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
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.proto
type.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.proto
type.classlist for ie10-ie11 browsers plus nearly compliant behavior for ie 6-9.
...string.proto
type.trim polyfill if (!"".trim) string.proto
type.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}).proto
type = 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 moz
typesat 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.item
type 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.entry
type.
... syntax observer.observe(options); parameters options a performanceobserverinit dictionary with the following possible members: entry
types: 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
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 document
type 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
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
<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 item
type and startdate and location would be itemprop's that schema.org music event defines.
... note: more about item
type 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 doc
type 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 doc
type like in this example: <!doc
type html> <html lang="en"> <head> <meta charset=utf-8> <title>hello world!</title> </head> <body> </body> </html> the doc
type shown in the example, <!doc
type 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 doc
type, 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.proto
type 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 proto
type properties // (value, get, set, enumerable, writable, configurable) (object.freeze || object)(object.proto
type); 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 proto
type 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 payload
type property, which is a one-byte value which uniquely identifies the described configuration.
...And 8 more matches
<pattern> - SVG: Scalable Vector Graphics
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.response
type = "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, { response
type: "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, mime
type, hash, name, iconurl, version, loadgroup) { return new promise(accept => this.addonmanager.getinstallforurl(url, accept, mime
type, hash, iconurl, version, loadgroup)); }, getinstallforfile: function getinstallforfile(url, mime
type) { 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 mime
type = "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, mime
type, 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, mime
type, 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 query
type 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 accessible
type, 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, query
type, 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
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 <!doc
type 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 <!doc
type 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 <!doc
type 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 doc
type 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 doc
type declaration: <!doc
type html> the easiest way to make sure that the almost standards mode is activated for html, is to use this doc
type declaration: <!doc
type 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 doc
type declaration.
...in earlier versions the doc
type 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 } command
type;
typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4 } header
type; /* * 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, header
type 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 } command
type;
typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4 } header
type; /* * 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, header
type 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 } command
type;
typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4 } header
type; /* * 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, header
type 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, sslkea
type kea
type); parameters this function has the following parameters: fd a pointer to the file descriptor for the ssl listen socket.
... kea
type 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_findcertkea
type.
...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 get
typeofindex(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 markpageas
typed(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 markpageas
typed 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 content
type.
... content
type 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 amime
type, [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 afaviconload
type, [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 amime
type, 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 response
type); nsisearchsubmission getsubmission(in astring data, [optional] in astring response
type, [optional] in astring purpose); boolean supportsresponse
type(in astring response
type); 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-c
types 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.proto
type.call, debugger.frame.proto
type.eval, and so on.
...for example, debugger.frame.proto
type.eval pushes an "eval" frame for code it runs, whereas debugger.object.proto
type.call pushes a "call" frame.
... accessor properties of the debugger.frame proto
type object a debugger.frame instance inherits the following accessor properties from its proto
type:
type a string describing what sort of frame this is: "call": a frame running a function call.
...And 7 more matches
File - Web APIs
instance properties file.proto
type.lastmodified read only returns the last modified time of the file, in millisecond since the unix epoch (january 1st, 1970 at midnight).
... file.proto
type.lastmodifieddate read only returns the last modified date of the file referenced by the file object.
... file.proto
type.nameread only returns the name of the file referenced by the file object.
...And 7 more matches
HTMLButtonElement - Web APIs
htmlbuttonelement.formenc
type is a domstring reflecting the
type of content that is used to submit the form to the server.
... if specified, this attribute overrides the enc
type 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 is
typesupported() or the htmlmediaelement method canplay
type().
...the configuration requires the
type of media being tested — e.g.
... a plain file or mediasource — and a videoconfiguration including values for the content
type, width, height, bitrate, and framerate: the content
type 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 pointer
type 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_method
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.
... textpath_method
type_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.response
type = "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.response
type = "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 open
type parameters.
...it corresponds to the open
type value hist.
...it corresponds to the open
type value salt, like salt 2.
...And 7 more matches
<form> - HTML: Hypertext Markup Language
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
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.proto
type.message error message.
... although ecma-262 specifies that urierror should provide its own message property, in spidermonkey, it inherits error.proto
type.message.
...And 7 more matches
instanceof - JavaScript
the instanceof operator tests to see if the proto
type property of a constructor appears anywhere in the proto
type chain of an object.
... constructor function to test against description the instanceof operator tests the presence of constructor.proto
type in object's proto
type chain.
... // defining constructors function c() {} function d() {} let o = new c() // true, because: object.getproto
typeof(o) === c.proto
type o instanceof c // false, because d.proto
type is nowhere in o's proto
type chain o instanceof d o instanceof object // true, because: c.proto
type instanceof object // true c.proto
type = {} let o2 = new c() o2 instanceof c // true // false, because c.proto
type is nowhere in // o's proto
type chain anymore o instanceof c d.proto
type = new c() // add c to [[proto
type]] linkage of d let o3 = new d() o3 instanceof d // true o3 instanceof c // true since c.proto
type is now in o3's proto
type chain note that the value of an instanceof test can change based on changes to the proto
type 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
value
type: <string> ; default value: none; animatable: no contentscript
type deprecated since svg 2 the default scripting language used by the svg fragment.
... value
type: <string> ; default value: application/ecmascript; animatable: no contentstyle
type 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: <!doc
type 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.proto
type.hasownproperty.call), the same set of keys (although not necessarily the same order), equivalent values for every corresponding key, and an identical "proto
type" 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 proto
types"); 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(dlg
type);, where gdialog is the <dialog> element and dlg
type 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"?> <!doc
type 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"?> <!doc
type 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 proto
type 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 doc
type specification.
...(doc
type and modes are explained in more detail in article mozilla's doc
type 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 component
type, 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 component
type 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
--> <!doc
type 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 - < 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 --> <!doc
type 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; }...
...--> <!doc
type 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: <!doc
type 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.proto
type = { 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.proto
type = { 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, response
type; 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 content
type = 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
browsers use the doc
type 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 doc
type declaration at the start of your html will improve browser standards compliance.
...documents with an incomplete, incorrect, or missing doc
type declaration or a known doc
type 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_get
type (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 proto
types 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 sslkea
type 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
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 proto
type chain, and then traversing the parent chain.
... order of lookups in a two-deep scope chain with proto
types.
... to do this we set an object's proto
type.
...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, js
type type, js::mutablehandlevalue vp); name
type description cx jscontext * the context in which the convert is taking place.
... hint js
type 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 aaction
type ); void invokedragsessionwithimage(in nsidomnode adomnode, in nsisupportsarray atransferablearray, in nsiscriptableregion aregion, in unsigned long aaction
type, 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 aaction
type, 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 aaction
type ); 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 os
type 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 setfile
typeandcreatorfromextension(in string aextension); obsolete since gecko 1.9.2 void setfile
typeandcreatorfrommime
type(in string amime
type); 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 os
type 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-c
types.
... declaring a js-c
types 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 c
types.struct
type("st_t", [ { "self": c
types.pointer
type(c
types.void_t) }, { "str": c
types.pointer
type(c
types.char) }, { "buff_size": c
types.size_t }, { "i": c
types.int }, { "f": c
types.float }, { "c": c
types.char } ]); here we are using the struct
type() factory method of the c
types object to create a c
type 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 proto
type object a debugger instance inherits the following accessor properties from its proto
type: 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 sub
types: 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.entry
type property.
... the value of both depends on the sub
type.
...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", entry
type: "mark"}); parameters performanceentryfilteroptionsoptional is a performanceentryfilteroptions dictionary, having the following fields: "name", the name of a performance entry.
... "entry
type", 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 getentriesby
type().
... 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 + "; entry
type: " + pe.entry
type + "; 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, entry
type) to get specific entries p = performance.getentries({name : "measure1", entry
type: "measure"}); for (var i=0; i < p.length; i++) { log("begin and measure [" + i + "]"); print_perf_entry(p[i]); } // use getentriesby
type() to get all "mark" entries p = performance.getentriesby
type("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 initiator
type (such as an html element).
... getentriesbyname() returns the recorded performance entries based on the specified name and optionally the performance
type.
... getentriesby
type() 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 rtcstats
type.
... 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 orient
type 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 response
type 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 response
type, as an arraybuffer, blob, document, json, or string.
... var oreq = new xmlhttprequest(); oreq.open("get", "/myfile.png", true); oreq.response
type = "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 response
type 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 response
type property.
... syntax var body = xmlhttprequest.response; value an appropriate object based on the value of response
type.
... you may attempt to request the data be provided in a specific format by setting the value of response
type 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
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.proto
type.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.proto
type.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
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
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 mime
type 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 mime
type="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 mime
type="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
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
formenc
type 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 enc
type attribute of the button's form owner.
...And 6 more matches
<menuitem> - HTML: Hypertext Markup Language
(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
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.proto
type.call()).
...symbol.iterator : 'symbol(symbol.iterator)'; } catch { symboliterator = 'symbol(symbol.iterator)'; } var tostr = object.proto
type.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.proto
type.message error message.
... although ecma-262 specifies that urierror should provide its own message property, in spidermonkey, it inherits error.proto
type.message.
... webassembly.compileerror.proto
type.name error name.
...And 6 more matches
WebAssembly.LinkError - JavaScript
instance properties webassembly.linkerror.proto
type.message error message.
... although ecma-262 specifies that urierror should provide its own message property, in spidermonkey, it inherits error.proto
type.message.
... webassembly.linkerror.proto
type.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 mis
typedvariable exists mis
typevariable = 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.proto
type; // 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
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
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: <!doc
type 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.
... content
type 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 query
type 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="*" query
type="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 sub
types.
... 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
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 accessible
type, 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.doc
type 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.doc
type 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
<!doc
type 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.
... nscom
typeinfo<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(a
type); promise<downloadsummary> getsummary(a
type); 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" action
type="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" action
type="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" action
type="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" action
type="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" action
type="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 = { "fooproto
type", /* 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 &setintroduction
type(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 introduction
type, 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 &setintroduction
type(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, jsexn
type 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, jsexn
type 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 jsexn
type the exception's
type.
... stack js::handlestring or js::handleobject the value of error.proto
type.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
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 getvalue
type().
...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 event
typearg, 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 aserializeinterface
type); 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 getavailableservice
types(); 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 a
type); 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 a
type ); parameters aeventtarget the nsidomeventtarget for which to check if this has any listener for a
type.
...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 getwrappednativeproto
type(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 restorewrappednativeproto
type(in jscontextptr ajscontext, in jsobjectptr ascope, in nsiclassinfo aclassinfo, in nsixpconnectjsobjectholder aproto
type); 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, homephone
type work contact.
... same as home, but with `work' instead of `home' other contact: faxnumber, faxnumber
type pagernumber, pagernumber
type cellularnumber, cellularnumber
type 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 a
type); 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 proto
type provides the xpcom entry-point into a module.nsiabcard/thunderbird3the nsiabcard interface is used to represent and manipulate cards in the address book.
... nsmsgnavigation
typethe nsmsgnavigation
type interface contains constants used for message navigation in thunderbird.
...it is (as far as i can tell) not currently used anywhere in thunderbird.nsmsgviewcommand
typethe nsmsgviewcommand
type 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.context
type = "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.context
type = process.context
type; // 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 : { content
type: "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: " + content
type) }); } 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
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, document
type, 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 mime
type 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.getentriesby
type("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.getentriesby
type("resource"); if (list === undefined) { console.log("= display size data: performance.getentriesby
type() 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.proto
type.encodingread only always returns "utf-8".
... textencoder.proto
type.encode() takes a usvstring as input, and returns a uint8array containing utf-8 encoded text.
... textencoder.proto
type.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.proto
type.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.proto
type.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(referencespace
type); 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 xrreferencespace
type enumerated
type.
...And 5 more matches
attr() - CSS: Cascading Style Sheets
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 open
type value, then it synthesizes the glyphs.
... small-caps enables display of small capitals (open
type feature: smcp).
... all-small-caps enables display of small capitals for both upper and lowercase letters (open
type 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
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 item
type 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 fruit
type evaluates to 'bananas', the program matches the value with case 'bananas' and executes the associated statement.
... switch (fruit
type) { 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 ${fruit
type}.`); } 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.proto
type.global i case-insensitive search.
... regexp.proto
type.ignorecase m multi-line search.
...And 5 more matches
Classes - JavaScript
classes in js are built on proto
types but also have some syntax and semantics that are not shared with es5 classalike semantics.
... proto
type 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 proto
type and static methods when a static or proto
type 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 proto
type if the merge sources contain getters.
... for copying property definitions (including their enumerability) into proto
types, 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 proto
type.
... this method makes the [[proto
type]] of the target immutable; any [[proto
type]] 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.proto
type.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.proto
type.toexponential(), number.proto
type.tofixed() or number.proto
type.toprecision().
... instance properties rangeerror.proto
type.message error message.
... although ecma-262 specifies that rangeerror should provide its own message property, in spidermonkey, it inherits error.proto
type.message.
...And 5 more matches
Object initializer - JavaScript
values of object properties can either contain primitive data
types or other objects.
... shallow-cloning (excluding proto
type) or merging objects is now possible using a shorter syntax than object.assign().
... proto
type 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 proto
type chain, then, after deletion, the object will use the property from the proto
type 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
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
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
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 overridemime
type to force the response to be parsed as xml.
... request.overridemime
type("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
note: this page documents the jetpack proto
type, 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="*" query
type="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: add
type 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" window
type="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, query
type, 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
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 mime
types 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.objec
type and has these parts: appname name of the application providing the object.
... objec
type 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.proto
type.call() function.proto
type.apply() date.utc() date.proto
type.getfullyear() date.proto
type.setfullyear() date.proto
type.getmilliseconds() date.proto
type.setmilliseconds() date.proto
type.getutcfullyear() date.proto
type.getutcmonth() date.proto
type.getutcdate() date.proto
type.getutchours() date.proto
type.getutcminutes() date.proto
type.getutcseconds() date.proto
type.getutcmilliseconds() ...
...date.proto
type.toutcstring() date.proto
type.setutcfullyear() date.proto
type.setutcmonth() date.proto
type.setutcdate() date.proto
type.setutchours() date.proto
type.setutcminutes() date.proto
type.setutcseconds() date.proto
type.setutcmilliseconds() other new features strict equality operators unicode support a javascript console was introduced.
... array.proto
type.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.proto
type.tolocaleformat()the non-standard tolocaleformat() method converts a date to a string using the specified formatting.
...see also the newer version of date.proto
type.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 proto
type method for object its also available in function object.proto
type.myfunction = function() {}; alert(object.myfunction); //available in object alert(function.myfunction); //available in function also the opposite is correct, when we create a proto
type method for function it is available in object function.proto
type.myfunction = function() {}; alert(object.myfunction); //available in object a...
...lert(function.myfunction); //available in function so no matter what we proto
type function or object , it will be available in both...
...And 4 more matches
Implementation Status - Archive of obsolete content
data
types section title status notes bugs 5.1 xml schema built-in data
types partial whitespace facet not supported.
... 5.2.1 additional xforms data
types 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 p3p
type ...
...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: <!doc
type 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, msg
type) { 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 proto
type.
...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 doc
types 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 doc
type "http...
...://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd" a complete doc
type contains a public identifier and a system identifier.
... in discussions of doc
types, many people will refer to a doc
type 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-c
types 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 proto
type 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 data
type 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 afaviconload
type, [optional] in nsifavicondatacallback acallback); void replacefavicondata(in nsiuri afaviconuri, [const,array,size_is(adatalen)] in octet adata, in unsigned long adatalen, in autf8string amime
type, [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 amime
type 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 amime
type 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 adownload
type, 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 aselection
type); void pasteasquotation(in long aselection
type); 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 a
type, 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 a
type, 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.
... process
type 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-c
types 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, npmime
type type, npstream *stream, npbool seekable, uint16* s
type); 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.proto
type object ifdbg is a debugger instance, then <i>dbg</i>.memory is a debugger.memory instance, which inherits the following accessor properties from its proto
type: 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.proto
type.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
syntax let domparser = new domparser() methods domparser.parsefromstring() syntax let doc = domparser.parsefromstring(string, mime
type) return either document or xmldocument depending on the mime
type argument.
... mime
type a domstring.
...the possible values are the following: mime
type 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
it implements the properties of parentnode, childnode, nondocument
typechildnode, and animatable.
... nondocument
typechildnode.nextelementsibling read only is an element, the element immediately following the given one in the tree, or null if there's no sibling node.
... nondocument
typechildnode.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.entry
type 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.effective
type; function updateconnectionstatus() { console.log("connection
type changed from " +
type + " to " + connection.effective
type);
type = connection.effective
type; } 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 rtcsdp
type describing the session description's
type.
... constants rtcsdp
type 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 entry
type 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 xrreferencespace
type 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.proto
type.slice.call(arguments, 2); return __nativest__(vcallback instanceof function ?
...*/ ) { var aargs = array.proto
type.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 proto
type 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 response
type 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 response
type 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.response
type = "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 xrreferencespace
type 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 xrreferencespace
type 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
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 eventproto
type 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
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
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 item
type="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 item
type="http://schema.org/product"> <span itemprop="name">panasonic white 60l refrigerator</span> <img src="panasonic-fridge-60l-white.jpg" alt=""> <div itemprop="aggregaterating" itemscope item
type="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
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 file
types 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.proto
type.message error message.
... although ecma-262 specifies that evalerror should provide its own message property, in spidermonkey, it inherits error.proto
type.message.
... evalerror.proto
type.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 proto
type 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.proto
type, 'constructor' ); base.proto
type = object.create(sup.proto
type); var handler = { construct: function(target, args) { var obj = object.create(base.proto
type); 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.proto
type, 'constructor', descriptor); return proxy; } v...
...ar person = function(name) { this.name = name; }; var boy = extend(person, function(name, age) { this.age = age; }); boy.proto
type.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.proto
type.message error message.
... although ecma-262 specifies that referenceerror should provide its own message property, in spidermonkey, it inherits error.proto
type.message.
... referenceerror.proto
type.name error name.
...And 4 more matches
Reflect.construct() - JavaScript
it gives also the added option to specify a different proto
type.
... newtarget optional the constructor whose proto
type should be used.
... exceptions a
typeerror, if target or newtarget are not constructors.
...And 4 more matches
SyntaxError - JavaScript
instance properties syntaxerror.proto
type.message error message.
... although ecma-262 specifies that syntaxerror should provide its own message property, in spidermonkey, it inherits error.proto
type.message.
... syntaxerror.proto
type.name error name.
...And 4 more matches
URIError - JavaScript
instance properties urierror.proto
type.message error message.
... although ecma-262 specifies that urierror should provide its own message property, in spidermonkey, it inherits error.proto
type.message.
... urierror.proto
type.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.proto
type.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 proto
type object — this can be modified to affect all global instances.
... instance properties global.proto
type.constructor returns the function that created this object's instance.
... global.proto
type[@@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 proto
type 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.proto
type.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.proto
type === "object") { partial.proto
type = object.create(constructor.proto
type); } 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.proto
type.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.proto
type and string.proto
type, 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 proto
type chain (properties of nearer proto
types take precedence over those of proto
types further away from the object in its proto
type chain).
...therefore, it is better to use a for loop with a numeric index (or array.proto
type.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
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
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
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
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 doc
type 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.proto
type.get() on an existing table.
... they are real functions in the previous example, the return value of each table.proto
type.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.proto
type); dom(view).element = element; // ....
... } view.proto
type.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.proto
type); 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: <!doc
type 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 <!doc
type 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 doc
type, and kaboom!
... now let's see what that same simple table looks like in a modern browser when the page has a strict doc
type.
... you can do this by using a doc
type that will trigger either "quirks" mode or "almost standards" mode, or not having a doc
type 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) mime
type reflects the data
type handled by the plugin.
...should either be like "application/x-vnd-yourorganization-yourfile
type" 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, editor
type, 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 virtual
type.
... 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: <!doc
type 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="." query
type="simpledata"> <template> <row uri="?"> ...
...the query
type 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 query
type 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="*" query
type="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="*" query
type="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"?> <!doc
type 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: <!doc
type 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
attributes onerror, onload, src, validate properties accessible
type, 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 mime
types 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> | <gradient
type> | <startcolor> | <startcolorstr> ]# where <enabled> = 'enabled=' [ true | false ] <endcolor> = 'startcolor=' <color> <endcolorstr> = 'startcolorstr=' <color> <gradient
type> = 'gradient
type=' <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.proto
type.fill() (firefox 31) array.proto
type.find(), array.proto
type.findindex() (firefox 25) array.proto
type.entries(), array.proto
type.keys() (firefox 28), array.proto
type.values() array.proto
type.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.proto
type.f...
...oreach() (firefox 25) map.proto
type.entries() (firefox 20) map.proto
type.keys() (firefox 20) map.proto
type.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.proto
type.foreach() (firefox 25) set.proto
type.entries(), set.proto
type.keys(), set.proto
type.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.proto
type.__proto__ has been standardized object.is() (firefox 22) object.setproto
typeof() (firefox 31) object.assign() (firefox 34) object.getownpropertysymbols() (firefox 33) additions to the date object date.proto
type is an ordinary object (firefox 41) generic date.proto
type.tostring (firefox 41) date.proto
type[@@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 media
type attribute directly on the upload element or by placing a media
type 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
<!doc
type 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.response
type =
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 response
type 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.response
type = '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.
... content
type 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 content
type 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 sslhandshake
type - 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 <pr
types.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 h
type; 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 (h
type = 0; h
type < hash_algtotal; h
type++) { fprintf(stderr, hash_names[h
type].hashname); if...
... (h
type == (hash_algtotal - 2)) fprintf(stderr, " or "); else if (h
type != (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
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
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.getundefined
type() 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.proto
type.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 proto
type property, so that they meet the requirements for standard built-in functions as described in the ecmascript language specification 5.1, clause 15.
...a proto
type 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_setproto
type 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 proto
type 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 proto
type types.
... value proto
type in javascript jsproto_null a dummy key for invalid proto
type.
...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 proto
type 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 proto
type, 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 proto
type property.
...if the constructor does not have a proto
type 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, js
type 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, amime
type); getitemannotationstring(aitemid, aname); getitemannotationint32(aitemid, aname); getitemannotationint64(aitemid, aname); getitemannotationdouble(aitemid, aname); getitemannotationbinary(aitemid, aname, adata, adatalen, amime
type); 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 mime
type 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 *component
type, 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 content
type, 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
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 data
type, 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 data
type, 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 mailnews
types2.idl.
...the
typedef of nsmsgkey is given in mailnews
types2.idl.
...the
typedef of nsmsgkey is given in mailnews
types2.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 content
type 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.proto
type = { 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.proto
type.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 localstore
type 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 atransition
type, 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 gettableselection
type(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 format
type, 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> asocket
types, 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 acontent
type, 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 acontent
type 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-c
types.
... general using c struct and pointers an example on how to use basic c data
types with js-c
types.
... using objective-c from js-c
types an example how to use objective-c from js-c
types, 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 proto
type object a debugger.environment instance inherits the following accessor properties from its proto
type: 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 introduction
type property always being "wasm" and the former having its introduction
type property never being "wasm".
... accessor properties of the debugger.source proto
type object a debugger.source instance inherits the following accessor properties from its proto
type: text if the instance refers to javascript source, the javascript source code, as a string.
...for function.proto
type’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 content
type); file getfile(in domstring name, [optional] in domstring content
type); methods append() appends the contents of the specified javascript object to the blob being built.
... blob getblob( in domstring content
type optional ); parameters content
type 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
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 nondocument
typechildnode interface.
... nondocument
typechildnode.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
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 <!doc
type 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
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.content
type 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: <!doc
type html> <h1> hello world!
... </h1> this source code contains a couple of line feeds after the doc
type 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: <!doc
type 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, mime
type, qualityargument); parameters callback a callback function with the resulting blob object as a single argument.
... mime
type optional a domstring indicating the image format.
...And 3 more matches
HTMLFormElement - Web APIs
htmlformelement.encoding or htmlformelement.enc
type a domstring reflecting the value of the form's enc
type 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(mime
type); parameters mime
type a domstring specifying the mime
type of the sourcebuffer to create and add to the mediasource.
... exceptions invalidaccesserror the value specified for mime
type 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 = { mime
type: "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 entry
type 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.pointer
type 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.proto
type.foreach.call(trs, function(gridrow, i){ array.proto
type.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.proto
type.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 open
type fonts.
... syntax /* use the default settings */ font-feature-settings: normal; /* set values for open
type 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 open
type 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 open
type 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 open
type 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
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 true
type, open
type, 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 true
type or open
type 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
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
code
typehtml 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
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
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: <!doc
type 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.
... <!doc
type 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
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 enc
type attribute of the <form> element or the formenc
type 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
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.proto
type.message error message.
... internalerror.proto
type.name error name.
... internalerror.proto
type.filename path to file that raised this error.
...And 3 more matches
Intl.DisplayNames - JavaScript
instance methods intl.displaynames.proto
type.of() this method receives a code and returns a string based on the locale and options provided when instantiating intl.displaynames.
... intl.displaynames.proto
type.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.proto
type.then() and promise.proto
type.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.proto
type.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.proto
type.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 proto
type of this: class example { constructor() { const proto = object.getproto
typeof(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.proto
type.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.proto
type.bind().
... o.b = {g: independent, prop: 42}; console.log(o.b.g()); // 42 this on the object's proto
type chain the same notion holds true for methods defined somewhere on the object's proto
type 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.proto
type[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 action
type attribute, which accepts several values.
... attributes action
type the action which specifies what happens for this element.
...the syntax is: <maction action
type="statusline"> expression message </maction>.
...And 3 more matches
Navigation and resource timings - Web Performance
you can also create marks: performance.getentriesby
type('navigation').foreach((navigation) => { console.dir(navigation); }); performance.getentriesby
type('resource').foreach((resource) => { console.dir(resource); }); performance.getentriesby
type('mark').foreach((mark) => { console.dir(mark); }); performance.getentriesby
type("measure").foreach((measure) => { console.dir(measure); }); performance.getentriesby
type('paint').foreach((paint) => ...
...{ console.dir(paint); }); performance.getentriesby
type('frame').foreach((frame) => { console.dir(frame); }); in supporting browsers, you can use performance.getentriesby
type('paint') to query the measure for first-paint and first-contentful-paint.
... we use performance.getentriesby
type('navigation') and performance.getentriesby
type('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 proto
type 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
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
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 proto
type argument, in order to make the returned promise and all the subsequent promises decendents of that proto
type: 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 proto
type 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.proto
type = extend(panel.proto
type, { 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.proto
type.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.proto
type[method] = function() { this.ctx[method].apply(this.ctx, arguments); return this; }; } for (let m of gettermethods) { let method = m; canvas2dcontext.proto
type[method] = function() { return this.ctx[method].apply(this.ctx, arguments); }; } for (let p of props) { let prop = p; canvas2dcontext.proto
type[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) <!doc
type 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.proto
type.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 proto
type, 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.proto
type.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.proto
type or window.proto
type, accessing this.document.queryselector, or following the jquery style of chaining by returning 'this' within each proto
type method of $()): htmldocument.proto
type.$ = function (selector) { // only for html return this.queryselector(selector); }; example: <h1>test!</h1> <script> htmldocument.proto
type.$ = function (selector) { return this.queryselector(select...
...or); }; alert(document.$('h1')); // [object htmlheadingelement] </script> xuldocument.proto
type.$ = function (selector) { // only for xul return this.queryselector(selector); }; example: <label value="test!"/> <script
type="text/javascript"><![cdata[ xuldocument.proto
type.$ = function (selector) { // only for xul return this.queryselector(selector); }; alert(document.$('label')); // [object xulelement] ]]></script> document.proto
type.$ = 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-c
types 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:parse
type="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:parse
type="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.proto
type = { 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.proto
type = { 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.singletonwindow
type xulauncher ant script to assemble an extension application/http-index-format specification calicalendarview calicalendarviewcontroller califile
type 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): <!doc
type 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 dump
types.cc:
typedef int myint; struct foo { int i; char *c; }; save the following analysis script dump
types.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=~/dump
types.js -o/dev/null -c dump
types.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 parse
type="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:parse
type="date">1125966767295<r:date> </rdf:description> </rdf:rdf> you can also specify parse
type="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 query
type attribute on the root node of the template to the value xml.
... an example: <listbox datasources="people.xml" ref="*" query
type="xml"> <template> ...
...here is an example: <listbox datasources="people.xml" ref="*" query
type="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="search
type"> <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 accessible
type, 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 toopenwindowby
type() needs to be defined.
...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, npmime
type type, npstream* stream, npbool seekable, uint16* s
type); parameters the function has the following parameters: instance pointer to current plug-in instance.
...
type pointer to mime
type of the stream.
... s
type 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
getwrappedexception
type instance method getwrappedexception
type 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.mime
types) { // 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.mime
types player = navigator.mime
types["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 proto
types 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 proto
types 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: <!doc
type 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 doc
type 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: <!doc
type 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: <!doc
type 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: <!doc
type 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 enc
type 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 enc
type 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: <!doc
type 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
Adding features to our bouncing balls demo - Learn web development
remember to set the ball() constructor's proto
type 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 proto
type and constructor properties correctly.
...it will work in a very similar way, so you can start by copying the ball.proto
type.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 proto
type: ball.proto
type.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 proto
type: ball.proto
type.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.
... area
type 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-c
types.
...useful, for instance, to access the platform code from javascript in conjunction with js-c
types.
...useful mostly for using js-c
types 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 { prdesc
type 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_mapsignkey
type().
... 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 <pr
types.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 h
type; 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 (h
type = 0; h
type < hash_algtotal; h
type++) { fprintf(stderr, hash_names[h
type].hashname); if...
... (h
type == (hash_algtotal - 2)) fprintf(stderr, " or "); else if (h
type != (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 <pr
types.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 h
type; 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 (h
type = 0; h
type < hash_algtotal; h
type++) { fprintf(stderr, hash_names[h
type].hashname); ...
... if (h
type == (hash_algtotal - 2)) fprintf(stderr, " or "); else if (h
type != (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 <pr
types.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 <pr
types.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 <pr
types.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 <pr
types.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 <pr
types.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 <pr
types.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.proto
type.tostring and object.proto
type.tostring version 1.2 only returns array or object literal notation ("[1]" or "{a:1, b:2}" for example).
... string.proto
type.substring for version 1.2 only, the two arguments are not swapped if the first argument is less than the second one.
... string.proto
type.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 proto
types and to parent scopes.
... default serialization would serialize the object or function we desired but would also serialize object.proto
type 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 proto
types 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/proto
type/constructor for a standard class.
... syntax jsprotokey js::identifystandardinstance(jsobject *obj); jsprotokey js::identifystandardproto
type(jsobject *obj); jsprotokey js::identifystandardinstanceorproto
type(jsobject *obj); jsprotokey js::identifystandardconstructor(jsobject *obj); // added in spidermonkey 38 name
type description obj jsobject * pointer to the instance/proto
type/constructor object to determine.
... js::identifystandardproto
type determines if the given object is a proto
type 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, js
type hint, js::mutablehandlevalue vp); name
type description cx jscontext * the context in which to perform the conversion.
... hint js
type the hint to pass to the toprimitive and @@toprimitive method when converting the object.
... hint must be js
type_string or js
type_number to pass the corresponding
type as a hint, or js
type_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 exn
type; } jserrorformatstring; name
type description format const char * the error format string in ascii.
... exn
type int16_t one of the jsexn
type 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.proto
type.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 proto
types, 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 proto
type.
... see js_getproto
type.
...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.proto
type.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 proto
type chain is affected.
... assigning to obj.x, where obj inherits a non-shared property from its proto
type, creates a new own data property on obj; the proto
type'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.proto
type = { // this must match whatever is in chrome.manifest!
...each component proto
type // 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 data
type 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 transaction
type); 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 getmime
typefromcontent(in nsirequest arequest, [const,array,size_is(alength)] in octet adata, in unsigned long alength); methods getmime
typefromcontent() 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 data
type 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 aencoding
type); nsistreamlistener docontent(in acstring amimecontent
type, 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 aencoding
type ); 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 sort
type, in boolean reversesort); attributes attribute
type description reversesort boolean if true results will be sorted in ascending order.
... sort
type short the current sort
type in effect.
...void sort( in short sort
type, in boolean reversesort ); parameters sort
type one of the sort* constants.
...And 2 more matches
nsIFrameLoader
method overview void activateframeevent(in astring a
type, in boolean capture); void activateremoteframe(); void destroy(); void loadframe(); void loaduri(in nsiuri auri); void sendcrossprocesskeyevent(in astring a
type, in long akeycode, in long acharcode, in long amodifiers, [optional] in boolean apreventdefault); void sendcrossprocessmouseevent(in astring a
type, 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 a
type, in boolean capture ); parameters a
type 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 content
type, 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.
... content
type 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 a
type); boolean isalive(); void settimeout(in unsigned long a
type, 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 a
type ); parameters a
type 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 proxy
type, void * *result); ns_imethod getproxy(nsieventqueue *destqueue, const nsiid & cid, nsisupports *aouter, const nsiid & iid, print32 proxy
type, 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 postcreateproto
type(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_proto
type 1 << 25 dont_share_proto
type 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
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, result
type) evaluates the xpath xpath expression in the context of element and returns an array of matching nodes.
...the result
type 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
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.
... node
type this property now always returns 2 (attribute_node).
... schema
typeinfo 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
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.
... <!doc
type 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 document
type domerror domexception domimplementation domstring domtimestamp domstringlist domtokenlist element event eventtarget htmlcollection mutationobserver mutationrecord namednodemap node nodefilter nodeiterator nodelist nondocument
typechildnode 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
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.code
type is a domstring that reflects the code
type 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 value
type has the "ref" value.
... it reflects the
type attribute.
... htmlparamelement.value
type 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 { ?> <!doc
type 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 { ?> <!doc
type 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 { ?> <!doc
type 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: mime
type: 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 mime
type is supported by the user agent by calling mediarecorder.is
typesupported().
...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.mime
type read only returns the mime
type that was selected as the recording container for the mediarecorder object when it was created.
... static methods mediarecorder.is
typesupported() 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.entry
type property.
... syntax var name = entry.name; return value the return value depends on the sub
type of the performanceentry object and the value of performanceentry.entry
type, as shown by the table below.
... value sub
type entry
type 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({entry
types: ["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 tcp
type 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
candidate
type optional a string matching one of the values in the rtcicecandidate
type enumerated
type, indicating what kind of candidate the object provides statistics for.
... network
type optional a string from the rtcnetwork
type enumerated
type which indicates the
type of interface used for a local candidate.
... example this example features a function, isusablenetwork
type(), whose job it is to look at an rtcicecandidatestats object's network
type 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 payload
type optional the rtp payload
type used to identify this codec.
... mime
type optional the codec's mime media
type and sub
type specified as a domstring of the form "
type/sub
type".
...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 svgunit
types.
...And 2 more matches
SVGPathSeg - Web APIs
interface overview also implement none methods none properties unsigned short pathseg
type domstring pathseg
typeasletter 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.proto
type.encodingread only is a domstring containing the name of the decoder, that is a string describing the method the textdecoder will use.
... textdecoder.proto
type.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 err
type; 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) { err
type = 'securitycertificate'; } else { err
type = '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 = 'securityunsupportedcertificate
typeerror'; 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 response
type 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.overridemime
type() 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.response
type, that contains the response entity body.
... xmlhttprequest.response
type is an enumerated value that defines the response
type.
...And 2 more matches
XRPermissionDescriptor.requiredFeatures - Web APIs
currently, all features are members of the xrreferencespace
type 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.
... xrreferencespace
type 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 xrreferencespace
type 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.
... xrreferencespace
type 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 open
type fonts.
... font-variation-settings allows low-level control over open
type or true
type 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("true
type"); the available
types are: "woff", "woff2", "true
type", "open
type", "embedded-open
type", 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
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 open
type values ruby.
...possible values are: keyword standard defining the glyphs open
type 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 open
type 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 <!doc
type 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("<!doc
type 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
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
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
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
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
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 item
type attributes.
... also, itemid can only be specified on elements that possess an itemscope attribute whose corresponding item
type refers to or defines a vocabulary that supports global identifiers.
... the exact meaning of an item
type'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 add
type 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:[<media
type>][;base64],<data> the media
type 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
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
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
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
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 proto
type chain.
... property enumerability and ownership - built-in methods of detection, retrieval, and iteration functionality own object own object and its proto
type chain proto
type 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); }, getproto
typeenumerables: function(obj) { return this._getpropertynames(obj, false, true, this._enumerable); }, getproto
typenonenumerables: function(obj) { return this._getpropertynames(obj, false, true, this._notenumerable); }, getproto
typeenumerablesandnonenumerables: function(obj) { return this._getpropertynames(obj, false, true, this._enumerableandnotenumerable); ...
...And 2 more matches
Keyed collections - JavaScript
an object has a proto
type, 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 proto
type 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.proto
type.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 proto
type 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 proto
type chain.
...just as in public instance methods, if you're in a subclass you can access the superclass proto
type using super.
...And 2 more matches
Deprecated and obsolete features - JavaScript
string methods html wrapper methods like string.proto
type.fontsize and string.proto
type.big.
... string.proto
type.quote is removed from firefox 37.
... non standard flags parameter in string.proto
type.search, string.proto
type.match, and string.proto
type.replace are deprecated.
...And 2 more matches
The arguments object - JavaScript
however, it can be converted to a real array: var args = array.proto
type.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.proto
type.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.proto
type.apply(thisarg [, argsarray]) calls a function and sets its this to the provided thisarg.
... function.proto
type.bind(thisarg[, arg1[, arg2[, ...argn]]]) creates a new function which, when called, has its this set to the provided thisarg.
... function.proto
type.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.proto
type.format() getter function that formats a date according to the locale and formatting options of this datetimeformat object.
... intl.datetimeformat.proto
type.formattoparts() returns an array of objects representing the date string in parts that can be used for custom locale-aware formatting.
... intl.datetimeformat.proto
type.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 proto
type 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 proto
type 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 proto
type 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.proto
type.length returns the length of the table, i.e.
... instance methods table.proto
type.get() accessor function — gets the element stored at a given index.
... table.proto
type.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 proto
type-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 proto
type chain explanation of the widely misunderstood and under-estimated proto
type-based inheritance.
...And 2 more matches
Authoring MathML - MathML
using mathml mathml in html pages you can use presentation mathml inside html5 documents: <!doc
type 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"?> <!doc
type 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
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 attribute
type="xml" attributename="width" to="100" begin="0s" dur="8s" fill="freeze" /> </rect> <rect x="35" y="60" height="15" width="0"> <animate attribute
type="xml" attributename="width" to="75" begin="2s" dur="6s" fill="freeze" /> </rect> <rect x="60" y="85" height="15" width="0"> <animate attribute
type="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 attribute
type="xml" attributename="width" to="50" id="first" begin="0s;third.end" dur="4s" /> </rect> <rect x="60" y="60" height="15" width="0"> <animate attribute
type="xml" attributename="width" to="25" id="second" begin="first.end" dur="2s" /> </rect> <rect x="85" y="85" height="15" width="0"> <animate attribute
type="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 attribute
type="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
svg attributes a to z a accent-height accumulate additive alignment-baseline allowreorder alphabetic amplitude arabic-form ascent attributename attribute
type 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 contentscript
type contentstyle
type 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
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
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 (proto
type 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 contentstyle
type 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 doc
type 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 < < less than sign > > greater than sign & & ampersand " " one double-quotation mark ' ' 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"?> <!doc
type body [ <!entity warning "warning: something bad happened...
...And 2 more matches
<xsl:output> - XSLT: Extensible Stylesheet Language Transformations
syntax <xsl:output method="xml" | "html" | "text" version=string encoding=string omit-xml-declaration="yes" | "no" standalone="yes" | "no" doc
type-public=string doc
type-system=string cdata-section-elements=list-of-names indent="yes" | "no" media-
type=string /> required attributes none.
... doc
type-public specifies the value of the public attribute of the doc
type declaration in the output document.
... doc
type-system specifies the value of the system attribute of the doc
type declaration in the output document.
...And 2 more matches
Index - XSLT: Extensible Stylesheet Language Transformations
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: <!doc
type 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: <!doc
type 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: <!doc
type 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.proto
type.getx = function () { return this._x; }; point.proto
type.setx = function (x) { this._x = x; }; point.proto
type.gety = function () { return this._y; }; point.proto
type.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 proto
type.
...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.proto
type.getx = function () { return internal(this).x; }; point.proto
type.setx = function (x) { internal(this).x = x; }; point.proto
type.gety = function () { return internal(this).y; }; point.proto
type.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.proto
type.getx = function () { return internal(this).x; }; point.proto
type.setx = function (x) { internal(this).x = x; }; point.proto
type.gety = function () { return internal(this).y; }; point.proto
type.sety = function () { internal(this).y = y; }; as a final note, the function ns returns a namespace that uses the namespace associated with the proto
type of the object as its proto
type.
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
process
type 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.proto
type.lookupnamespaceuri) {
type.proto
type.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.content
type, // mozilla only xmlnspattern = /^xmlns:(.*)$/; switch (node.node
type) { case 1: //...
... if (att.name === 'xmlns' && prefix == null) { // default namespace if (att.value) { return att.value; } return null; // unknown } } } if (node.parentnode && node.parentnode.node
type !== 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.node
type != 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" ?> <!doc
type 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"?> <!doc
type 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 ä, work only in conforming xhtml documents that have a valid xhtml formal public identifier (or in other words, a doc
type section with a public identifier).
WinRegValue - Archive of obsolete content
syntax winregvalue ( int data
type, byte[] regdata); parameters the winregvalue constructor takes the following parameter: data
type 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( window
type, url, features, params ) return
type: window open a child window.
... the window
type 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 sel
type="single".
... (all trees have sel
type="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" sel
type="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 accessible
type 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 dlg
type docshell documentcharsetinfo editable editingcolumn editingrow editingsession editor editor
type 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 sel
type 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.node
type 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 sub
type 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="*" query
type="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="*" query
type="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="*" query
type="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.seteditor
type(editor
type); 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
attributes iscontainer, isempty, parent, parse
type 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.
... parse
type 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, query
type, 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, query
type, 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.singletonwindow
type 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, a
type) { var compreg = acompmgr.queryinterface(nsicomponentregistrar); compreg.registerfactorylocation(class_id, class_name, contract_id, afilespec, alocation, a
type); 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, a
type) { 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.proto
type = { 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;" window
type="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, npmime
type 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 */ npwindow
type 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 npwindow
type value that specifies whether the npwindow instance represents a window or a drawable.
... values: npwindow
typewindow: indicates that the window field holds a platform-specific handle to a window (as in navigator 2.0 and navigator 3.0).
... npwindow
typedrawable: 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 mime
types array that is part of the navigator object.
...an algorithmic approach to detecting flash plugin version might be: var plugin = navigator.mime
types["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, '"').replace(/'/g, '''); } if (
typeof s === 'xml') { return s.tostring().replace(/"/g, '"').replace(/'/g, '''...
... createbundle('chrome://myeext/locale/myext.properties'); if (args){ args = array.proto
type.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.proto
type xml.proto
type and xmllist.proto
type (xmllist.proto
type is actually just xml.proto
type) cannot be extended in the same conventional way as other constructors such as object.
... you can only define methods in xml.proto
type and not fields.
... to add a method to xml.proto
type, define xml.proto
type.function::methodname or xml.proto
type.function::[methodnamestring].
... the following example defines the foocount() method, which returns the amount of <foo> elements in the xml: xml.proto
type.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.proto
type.concat() array.proto
type.slice() string.proto
type.charcodeat() string.proto
type.concat() string.fromcharcode() string.proto
type.match() string.proto
type.replace() string.proto
type.search() string.proto
type.slice() string.proto
type.substr() new operators delete equality operators (== and !=) new statements labeled statements switch do...while import export other new featu...
... array.proto
type.sort() now works on all platforms.
... string.proto
type.split() it can take a regular expression argument, as well as a fixed string, by which to split the object string.
... string.proto
type.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
data
type 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: <!doc
type 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 proto
type 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 setup
typescript.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: <!doc
type 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 "{{label}}"</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, map
typeid: google.maps.map
typeid.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-c
types 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-c
types via a global c
types object available in the global scope of the worker.
... examples of chromeworker's using js-c
types 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-c
types 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).process
type != components.interfaces.nsixulruntime.process_
type_default) {components.utils.import("resource://gre/modules/c
types.jsm");var zero = new c
types.intptr_t(8);var badptr = c
types.cast(zero, c
types.pointer
type(c
types.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(nscom
typeinfo<nsix>::getiid()) ) foundinterface = ns_static_cast(nsix*, this); else if ( aiid.equals(nscom
typeinfo<nsiy>::getiid()) ) foundinterface = ns_static_cast(nsiy*, this); // ...as many cases as needed...
... else if ( aiid.equals(nscom
typeinfo<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 nscom
typeinfo<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(nscom
typeinfo<nsix>::getiid()) ) foundinterface = ns_static_cast(nsix*, this); else if ( aiid.equals(nscom
typeinfo<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 proto
type: append(); doappend(); level: 0 basicformatter(); length: 1 keys of proto
type: format(); boundedfileappender(); length: 2 keys of proto
type: doappend(); reset(); ...
... consoleappender(); length: 1 keys of proto
type: doappend(); dumpappender(); length: 1 keys of proto
type: doappend(); fileappender(); length: 2 keys of proto
type: doappend(); reset(); formatter(); length: 0 keys of proto
type: format(); logmessage(); length: 4 keys of proto
type: leveldesc logger(); length: 2 keys of proto
type: addappender(); level logstructured(); ...
...name parent removeappender(); updateappenders(); and the methods mentioned below: logger methods loggerrepository(); length: 0 keys of proto
type: getlogger(); rootlogger storagestreamappender(); length: 1 keys of proto
type: doappend(); getinputstream(); newoutputstream(); outputstream reset(); structuredformatter(); length: 0 keys of proto
type: 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 proto
type, using a form similar to this.
... mycomponent.proto
type = { // 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.proto
type = { 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" attribute
type="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" attribute
type="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" attribute
type="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_getdesc
type 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_addr
type; print16 h_length; #else print32 h_addr
type; 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_addr
type 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_addr
type 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_ip
typeofservice, 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_ip
typeofservice 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, proto
type 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_getsymkey
type 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_mapsignkey
type 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_getpublickey
type 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 proto
type 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 (secitem
type), 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 (secitem
type), 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 = { (secitem
type) 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 proto
type 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 proto
type) 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, js
type hint, js::mutablehandle<js::value> vp); name
type description cx jscontext * the context in which to perform the conversion.
... hint js
type the hint to pass to the [[defaultvalue]] hook when converting the object.
... hint must be js
type_string or js
type_number to pass the corresponding
type as a hint, or js
type_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 proto
type.
... description js_getclassobject gets the builtin class costructor for the specified proto
type key.
... see also mxr id search for js_getclassobject js_getclassproto
type 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 proto
type chain.
...these functions all have similar behavior: the search starts with obj and proceeds along the proto
type chain.
... if neither obj nor any of its proto
types 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 js
type_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=js
type_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 proto
type key to convert.
... js::protokeytoid converts a specified proto
type 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_get
typename 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=js
type_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_get
typename (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 markpageas
typed 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 proto
type's region.
... sandboxproto
type a proto
type object for the sandbox.
... var sandboxscript = 'alert($)'; var options = { sandboxproto
type: 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 localizedrelation
type([out] bstr localizedrelation
type ); [propget] hresult ntargets([out] long ntargets ); [propget] hresult relation
type([out] bstr relation
type ); [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 localizedrelation
type() returns a localized version of the relation
type.
... [propget] hresult localizedrelation
type( [out] bstr localizedrelation
type ); parameters localizedrelation
type return value s_ok.
...relation
type() returns the
type of the relation.
... [propget] hresult relation
type( [out] bstr relation
type ); parameters relation
type 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 ascroll
type); void scrolltopoint(in unsigned long acoordinate
type, 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 ascroll
type ); parameters ascroll
type defines where the object should be placed on the screen (see nsiaccessiblescroll
type.constants for available constants).
... void scrolltopoint( in unsigned long acoordinate
type, in long ax, in long ay ); parameters acoordinate
type specifies whether the coordinates are relative to the screen or the parent object (for available constants refer to nsiaccessiblecoordinate
type.constants.
GetAccessibleRelated
« nsiaccessible page summary this method returns an accessible related to this one by the given relation
type.
... nsiaccessible getaccessiblerelated( in unsigned long arelation
type ); parameters arelation
type[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.
... event
type 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 item
type, 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.
... item
type unsigned long a bit field indicating one or more namespace
types.
... void init( in unsigned long item
type, in acstring namespacespec, in acstring data ); parameters item
type 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 acontent
type, 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 acontent
type, in boolean areplace ); parameters acontent
type 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 data
type 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.
... node
type 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 aselection
type); boolean canpaste(in long aselection
type); 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 format
type, 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 format
type, 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 contentsmime
type 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 amime
type); 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 amime
type ); parameters auri receives the "favicon uri" (not the "favicon link uri") associated to the requested page.
... amime
type 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 acat
type, 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 acat
type, in nsiarray items, optional in astring catname optional ); parameters acat
type 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 commit
type); 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 nsmsgviewflags
typevalue readonly: defaultsort
type nsmsgviewsort
typevalue 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 commit
type); parameters commit
type 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 isvalidfor
type(in nsmsgfilter
typetype 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 filter
type 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 nsmsgfilter
typetype filter
type); /* 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 (filter
type manual only) * @param filter
type type of filter being applied * @param msgwindow message window */ void apply(in nsiarray msghdrs /* nsimsgdbhdr array */, in autf8string actionvalue, in nsimsgcopyservicelistener copylistener, in nsmsgfilter
typetype filter
type, 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 notification
type, 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 notification
type, 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] nsmsgsearch
type setsearchparam(in nsmsgsearch
type 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: search
type nsmsgsearch
type 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] nsmsgsearch
type setsearchparam(in nsmsgsearch
type 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.
... dynamiccontainer
type autf8string a string representing the dynamic container api service responsible for this container.
... remotecontainer
type 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 aentry
type, 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 aentry
type, in boolean aflag, in nsiuri asource, in nsifile atarget optional ); parameters aentry
type 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.
... expire
type 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 socket
type); methods getsocketprovider() given a string representing a socket
type, this method returns an nsisocketprovider representing that socket
type.
... nsisocketprovider getsocketprovider( in string socket
type ); parameters socket
type 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 status
type, 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 status
type, in astring statustext, in nsisupports statuscontext ); parameters status
type indicates what is setting the text.
... statuscontext an object that provides context pertaining to the status
type.
... if status
type 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 aoutputcontent
type, 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 aoutputcontent
type, in unsigned long aencodingflags, in unsigned long awrapcolumn ); parameters adocument document to save to file.
... aoutputcontent
type 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 adisplay
type); 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 adisplay
type ); parameters apagedescriptor the page descriptor for the page to load.
... adisplay
type 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 c
type currently console.log doesn't show
type information of cdata.
... let { c
types } = components.utils.import("resource://gre/modules/c
types.jsm", {}); let i = c
types.int32_t(10); console.log(i); let point = c
types.struct
type("point", [{ x: c
types.int32_t }, { y: c
types.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 { c
types } = components.utils.import("resource://gre/modules/c
types.jsm", {}); let i = c
types.int32_t(10); console.log(i.tosource()); let point = c
types.struct
type("point", [{ x: c
types.int32_t }, { y: c
types.int32_t }]) let p = point(10, 20); console.log(p.tosource()); let pp = p.address(); console.log(pp.tosource()); the result will be : c
types.int32_t(10) point(10, 20) point.ptr(c
types.uint64("0x15fdafb08")) to see the complete
type information, you can use .constructor.tosource(), to print the source of c
type.
... let { c
types } = components.utils.import("resource://gre/modules/c
types.jsm", {}); let i = c
types.int32_t(10); console.log(i.constructor.tosource()); let point = c
types.struct
type("point", [{ x: c
types.int32_t }, { y: c
types.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: c
types.int32_t c
types.struct
type("point", [{ "x": c
types.int32_t }, { "y": c
types.int32_t }]) c
types.struct
type("point", [{ "x": c
types.int32_t }, { "y": c
types.int32_t }]).ptr ...
Declaring and Calling Functions
const clock = lib.declare("clock", c
types.default_abi, c
types.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", c
types.default_abi, c
types.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 c
types 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 response
type 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: <!doc
type 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.
... <!doc
type 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> <...
... <!doc
type 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) invalidnode
typeerror 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, document
type); 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.
... document
type optional is the document
type of the document to be created.
... living standard modified the return
type of createdocument() from document to xmldocument.
... the third argument of createdocument(), doc
type, 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 enc
type="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, snode
type = oevent.target.nodename.touppercase(); if (nchr === 0 || oevent.target.contenteditable.touppercase() === "true" || snode
type === "textarea" || snode
type === "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 msaudiodevice
type is not explicitly set, msaudiodevice
type 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 context
type argument.
... to get a different drawing context object you need to pass a different context
type or call the method on a different canvas element.
... syntax var ctx = canvas.getcontext(context
type); var ctx = canvas.getcontext(context
type, contextattributes); parameters context
type is a domstring containing the context identifier defining the drawing context associated to the canvas.
... if the context
type 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
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 <!doc
type 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 content
type 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 : { content
type : "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.initdata
types 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.is
typesupported() 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.is
typesupported(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.response
type = '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 <!doc
type 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 <!doc
type 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"]; } ?> <!doc
type 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 entry
type 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", "entry
type", "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 entry
type 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", "entry
type", "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 + " ; pointer
type = " + ev.pointer
type + " ; 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 + " ; pointer
type = " + ev.pointer
type + " ; 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: eventtargetbinary
type the property binary
type 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.binary
type 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 media
type.
... obsolete fields media
type 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 rtcsdp
type 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
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(shader
type, precision
type); parameters shader
type either a gl.fragment_shader or a gl.vertex_shader.
... precision
type 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
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 proto
type 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(event
type) event
type 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 <!doc
type 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
for overriding the proto
type 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
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.proto
type.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.proto
type.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): <!doc
type 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.proto
type.sendasbinary() polyfill :: |*| |*| https://developer.mozilla.org/docs/dom/xmlhttprequest#sendasbinary() |*| \*/ if (!xmlhttprequest.proto
type.sendasbinary) { xmlhttprequest.proto
type.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 xrreferencespace
type enumeration, but future updates to the webxr standard may add more features.
...these values currently must come from the enumerated
type xrreferencespace
type.
... 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 mime
type, 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
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
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
<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><span></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><em></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><em></code>, not a <code><span></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 open
type or true
type font variations in the @font-face rule.
... syntax /* use the default settings */ font-variation-settings: normal; /* set values for open
type 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 open
type 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: 'open
typefont'; 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 open
type.
...a stylset feature value definition allows an unlimited number of values: ident1: 2 4 12 1 maps to the open
type values ss02, ss04, ss12, and ss01.
... note that values higher than 99 are valid, but don't map to any open
type 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
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
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
open
type font features guide font features or variants refer to different glyphs or character styles contained within an open
type font.
...these are all referred to as open
type 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 open
type font features in css.
... variable fonts guide variable fonts are an evolution of the open
type 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
<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
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 lino
type", 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 open
type 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 true
type or open
type 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
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
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
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
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
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
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
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 <!doc
type 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("<!doc
type 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 <h1></option> <option value="h2">title 2 <h2></option> <option value="h3">title 3 <h3></option> <option value="h4">title 4 <h4></option> <option value="h5">title 5 <h5></option> <option value="h6">subtitle <h6></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 doc
type the doc
type for html5 is very simple.
... to indicate that your html content uses html5, simply use: <!doc
type 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 doc
types, 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
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
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
<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
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
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: auth
type 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
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 proto
type 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.proto
type = { getname: function() { return this.name; }, getmessage: function() { return this.message; } }; however, redefining the proto
type is not recommended.
... the following example instead appends to the existing proto
type: function myobject(name, message) { this.name = name.tostring(); this.message = message.tostring(); } myobject.proto
type.getname = function() { return this.name; }; myobject.proto
type.getmessage = function() { return this.message; }; in the two previous examples, the inherited proto
type 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 proto
type 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 proto
type 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 (==) mis
typed as assignment (=)?syntaxerror: unterminated string literal
typeerror: "x" has no properties
typeerror: "x" is (not) "y"
typeerror: "x" is not a constructor
typeerror: "x" is not a function
typeerror: "x" is not a non-null object
typeerror: "x" is read-only
typeerror: 'x' is not iterable
typeerror: more arguments needed
typeerror: reduce of empty array with no initial value
typeerror: x.proto
type.y called ...
...on incompatible
typetypeerror: can't access dead object
typeerror: can't access property "x" of "y"
typeerror: can't assign to property "x" on "y": not an object
typeerror: can't define property "x": "obj" is not extensible
typeerror: can't delete non-configurable array element
typeerror: can't redefine non-configurable property "x"
typeerror: cannot use "in" operator to search for "x" in "y"
typeerror: cyclic object value
typeerror: invalid "instanceof" operand "x"
typeerror: invalid array.proto
type.sort argument
typeerror: invalid arguments
typeerror: invalid assignment to const "x"
typeerror: property "x" is non-configurable and can't be deleted
typeerror: 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.proto
type.tolocaleformat is deprecatedwarning: javascript 1.6's for-each-in loops are deprecatedwarning: string.x is deprecated; use string.proto
type.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.proto
type.bytelength the read-only size, in bytes, of the arraybuffer.
... instance methods arraybuffer.proto
type.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.proto
type.tostring() returns a string of either true or false depending upon the value of the object.
... overrides the object.proto
type.tostring() method.
... boolean.proto
type.valueof() returns the primitive value of the boolean object.
... overrides the object.proto
type.valueof() method.
Intl.Collator - JavaScript
instance methods intl.collator.proto
type.compare getter function that compares two strings according to the sort order of this intl.collator object.
... intl.collator.proto
type.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.proto
type.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.proto
type.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.proto
type.format() returns a language-specific formatted string representing the elements of the list.
... intl.listformat.proto
type.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.proto
type.format() formats a value and a unit according to the locale and formatting options of the given intl.relativetimeformat object.
... intl.relativetimeformat.proto
type.formattoparts() returns an array of objects representing the relative time format in parts that can be used for custom locale-aware formatting.
... intl.relativetimeformat.proto
type.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.proto
type.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.proto
type.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.getproto
typeof(obj), object.getownpropertydescriptors(obj) ); creating a subclass a typical way of creating a subclass is to define the subclass, set its proto
type to an instance of the superclass, and then define properties on that instance.
...instead, you can use this code to set the proto
type: function superclass() {} superclass.proto
type = { // define your methods and properties here }; function subclass() {} subclass.proto
type = object.create( superclass.proto
type, { // 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 proto
type chain for the object unless the latter is filtered with hasownproperty()).
... items on the proto
type chain are not listed: function parentclass() {} parentclass.proto
type.inheritedmethod = function() {}; function childclass() { this.prop = 5; this.method = function() {}; } childclass.proto
type = new parentclass; childclass.proto
type.proto
typemethod = function() {}; console.log( object.getownpropertynames( new childclass() // ["prop", "method"] ) ); get non-enumerable properties only this uses the array.proto
type.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.proto
type.hasownproperty, hasdontenumbug = !({ tostring: null }).propertyisenumerable('tostring'), dontenums = [ 'tostring', 'tolocalestring', 'valueof', 'hasownproperty', 'isproto
typeof', '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.proto
type.apply() method to call a function with a given this value and arguments provided as an array (or an array-like object).
... function.proto
type.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.proto
type.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.proto
type.apply().
...also provides the option to specify a different proto
type.
... reflect.getproto
typeof(target) same as object.getproto
typeof().
... reflect.setproto
typeof(target, proto
type) a function that sets the proto
type of an object.
Symbol.match - JavaScript
this function is called by the string.proto
type.match() method.
...for example, the methods string.proto
type.startswith(), string.proto
type.endswith() and string.proto
type.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.proto
type.tostring() method.
... property attributes of symbol.tostringtag writable no enumerable no configurable no examples default tags object.proto
type.tostring.call('foo'); // "[object string]" object.proto
type.tostring.call([1, 2]); // "[object array]" object.proto
type.tostring.call(3); // "[object number]" object.proto
type.tostring.call(true); // "[object boolean]" object.proto
type.tostring.call(undefined); // "[object undefined]" object.proto
type.tostring.call(null); // "[object null]" // ...
... and more built-in tostringtag symbols object.proto
type.tostring.call(new map()); // "[object map]" object.proto
type.tostring.call(function* () {}); // "[object generatorfunction]" object.proto
type.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.proto
type.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.proto
type.tostring.call(new validatorclass()); // "[object validator]" tostringtag available on all dom proto
type objects due to a webidl spec change in mid-2020, browsers are adding a symbol.tostringtag property to all dom proto
type 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.proto
type.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 proto
type chain.
... object object to check if it (or its proto
type 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 proto
type chain.
... (if you want to check for only non-inherited properties, use object.proto
type.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 mime
type, 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_length
type_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_length
type_px unit
type to indicate that the value represents pixels.
<circle> - SVG: Scalable Vector Graphics
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
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
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
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 proto
type 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 mime
type: 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 data
type, 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 response
type property.
... the final code looks like this: request = new xmlhttprequest(); request.open('get', 'simple.wasm'); request.response
type = '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.
... proto
type: object that the returned sandbox will inherit from.
... let sandbox = sandbox({ name: 'resource:///modules/foo/bar.js', wantxrays: false, proto
type: { 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 message
type; if (flags & jsdierrorhook.report_error) message
type = "error"; if (flags & jsdierrorhook.report_warning) message
type = "warning"; if (flags & jsdierrorhook.report_exception) message
type = "uncaught-exception"; if (flags & jsdierrorhook.report_strict) message
type += "-strict"; dump(message
type + "\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.proto
type.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.proto
type = { 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: add
type 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(acontent
type, acontentlocation, arequestorigin, acontext, amime
typeguess, 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 == acontent
type) && 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 os
type, which is not exported.
... long story short, if you want to run it from a command line, you need to run: export os
type; make install and in the command in komodo, you should enter the following: bash -c "export os
type; 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"?> <!doc
type 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"?> <!doc
type 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 record
type = weave.engines.get(collection)._recordobj; let coll = new collection(weave.service.storageurl + collection, record
type); 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 record
type = weave.engines.get(collection)._recordobj; let coll = new collection(weave.service.storageurl + collection, record
type); 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 record
type = weave.engines.get(collection)._recordobj; let coll = new collection(weave.service.storageurl + collection, record
type); 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.
Introducing the Audio API extension - Archive of obsolete content
the following example extracts the data from an audio element: <!doc
type 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: <!doc
type 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: <!doc
type 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: <!doc
type 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: <!doc
type 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: <!doc
type 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 proto
type, 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 proto
type, 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 dlg
type dragging editable editor
type 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 parse
type persist persistence phase pickertooltiptext placeholder popup position predicate preference preference-editable primary priority properties query
type readonly ref rel removeelement resizeafter resizebefore rows screenx screeny searchbutton searchsessions searchlabel selected selectedindex sel
type 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 window
type 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_find
typelinks cmd_find
typetext 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, popup
type, anchor, align ) deprecated since gecko 1.9 return
type: no return value deprecated in favor of openpopup and openpopupatscreen opens a popup element.
... the popup
type 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"?> <!doc
type 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.
... query
type attribute doesn't specify a valid query processor this error indicates that the query
type 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"?> <!doc
type 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="search
type"> <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="search
type"> <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="search
type"> .
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
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 sel
type 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: <!doc
type 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: <!doc
type 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, query
type, 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, query
type, 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, query
type, 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
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, query
type, 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 acesssible
type, 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, query
type, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessible
type 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 acesssible
type 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, query
type, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessible
type 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, query
type, 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
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
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, query
type, 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, query
type, 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, query
type, 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, query
type, 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("myxulrunnerappwindow
type"); } 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 toopenwindowby
type is not defined if you get an error that "function toopenwindowby
type is not defined" you may add the following function to your scripts (doesn't seem to be in the venkman overlay): function toopenwindowby
type(in
type, 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" window
type="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 singletonwindow
type = nspreferences.copyunicharpref("toolkit.singletonwindow
type"); var windowmediator = components.classes["@mozilla.org/appshell/window-mediator;1"] .getservice(components.interfaces.nsiwindowmediator); var win = windowmediator.getmostrecentwindow(singletonwindow
type); 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-free
type2 -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 free
type which should contain the libxrender.* and libfree
type.* files that are need for the linking.
... moz_cairo_libs = -l$(libxul_dist)/lib -lmozcairo -lmozlibpixman \ -l/usr/sfw/lib -lxrender -lfree
type -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.proto
type.next returns property_name only.
... properties iterator.proto
type[@@iterator] returns a function that returns iterator object.
... methods iterator.proto
type.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.proto
type.includes() (firefox 43)
typedarray.proto
type.includes() (firefox 43) exponentiation operator (firefox 52) ecmascript 2017 object.values() (firefox 47) object.entries() (firefox 47) string.proto
type.padstart() (firefox 48) string.proto
type.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.struct
type &
typedobject.array
type.
Debug.msUpdateAsyncCallbackRelation - Archive of obsolete content
syntax debug.msupdateasynccallbackrelation(relatedasyncoperationid, relation
type) parameters relatedasyncoperationid the id associated with the asynchronous operation.
... relation
type optional the value that specifies the relationship status.
... the possible values for relation
type 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 proto
type object and properties.
...bug 510537 date.proto
type.tojson() returns a json format string for a date object.
... function.proto
type.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 sel
type="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 doc
type 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 mime
type 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-mime
type"> <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(npmime
type plugin
type, 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.proto
type.foreach = function (callback) { array.proto
type.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.
... <!doc
type 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): <!doc
type 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: <!doc
type html> — the doc
type.
...in the mists of time, when html was young (around 1991/92), doc
types 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-open
type'), url('fonts/heydings_controls-webfont.woff') format('woff'), url('fonts/heydings_controls-webfont.ttf') format('true
type'); 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 proto
types 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, "source
type": "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, "source
type": "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[insert
typenamehere]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.proto
type = { 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.proto
type.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.process
type == 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.same
typeroottreeitem; 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 unknownsocket
type netreset notcached isprinting deniedportaccess proxyresolvefailure proxyconnectfailure contentencodingfailure remotexul unsafecontent
type 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: prompt
type 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
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-c
types 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-c
types via a global c
types object available in the global scope of the worker.
... examples of chromeworker's using js-c
types are availabe on github and are linked to from the see also section below.
HTML parser threading
attribute values, public identifiers (in doc
type) and system identifiers (in doc
type) 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 doc
type 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 open
type math fonts in the default installation.
...typically, use a fontconfig configuration /etc/fonts/conf.avail/09-texlive-fonts.conf that points to the open
type directory of texlive, such as: <?xml version="1.0"?> <!doc
type fontconfig system "fonts.dtd"> <fontconfig> <dir>/your/path/to/texmf-dist/fonts/open
type</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 open
type postscript fonts, which are supported by most modern operating systems.
...for example asana math is available in true
type format and there is an unofficial true
type 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 open
type math fonts.
... to get the best rendering, be sure to have appropriate mathematical fonts installed on your system and to use a browser with open
type 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 open
type 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: my
type::my
type() { moz_count_ctor(my
type); ...
... } my
type::~my
type() { moz_count_dtor(my
type); ...
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_getprocess
type(), 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 listener
type=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.
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 user
type, ck_char_ptr ppin, ck_ulong ulpinlen ); parameters fc_login() takes four parameters: hsession [in] a session handle user
type [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.
... user
type 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 user
type, ck_char_ptr ppin, ck_ulong ulpinlen ); parameters nsc_login() takes four parameters: hsession [in] a session handle user
type [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.
... user
type 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-c
types --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<n> - 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 proto
type is function.proto
type; js_newobject : choosing a default proto
type explains exactly how this is computed.
... js::clonefunctionobject takes care to choose a proto
type 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, js
type type, js::mutablehandlevalue vp); name
type description cx jscontext * the context in which to perform the conversion.
...
type js
type 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 proto
type key to convert.
... description js::protokeytoid converts a specified js proto
type 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_proto
type 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_proto
type 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.
... exn
type int16_t one of the jsexn
type 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, js
type type, jsval *vp); name
type description cx jscontext * pointer to the js context in which the conversion is needed.
...
type js
type 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 proto
type 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 proto
type, or no property in obj or its proto
type 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 proto
type 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 proto
type 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 proto
type.
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 proto
type.
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 proto
type is function.proto
type; js_newobject: choosing a default proto
type explains exactly how this is computed.
... js_clonefunctionobject takes care to choose a proto
type 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 proto
type chain (returned in desc->obj).
... if desc->obj is null, then this property was not found on the proto
type 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<jsobject*> constructor/proto
type to test.
...when providing a proto
type as obj, the proto
type'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 proto
type 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_proto
type 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_proto
type 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 proto
type 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 proto
type, that result can be cached.
... js_newobjectwithgivenproto is exactly like js_newobject except that it doesn't use a default proto
type object if you pass null.
... instead the object is created with no proto
type.
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 decl
type(nullptr)).
... js_setcurrentembeddertimefunction (bug 1159507) js_getcurrentembeddertime (bug 1159507) js_mayresolvestandardclass (bug 1155946) js_getiteratorproto
type (bug 1225392) js_globallexicalscope (bug 1202902) js_hasextensiblelexicalscope (bug 1202902) js_extensiblelexicalscope (bug 1202902) js_initreflectparse (bug 987514) js::toprimitive (bug 1206168) js::getfirstargumentas
typehint (bug 1054756) js::objecttocompletepropertydescriptor (bug 1144366) js_setimmutableproto
type (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.proto
type 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.proto
type 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 proto
type, 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, ""); // ?
... <!doc
type 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...
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 ia2scroll
type scroll
type ); hresult scrolltopoint([in] enum ia2coordinate
type coordinate
type, [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 ia2scroll
type scroll
type ); parameters scroll
type defines where the object should be placed on the screen.
...hresult scrolltopoint( [in] enum ia2coordinate
type coordinate
type, [in] long x, [in] long y ); parameters coordinate
type 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 amime
type, 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 amime
type, in nsiuri areferer); note: prio...
...boolean installaddonsfromwebpage( in astring amime
type, 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 amime
type the mime
type for the add-ons.
...boolean isinstallenabled( in astring amime
type, in nsiuri areferer ); parameters amime
type 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 supportimagewithmime
type(in string mime
type); 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 supportimagewithmime
type() checks if a decoder for the an image with the given mime
type is available.
... boolean supportimagewithmime
type( in string mime
type ); parameters mime
type 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.
... mime
type 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 doc
type astring the doc
type of the document, as specified in the document.
...obsolete since gecko 1.9 mime
type 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 accessible
type 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 autoupdate
type, 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 autoupdate
type, in double noofdays ); parameters info autoupdate
type 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 string
types = ''; var
types = []; var pref_disabled_plugin_
types = 'plugin.disable_full_page_plugin_for_
types'; if (services.prefs.prefhasuservalue(pref_disabled_plugin_
types)) { string
types = services.prefs.getcharpref(pref_disabled_plugin_
types); } if (string
types !== '') {
types = string
types.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 a
type); 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 a
type ); parameters aclass the classid of the class being registered.
...a
type 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 acontent
type, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amime
typeguess, in nsisupports aextra); short shouldprocess(in unsigned long acontent
type, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amime
type, in nsisupports aextra); attributes attribute
type description allowseval boolean whether this policy al...
...short shouldload( in unsigned long acontent
type, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amime
typeguess, in nsisupports aextra ); parameters acontent
type acontentlocation arequestorigin acontext amime
typeguess 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 acontent
type, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amime
type, in nsisupports aextra ); parameters acontent
type acontentlocation arequestorigin acontext amime
type 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.
... biditext
type 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 a
type); 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 a
type ); parameters acompmgr the global component manager.
... a
type 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 * receiptheader
type 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 shutdown
type); 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 shutdown
type ); parameters shutdown
type 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" mime
types:mime
typearray 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__:navigatorproto
type 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 aurl
type, 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 url
type_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 url
type_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 url
type_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 aurl
type, in long adefaultport, in autf8string aspec, in string aorigincharset, in nsiuri abaseuri ); parameters aurl
type 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 acontent
type, 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 acontent
type, in long long acontentlength, in acstring amethod, in boolean astreamhasheaders ); parameters astream the stream to be uploaded by this channel.
... acontent
type 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.proto
type = { 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 proto
type 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
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
inserting the following processing instruction before the doc
type 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-c
types 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-c
types: a function or static data declared using the declare() method will hold that library alive.
... a c
type will hold referent c
type 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.mime
types by default when flash is inactive yes no no 'application/x-shockwave-flash' in navigator.mime
types 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.my
type" 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 documentproto
type node to a gc root.
... if one were removed, then the documentproto
type 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 open
type 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 free
type 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.
... <!doc
type 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.response
type = '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
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
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 sub
type represents.
... for example, if the current cssmathvalue sub
type 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 sub
type 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 proto
type 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
(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
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.proto
type.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.proto
type, characterdata.proto
type, document
type.proto
type]); another polyfill // from: https://github.com/fabiovergani/js-polyfill_element.proto
type.after/blob/master/after.js (function(x){ var o=x.proto
type,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.proto
type; 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
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, document
type, and characterdata objects.
...the characterdata and document
type 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.
... data
type : 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.createdocument
type() creates and returns a document
type.
... modified the return
type of createdocument() from document to xmldocument.
... obsolete added the createdocument() and createdocument
type() 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
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.proto
type.matches) { element.proto
type.matches = element.proto
type.matchesselector || element.proto
type.mozmatchesselector || element.proto
type.msmatchesselector || element.proto
type.omatchesselector || element.proto
type.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.proto
type.matches) { element.proto
type.matches = element.proto
type.msmatchesselector || element.proto
type.webkitmatchesselector; } specification specification status comment domthe definition of 'element.proto
type.matches' in that specification.
Event.msConvertURL() - Web APIs
syntax var retval = dragevent.msconverturl(file, target
type, targeturl); parameters file [in]
type: file the file object to be converted.
... target
type [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.proto
type.listeners = null; eventtarget.proto
type.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.proto
type.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
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.pointer
type) { 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 pointer
type 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.item
type read only returns a domsettabletokenlist… htmlelement.itemid is a domstring representing the item id.
... living standard added the following properties: translate, itemscope, item
type, itemid, itemref, itemprop, properties, and itemvalue.
... recommendation added the following properties: dataset, hidden, tabindex, accesskey, accesskeylabel, draggable, dropzone, contenteditable, iscontenteditable, contextmenu, spellcheck, command
type, 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
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
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.proto
type.includes = idbkeyrange.proto
type.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 content
type 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 : { content
type : "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 : { content
type : "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 : { content
type : "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 displaycapturesurface
type 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 pointer
type 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(mime
type, uri, title); mime
type 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.effective
type 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
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 node
types = 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 document
type nodes.
NodeList - Web APIs
this can be circumvented by using array.proto
type.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.proto
type.foreach for iteration: const list = document.queryselectorall('input[
type=checkbox]'); array.proto
type.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 shipping
type.
... shipping
type 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.getentriesby
type("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.getentriesby
type("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 getentriesby
type()).
... the measure's performance entry will have the following property values: entry
type - set to "measure".
... console.log(performance.getentriesby
type("measure")); // finally, clean up the entries.
PerformanceMark - Web APIs
performancemark is an abstract interface for performanceentry objects with an entry
type 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.entry
type returns "mark".
PerformanceMeasure - Web APIs
performancemeasure is an abstract interface for performanceentry objects with an entry
type 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.entry
type 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.entry
type read only returns "navigation".
... this interface also extends following performanceresourcetiming properties for navigation performance entry
types by qualifying and constraining them as follows: performanceresourcetiming.initiator
typeread 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 entry
types 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({entry
types: ["measure"]}); specifications specification status comment performance timeline level 2the definition of 'performanceobserver' in that specification.
PerformanceObserverEntryList - Web APIs
performanceobserverentrylist.getentriesby
type() 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.entry
type returns "paint".
... example function showpainttimings() { if (window.performance) { let performance = window.performance; let performanceentries = performance.getentriesby
type('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.entry
typeread only returns "resource".
... performanceresourcetiming.initiator
typeread only a string representing the
type of resource that initiated the performance entry, as specified in performanceresourcetiming.initiator
type.
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: content
type (usvstring) content (arraybuffer) generic transaction authorization.
...the content
type 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 tcp
type 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.
... credential
type 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 rtcicecredential
type 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
exceptions exceptions are thrown as domexception objects of the following
types: invalidnode
typeerror the node specified by endnode is a doc
type node; range endpoints cannot be located inside a doc
type 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
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
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
// 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 svgunit
types.
...takes one of the constants defined in svgunit
types.
... working draft removed the inheritance from svglangspace, svgexternalresourcesrequired, svgstylable, and svgunit
types and removed the setfilterres() function scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgfilterelement' in that specification.
SVGSVGElement - Web APIs
svgsvgelement.contentscript
type an svganimatedlength corresponding to the contentscript
type attribute of the given <svg> element.
... svgsvgelement.contentstyle
type an svganimatedlength corresponding to the contentstyle
type 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.response
type = '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.change
type() 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.is
typesupported(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.response
type = '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 proto
type 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
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 document
type nodes.
... syntax node
types = 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
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
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: content
type: 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 : { content
type : "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 src
type = gl.unsigned_byte; const pixel = new uint8array([0, 0, 255, 255]); // opaque blue gl.teximage2d(gl.texture_2d, level, internalformat, width, height, border, srcformat, src
type, pixel); const image = new image(); image.onload = function() { gl.bindtexture(gl.texture_2d, texture); gl.teximage2d(gl.texture_2d, level, internalformat, ...
... srcformat, src
type, 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 response
type 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-c
types in your worker.
...different
types of worker have scope objects that inherit from this interface and add more specific features.
Window.open() - Web APIs
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
(fetch is also available, with no such restrictions.) in firefox extensions, if you want to use workers with access to js-c
types, 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 content
type = client.getresponseheader("content-
type"); if (content
type != 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: document
type 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 <div>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.result
type being boolean_
type.
... exceptions
type_err in case xpathresult.result
type 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.result
type 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.result
type being number_
type.
... exceptions
type_err in case xpathresult.result
type is not number_
type, an xpathexception of
type type_err is thrown.
... html <div>xpath example</div> <div>number of <div>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.result
type being any_unordered_node_
type or first_ordered_node_
type.
... exceptions
type_err in case xpathresult.result
type 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.result
type being string_
type.
... exceptions
type_err in case xpathresult.result
type is not string_
type, an xpathexception of
type type_err is thrown.
... html <div>xpath example</div> <div>text content of the <div> 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 doc
type, which includes built-in support for aria.
... here is an example of the markup used for an html5 progress bar: <!doc
type 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
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 true
type or open
type 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 free
type 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
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
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
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<event
type>: <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 proto
types you can't set or access the values of any idl-defined attributes on dom proto
type objects.
... that means you can't, for example, change window.proto
type.onload.
HTML5 - Developer guides
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
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 <!doc
type 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
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.response
type = "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
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
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
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 <!doc
type 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
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
key
type the
type of key generated.
... the element is written as follows: <keygen name="name" challenge="challenge string" key
type="
type" keyparams="pqg-params"> the key
type parameter is used to specify what
type of key is to be generated.
...the key
type 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
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.
HTML: Hypertext Markup Language
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
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
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 <!doc
type 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 <!doc
type 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 proto
type-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 proto
type based object construction.
...once an object has been constructed it can be used as a blueprint (or proto
type) 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="music
types">choose some music
types, then click the button below:</label> <select id="music
types" name="music
types" 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.music
types)); }); </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.proto
type.tostring() or the bigint.proto
type.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.proto
type.tostring() or the bigint.proto
type.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.proto
type.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.proto
type.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.proto
type.toexponential() number.proto
type.tofixed() number.proto
type.toprecision() the allowed range for these methods is usually between 0 and 20 (or 21).
... method firefox (spidermonkey) chrome, opera (v8) number.proto
type.toexponential() 0 to 100 0 to 20 number.proto
type.tofixed() -20 to 100 0 to 20 number.proto
type.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.proto
type.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.proto
type.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 proto
type property arrow functions do not have a proto
type property.
... var foo = () => {}; console.log(foo.proto
type); // 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 proto
type, 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.getproto
typeof(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.proto
type.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.proto
type itself is an array: array.isarray(array.proto
type); // 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.proto
type }); 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.proto
type.next() returns a value yielded by the yield expression.
... generator.proto
type.return() returns the given value and finishes the generator.
... generator.proto
type.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.proto
type.format() getter function that formats a number according to the locale and formatting options of this numberformat object.
... intl.numberformat.proto
type.formattoparts() returns an array of objects representing the number string in parts that can be used for custom locale-aware formatting.
... intl.numberformat.proto
type.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.proto
type[@@iterator]()
typedarray.proto
type[@@iterator]() string.proto
type[@@iterator]() map.proto
type[@@iterator]() set.proto
type[@@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.proto
type.matchall() method.
... description this symbol is used for string.proto
type.matchall() and specifically in regexp.proto
type[@@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.proto
type.matchall() and regexp.proto
type[@@matchall]() for more examples.
Symbol.unscopables - JavaScript
however, in ecmascript 2015 and later, the array.proto
type.keys() method was introduced.
...a built-in unscopables setting is implemented as array.proto
type[@@unscopables] to prevent that some of the array methods are being scoped into the with statement.
... var keys = []; with (array.proto
type) { keys.push('something'); } object.keys(array.proto
type[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 proto
type-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.setproto
typeof() with which we are able to set the proto
type 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.setproto
typeof(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 proto
type.
... 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
examples html5 notation <!doc
type 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"?> <!doc
type 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.canplay
type and mediasource.is
typesupported...
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
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
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
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 attribute
type="xml" attributename="width" to="100" begin="0s" end="8s" fill="freeze" /> </rect> <rect x="10" y="60" height="15" width="0"> <animate attribute
type="xml" attributename="width" to="75" begin="0s" end="6s" fill="freeze" /> </rect> <rect x="10" y="85" height="15" width="0"> <animate attribute
type="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 attribute
type="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 attribute
type="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
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 attribute
type="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
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
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
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(some
typedarray) 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/": <!doc
type 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: <!doc
type 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 proto
types, 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 gettabcontent
type(tab) get the content
type 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 doc
type must be defined point to a dtd file in your locale folder such as: <!doc
type 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"?> <!doc
type 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"?> <!doc
type 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.proto
type.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.node
type) { 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.content
type; // 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.node
type) { 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,result
type,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,return
type,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 proto
types, such as string.proto
type, 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 proto
type conflicts.
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: < !doc
type 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, query
type, 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 accessible
type 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, query
type, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessible
type type: integer a value indicating the
type of accessibility object for the element.
grid - Archive of obsolete content
« 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, query
type, 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 accessible
type 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, query
type, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessible
type 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, query
type, 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, query
type, 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, query
type, 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 accessible
type 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, query
type, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessible
type 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, query
type, 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 accessible
type 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, query
type, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessible
type type: integer a value indicating the
type of accessibility object for the element.
toolbarspacer - Archive of obsolete content
properties accessible
type 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, query
type, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties ...
... accessible
type type: integer a value indicating the
type of accessibility object for the element.
toolbarspring - Archive of obsolete content
properties accessible
type 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, query
type, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width pr...
...operties accessible
type 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, query
type, 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 accessible
type 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, query
type, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessible
type 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, query
type, 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, query
type, 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 com
types 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 with
type="application/x-python" attribute.
Deploying XULRunner - Archive of obsolete content
here's a sample one: <?xml version="1.0" encoding="utf-8"?> <!doc
type 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>cfbundlepackage
type</key> <string>appl</string> <key>cfbundleshortversionstring</key> <string>1.0</string> <key>cfbundlesignature</key> <string>????</string> <!--only useful if your app handle urls--> <key>cfbundleurl
types</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.singletonwindow
type 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, proto
types, and wireframes for web and desktop software.
...latest release: june 2010 - build instructions utilities / proto
types 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, < data
type: "xml", < processdata: false, < data: content, < complete: getresponse, < content
type: soapclient.content
type + "; 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.content
type + '; 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"?> <!doc
type 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"?> <!doc
type 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.singletonwindow
type.
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.singletonwindow
type.
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.proto
type.execcommand = function (acommandname, aparam){ if (this.meditordocument) this.meditordocument.execcommand(acommandname, false, aparam); else throw "no meditordocument found"; } xbdesignmode.proto
type.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.
-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.
... <!doc
type 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 <!doc
type 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 <!doc
type 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.
... <!doc
type 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
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.proto
type.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.
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.
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 proto
typed 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.
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
<!doc
type 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 doc
type, 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
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.response
type =
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 => { ...
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 proto
types, and inheritance in javascript articles.
...we want you to: add a new method to the shape class's proto
type, 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 proto
types proto
types 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 proto
type chains work, and look at how the proto
type 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.location
type; 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.
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
c
types.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-c
types 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 file
type 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(nsxulproto
typeelement*, 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::node
type() 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 proto
type, 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 proto
type 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 <pr
types.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.
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 proto
type 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 proto
type 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 proto
type 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 proto
type 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 proto
type, the element reference is removed from the object, but the proto
type'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 proto
type, the element reference is removed from the object, but the proto
type'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 proto
type, 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 proto
type, 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 proto
type.) 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_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 proto
type 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 proto
type 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 proto
type 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 proto
type 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 proto
type either, since it is typically the first object created; call js_initstandardclasses to create all the standard objects, including object.proto
type, and set the global object's proto
type.
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.proto
type as [[proto
type]].
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 proto
types, 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 proto
type is object.proto
type.
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 nsmsgruleaction
type 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 nsmsgfilter
typetype filter
type, 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::attrib
type = 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.
... receiptheader
type 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 acontent
type, 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 acontent
type, in string afilename, in string aurl, in string amessageuri, in nsisupports adisplayconsumer, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener); parameters acontent
type 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 nsmsgruleaction
type 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.proto
type = { 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 pdp
type); 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 pdp
type ); parameters radiotech missing description apn missing description user missing description passwd missing description chappap missing description pdp
type 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 proto
type 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 session
type 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 status
type, 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 status
type, in wstring status ); parameters status
type 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 mime
type, 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 mime
type,...
... in domstring uri, in domstring title, in nsidomwindow contentwindow ); parameters mime
type 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 nsdocshellload
types.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 a
typearg, 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 a
typearg, in boolean acanbubblearg, in boolean acancelablearg, in domstring adataarg, in domstring aoriginarg, in nsisupports asourcearg ); parameters a
typearg 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.response
type = "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
oragestatementcallbackmozistoragestatementparamsmozistoragestatementrowmozistoragestatementwrappermozistoragevacuumparticipantmozistoragevaluearraymozitxttohtmlconvmozithirdpartyutilmozivisitinfomozivisitinfocallbackmozivisitstatuscallbacknsiabcardnsiaboutmodulensiabstractworkernsiaccelerometerupdatensiaccessnodensiaccessibilityservicensiaccessiblensiaccessiblecaretmoveeventnsiaccessiblecoordinate
typensiaccessibledocumentnsiaccessibleeditabletextnsiaccessibleeventnsiaccessiblehyperlinknsiaccessiblehypertextnsiaccessibleimagensiaccessibleprovidernsiaccessiblerelationnsiaccessibleretrievalnsiaccessiblerolensiaccessiblescroll
typensiaccessibleselectablensiaccessiblestatechangeeventnsiaccessiblestatesnsiaccessibletablensiaccessibletablecellnsiaccessibletablechangeeventnsiaccessibletextnsiaccessible...
...tprequestuploadnsixpcexceptionnsixpcscriptablensixpconnectnsixsltexceptionnsixsltprocessornsixsltprocessorobsoletensixulappinfonsixulbrowserwindownsixulbuilderlistenernsixulruntimensixulsortservicensixultemplatebuildernsixultemplatequeryprocessornsixultemplateresultnsixulwindownsixmlrpcclientnsixmlrpcfaultnsizipentrynsizipreadernsizipreadercachensizipwriternsmsgfilterfileattribvaluensmsgfolderflag
typensmsgjunkstatusnsmsgkeynsmsglabelvaluensmsgpriorityvaluensmsgruleaction
typensmsgsearchattribnsmsgsearchopnsmsgsearchscopensmsgsearchtermnsmsgsearch
typevaluensmsgsearchvaluensmsgsearchwidgetvaluenspipromptservice 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 proto
type 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.
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 getproto
typeof and setproto
typeof 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 doc
types) aren't reported.
...because of this, doc
types 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 <proto
type>: 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"], supported
types: ["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: content
type: 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 : { content
type : "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 response
type 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.response
type = '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 supported
types properties.
... var supportedinstruments = [{ supportedmethods: 'basic-card', data: { supportednetworks: ['visa', 'mastercard', 'amex', 'jcb', 'diners', 'discover', 'mir', 'unionpay'], supported
types: ['credit', 'debit'] } }]; var details = { ...
BasicCardRequest - Web APIs
basiccardrequest.supported
types 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
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
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
syntax var newblob = blob.slice(start, end, content
type); parameters start optional an index into the blob indicating the first byte to include in the new blob.
... content
type 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 unit
type 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(unit
type, floatvalue); parameters unit
type 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(string
type, stringvalue); parameters string
type 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.proto
type); 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
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 proto
type 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 stroke
type = args[0].tostring(); const strokewidth = parseint(args[1]); console.log(thecolor); if ( strokewidth ) { ctx.linewidth = strokewidth; } else { ctx.linewidth = 1.0; } if ( stroke
type === 'stroke' ) { ctx.fillstyle = 'transparent'; ctx.strokestyle = thecolor; } else if ( stroke
type === '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
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
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
<!doc
type 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 <!doc
type 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 <!doc
type 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)">↑</div> <div class="right" onclick="emit(39)">→<...
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
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.proto
type.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.proto
type, characterdata.proto
type, document
type.proto
type]); 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.proto
type.replacewith) element.proto
type.replacewith = replacewithpolyfill; if (!characterdata.proto
type.replacewith) characterdata.proto
type.replacewith = replacewithpolyfill; if (!document
type.proto
type.replacewith) document
type.proto
type.replacewith = replacewithpolyfill; specification specification status comment domthe definition of 'childnode.replacewith()' in that specification.
Clipboard.read() - Web APIs
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].get
type("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
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
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.
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 <!doc
type 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.forms - Web APIs
examples getting form information <!doc
type 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 <!doc
type 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.proto
type 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.proto
type.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 + " <p> 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
example <!doc
type 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
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
<!doc
type 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
"); // 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.proto
type.matches) { element.proto
type.matches = element.proto
type.msmatchesselector || element.proto
type.webkitmatchesselector; } if (!element.proto
type.closest) { element.proto
type.closest = function(s) { var el = this; do { if (element.proto
type.matches.call(el, s)) return el; el = el.parentelement || el.parentnode; } while (el !== null && el.node
type === 1); re...
... if (window.element && !element.proto
type.closest) { element.proto
type.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.
... <!doc
type 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.proto
type 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.proto
type.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
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
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
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 <!doc
type 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
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.
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
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
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
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.media
type) > -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.media
type) > -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
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.
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
key
type is a domstring that reflects the key
type 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.
HTMLMediaElement.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.proto
type.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.proto
type.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
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
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
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
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.
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 document
type 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 proto
types 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.response
type = '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.response
type = '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(context
type, contextattributes); parameters context
type is a domstring containing the context identifier defining the drawing context associated to the canvas.
... if the context
type 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
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.proto
type.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.proto
type, document.proto
type, documentfragment.proto
type]); 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.proto
type && constructor.proto
type.childelementcount == null) { object.defineproperty(constructor.proto
type, 'childelementcount', { get: function() { var i = 0, count = 0, node, nodes = this.childnodes; while (node = nodes[i++]) { if (node.node
type === 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' proto
type.
...;(function(constructor) { if (constructor && constructor.proto
type && constructor.proto
type.children == null) { object.defineproperty(constructor.proto
type, 'children', { get: function() { let i = 0, node, nodes = this.childnodes, children = []; while (node = nodes[i++]) { if (node.node
type === 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' proto
type.
...;(function(constructor) { if (constructor && constructor.proto
type && constructor.proto
type.firstelementchild == null) { object.defineproperty(constructor.proto
type, 'firstelementchild', { get: function() { var node, nodes = this.childnodes, i = 0; while (node = nodes[i++]) { if (node.node
type === 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' proto
type.
...;(function(constructor) { if(constructor && constructor.proto
type && constructor.proto
type.lastelementchild == null) { object.defineproperty(constructor.proto
type, 'lastelementchild', { get: function() { var node, nodes = this.childnodes, i = nodes.length - 1; while(node = nodes[i--]) { if(node.node
type === 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.proto
type.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.proto
type, document.proto
type, documentfragment.proto
type]); 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'], supported
types: ['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 entry
type 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.getentriesby
type("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 getentriesby
type() 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 getentriesby
type() to get all "mark" entries p = performance.getentriesby
type("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
the application defined timestamp can be retrieved by one of the performance interface's getentries*() methods (getentries(), getentriesbyname() or getentriesby
type()).
...const allentries = performance.getentriesby
type("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", "entry
type", "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.entry
type returns "frame".
PerformanceNavigationTiming.domComplete - Web APIs
function print_nav_timing_data() { // use getentriesby
type() to just get the "navigation" events var perfentries = performance.getentriesby
type("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 getentriesby
type() to just get the "navigation" events var perfentries = performance.getentriesby
type("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 getentriesby
type() to just get the "navigation" events var perfentries = performance.getentriesby
type("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 getentriesby
type() to just get the "navigation" events var perfentries = performance.getentriesby
type("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 getentriesby
type() to just get the "navigation" events var perfentries = performance.getentriesby
type("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 getentriesby
type() to just get the "navigation" events var perfentries = performance.getentriesby
type("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 getentriesby
type() to just get the "navigation" events var perfentries = performance.getentriesby
type("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 getentriesby
type() to just get the "navigation" events var perfentries = performance.getentriesby
type("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 getentriesby
type() to just get the "navigation" events var perfentries = performance.getentriesby
type("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({entry
types: ["mark", "frame"]}); function perf_observer(list, observer) { // process the "measure" event } var observer2 = new performanceobserver(perf_observer); observer2.observe({entry
types: ["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({entry
types: ["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({entry
types: ["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 getentriesby
type() to just get the "resource" events var p = performance.getentriesby
type("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 getentriesby
type() to just get the "resource" events var p = performance.getentriesby
type("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 getentriesby
type() to just get the "resource" events var p = performance.getentriesby
type("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 getentriesby
type() to just get the "resource" events var p = performance.getentriesby
type("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 getentriesby
type() to just get the "resource" events var p = performance.getentriesby
type("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 getentriesby
type() to just get the "resource" events var p = performance.getentriesby
type("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 getentriesby
type() to just get the "resource" events var p = performance.getentriesby
type("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 getentriesby
type() to just get the "resource" events var p = performance.getentriesby
type("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 getentriesby
type() to just get the "resource" events var p = performance.getentriesby
type("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 getentriesby
type() to just get the "resource" events var p = performance.getentriesby
type("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 getentriesby
type() to just get the "resource" events var p = performance.getentriesby
type("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 getentriesby
type() to just get the "resource" events var p = performance.getentriesby
type("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 getentriesby
type() to just get the "resource" events var p = performance.getentriesby
type("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 getentriesby
type() to just get the "resource" events var p = performance.getentriesby
type("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 getentriesby
type() to just get the "resource" events var p = performance.getentriesby
type("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
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 pointer
type) 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, tcp
type, 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 (p
type is the priority of the candidate's
type and plocal is the priority of the ip address): priority = 224×p
type + 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 tcp
type 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.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.proto
type.getstreambyid() if it's not natively available.
... // from: https://bugs.chromium.org/p/chromium/issues/detail?id=698163&desc=5#c10 rtcpeerconnection.proto
type.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.
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 invalidnode
typeerror 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 document
type node derived from the dtd identified using the doc
type 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 proto
type 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 document
type 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
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
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
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
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: request
type: 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
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 src
type = gl.unsigned_byte; const pixel = new uint8array([0, 0, 255, 255]); // opaque blue gl.teximage2d(gl.texture_2d, level, internalformat, width, height, border, srcformat, src
type, 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 src
type = gl.unsigned_byte; gl.bindtexture(gl.texture_2d, texture); gl.teximage2d(gl.texture_2d, level, internalformat, srcformat, src
type, 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
_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 <!doc
type 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 doc
type declaration.
...like a doc
type or schema, both parties must agree on the subprotocol; unlike a doc
type 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
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
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: <!doc
type 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(event
type) event
type 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 <!doc
type 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: <!doc
type 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.proto
type.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] } proto
type: 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 content
type = headermap["content-
type"]; this obtains the value of the content-
type header into the variable content
type.
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.response
type is not set to either the empty string or "text".
... example var xhr = new xmlhttprequest(); xhr.open('get', '/server', true); // if specified, response
type must be empty string or "text" xhr.response
type = '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 <div>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 <div>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.result
type 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.result
type 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.result
type 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
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.
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, logo
types, 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
/* 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
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
<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
/* 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
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
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
<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
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
<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 true
type or open
type variable fonts, the "wdth" variation is used to implement varying widths.
... for true
type or open
type variable fonts, the "wdth" variation is used to implement varying glyph widths.
src - CSS: Cascading Style Sheets
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("open
type"); 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("open
type"); } specifications specification status comment css fonts module level 3the definition of 'src' in that specification.
pointer - CSS: Cascading Style Sheets
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
<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
(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 open
type.
...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
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.
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
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
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> ]?
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
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
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
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
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
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
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
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
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
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
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
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
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
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
sending and receiving binary data the response
type 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 response
type, 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: <!doc
type 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: <!doc
type 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 ⁧ dir="rtl" sets the base direction to rtl, isolating the embedded content from the surrounding text first strong isolate (fsi) u+2068 ⁨ 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 ‪ 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 ‫ 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.
<embed>: The Embed External Content element - HTML: Hypertext Markup Language
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
<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">arche
type: </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
<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
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> ...
<textarea> - HTML: Hypertext Markup Language
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
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.
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.proto
type.resolvedoptions() returns a new object with properties reflecting the locale and collation options computed during initialization of the object.
... intl.pluralrules.proto
type.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 data
types.
...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 proto
type 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.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 proto
type 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 proto
type 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.proto
type.concat() method.
... property attributes of symbol.isconcatspreadable writable no enumerable no configurable no examples arrays by default, array.proto
type.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.proto
type.replace() method.
... for more information, see regexp.proto
type[@@replace]() and string.proto
type.replace().
Symbol.search - JavaScript
this function is called by the string.proto
type.search() method.
... for more information, see regexp.proto
type[@@search]() and string.proto
type.search().
Symbol.split - JavaScript
this function is called by the string.proto
type.split() method.
... for more information, see regexp.proto
type[@@split]() and string.proto
type.split().
WebAssembly.Memory - JavaScript
instance properties memory.proto
type.buffer an accessor property that returns the buffer contained in the memory.
... instance methods memory.proto
type.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 proto
type 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 proto
type chain.
... let obj = {self: '123'}; obj.__proto__.prot = '456'; const {self, prot} = obj; // self "123" // prot "456"(access to the proto
type 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.proto
type.showpublic = function() { return this.someproperty; }; thing.proto
type.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.proto
type (so that it will be available on every array).
...however, in this particular example, array.proto
type 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.proto
type; // 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.proto
type.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.
... action
type <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
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
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 true
type 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" attribute
type="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
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
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
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
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.node
type === 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...
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, query
type, 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
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, query
type, 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
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, query
type, 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, query
type, 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, query
type, 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...
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, query
type, 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, query
type, 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, query
type, 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...
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, query
type, 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
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, query
type, 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, query
type, 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, query
type, 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, query
type, 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
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, query
type, 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, query
type, 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...
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, query
type, 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
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, query
type, 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
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, query
type, 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, query
type, 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, query
type, 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, query
type, 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
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, query
type, 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, query
type, 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, query
type, 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, query
type, 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, query
type, 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, query
type, 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, query
type, 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, query
type, 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
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, query
type, 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...
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\...
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...
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/xml
typesel 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...
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-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.